diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 74b86e351..65e04f26d 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "5"; public const string Build = "0"; - public const string Revision = "2238"; + public const string Revision = "2241"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 00a7eebfc..e30c5ee25 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=0 -%REVISION%=2238 %MINOR%=5 +%REVISION%=2241 +%COREVERSION%=0 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 36419a4e4..32cd0e423 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.5.0.2238 +3.5.0.2241 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 065631148..49d430a74 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.5.0.2238' +!define VERSION '3.5.0.2241' diff --git a/TestSuite/CompilationSamples/WPFObjects.pas b/TestSuite/CompilationSamples/WPFObjects.pas index 53c0f76a6..a58280873 100644 --- a/TestSuite/CompilationSamples/WPFObjects.pas +++ b/TestSuite/CompilationSamples/WPFObjects.pas @@ -92,7 +92,7 @@ type // ----------------------------------------------------- ///!# /// Класс списка графических объектов - ObjectsType = class//(IEnumerable) + ObjectsType = class(IEnumerable) private l := new List; d := new Dictionary; @@ -130,14 +130,14 @@ type property Items[i: integer]: ObjectWPF read GetItem write SetItem; default; function Seq: sequence of ObjectWPF := l; - {function GetEnumerator: IEnumerator; + function GetEnumerator: IEnumerator; begin Result := l.GetEnumerator; end; function System.Collections.IEnumerable.GetEnumerator: System.Collections.IEnumerator; begin Result := l.GetEnumerator; - end;} + end; end; diff --git a/TestSuite/CompilationSamples/graph3d.pas b/TestSuite/CompilationSamples/graph3d.pas index 26cce52f1..f8fc3d7fe 100644 --- a/TestSuite/CompilationSamples/graph3d.pas +++ b/TestSuite/CompilationSamples/graph3d.pas @@ -2644,6 +2644,9 @@ function EmptyAnim(sec: real): EmptyAnimation; // ----------------------------------------------------- //>> Graph3D: функции для определения ближайших точек и объектов # Graph3D functions for nearest points and objects // ----------------------------------------------------- +/// Создаёт траекторию в виде массива точек, заданную параметрически. Функция fun отображает параметр t на координаты точки в пространстве +function ParametricTrajectory(a,b: real; N: integer; fun: real->Point3D): sequence of Point3D; + /// Возвращает ближайший 3D-объект, который пересекает луч, выпущенный из камеры и проходящий через точку (x,y) экрана function FindNearestObject(x, y: real): Object3D; @@ -3419,6 +3422,8 @@ function Triangle(p1, p2, p3: Point3D; m: Material): TriangleT := Inv(()->Triang // Функции для точек, лучей, прямых, плоскостей +function ParametricTrajectory(a,b: real; N: integer; fun: real->Point3D) := PartitionPoints(a,b,N).Select(fun); + function FindNearestObject(x, y: real): Object3D; begin Result := nil; diff --git a/TestSuite/errors/err0339.pas b/TestSuite/errors/err0339.pas new file mode 100644 index 000000000..0c20d0eb2 --- /dev/null +++ b/TestSuite/errors/err0339.pas @@ -0,0 +1,3 @@ +begin + System.Threading.Tasks.Task.Run&(nil); +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs index cfb6b55e8..61b7e171f 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -2325,15 +2325,22 @@ namespace PascalABCCompiler.TreeConverter var kres = funcs.Select(f => get_type(f.parameters[i].type).GetGenericArguments()[cnt - 1]).ToArray(); //if (funcs[0].is_extension_method) - var fldiResType = funcs[0].is_extension_method ? // странно, но всегда кво параметров в syntax_nodes_parameters на 1 меньше. Иначе падает - ((syntax_nodes_parameters[i - 1] as SyntaxTree.function_lambda_definition).RealSemTypeOfResult as compiled_type_node).compiled_type : - ((syntax_nodes_parameters[i - 1] as SyntaxTree.function_lambda_definition).RealSemTypeOfResult as compiled_type_node).compiled_type; - // Две последние строчки одинаковы. Это странно + Type fldiResType = null; + if (funcs[0].is_extension_method) + { + fldiResType = ((syntax_nodes_parameters[i - 1] as SyntaxTree.function_lambda_definition)?.RealSemTypeOfResult as compiled_type_node)?.compiled_type; + } + else + { + fldiResType = ((syntax_nodes_parameters[i] as SyntaxTree.function_lambda_definition)?.RealSemTypeOfResult as compiled_type_node)?.compiled_type; + } + // странно, но всегда кво параметров в syntax_nodes_parameters на 1 меньше. Иначе падает + // Получается, что fldiResType рассчитывается только если фактическими функциональными параметрами выступают лямбда-выражения. Если имена функций - это не сработает. Это - ОШИБКА! for (int n = 0; n < bools.Count; n++) { - if (!fldiResType.Equals(kres[n])) + if (fldiResType == null || !fldiResType.Equals(kres[n])) bools[n] = false; } } diff --git a/bin/Lib/WPFObjects.pas b/bin/Lib/WPFObjects.pas index 53c0f76a6..a58280873 100644 --- a/bin/Lib/WPFObjects.pas +++ b/bin/Lib/WPFObjects.pas @@ -92,7 +92,7 @@ type // ----------------------------------------------------- ///!# /// Класс списка графических объектов - ObjectsType = class//(IEnumerable) + ObjectsType = class(IEnumerable) private l := new List; d := new Dictionary; @@ -130,14 +130,14 @@ type property Items[i: integer]: ObjectWPF read GetItem write SetItem; default; function Seq: sequence of ObjectWPF := l; - {function GetEnumerator: IEnumerator; + function GetEnumerator: IEnumerator; begin Result := l.GetEnumerator; end; function System.Collections.IEnumerable.GetEnumerator: System.Collections.IEnumerator; begin Result := l.GetEnumerator; - end;} + end; end; diff --git a/bin/school.pct b/bin/school.pct index fca744f28..9b5b11652 100644 --- a/bin/school.pct +++ b/bin/school.pct @@ -1,18 +1,3 @@ -[Left/Команды Робота/Команда перемещения влево] -Left; - -[Right/Команды Робота/Команда перемещения вправо] -Right; - -[Up/Команды Робота/Команда перемещения вверх] -Up; - -[Down/Команды Робота/Команда перемещения вниз] -Down; - -[Paint/Команды Робота/Команда закрашивания текущей клетки] -Paint; - [Новая программа/Основное/Шаблон новой программы] begin | @@ -72,3 +57,4 @@ until условие; case | of • : …; end; +