From 3d95757c7144e5f4d086bd61bc3f6d38da753c97 Mon Sep 17 00:00:00 2001 From: miks1965 Date: Wed, 24 Oct 2018 16:22:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=20questionpoint1.pas=20=D0=9F=D0=BE=D1=87=D0=B5?= =?UTF-8?q?=D0=BC=D1=83-=D1=82=D0=BE=20=D0=BF=D0=B5=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BB=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D1=82?= =?UTF-8?q?=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 2 +- .../!Tutorial/08_ProcFunc/Proc2.pas | 6 ++--- Localization/DefaultLang.resources | Bin 86700 -> 87144 bytes Parsers/PascalABCParserNewSaushkin/PABC.ymc | 1 + ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/lambda_closure_class_methods1.pas | 22 ++++++++++++++++++ TestSuite/questionpoint1.pas | 11 --------- .../Closure/CapturedVariablesTreeBuilder.cs | 4 +++- .../SyntaxTreeVisitorNodes/Patterns.cs | 3 ++- 10 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 TestSuite/lambda_closure_class_methods1.pas delete mode 100644 TestSuite/questionpoint1.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index dd4be34ad..e849b857a 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 = "4"; public const string Build = "2"; - public const string Revision = "1837"; + public const string Revision = "1843"; 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 aac9d33fc..5c5d0d373 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %COREVERSION%=2 -%REVISION%=1837 +%REVISION%=1843 %MINOR%=4 %MAJOR%=3 diff --git a/InstallerSamples/!Tutorial/08_ProcFunc/Proc2.pas b/InstallerSamples/!Tutorial/08_ProcFunc/Proc2.pas index 498b595b6..c62936635 100644 --- a/InstallerSamples/!Tutorial/08_ProcFunc/Proc2.pas +++ b/InstallerSamples/!Tutorial/08_ProcFunc/Proc2.pas @@ -1,4 +1,4 @@ -// Параметры-переменные +// Параметры-переменные procedure DivMod(a,b: integer; var d,m: integer); begin @@ -14,9 +14,9 @@ begin a := 7; b := 3; DivMod(a,b,d,m); - writelnFormat('{0} div {1} = {2}; {0} mod {1} = {3}',a,b,a div b,a mod b); + writelnFormat('{0} div {1} = {2}; {0} mod {1} = {3}',a,b,d,m); a := 23; b := 5; DivMod(a,b,d,m); - writelnFormat('{0} div {1} = {2}; {0} mod {1} = {3}',a,b,a div b,a mod b); + writelnFormat('{0} div {1} = {2}; {0} mod {1} = {3}',a,b,d,m); end. \ No newline at end of file diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 1f0cab44538ef3a048dbb7b857a75c2e11be7e7f..7071c6eb6f32f7060eb44fd2b5e264ee9c938578 100644 GIT binary patch delta 493 zcmZ9IyGjE=6o!c)LPP{RE9U_$)WR;vx;vUcoQb;=5(^pMLqZx$3&Bcz!NNusK@cn? zg+;*DN;V;rO!hLnGXZ1Rco`w!r8^vc&VRn|>SCH-PM>&FN6vNo`OJW*yyH;QKnN4M z3F$UO&@Py{Czh}wmjMscK2SUc5d)#*66@~gERct{hk%OcLc%RQiP{3Dej7W(~mz#;*p22Z@+t5^#s`PJH7 z_7@7asguX$qD3b@9byozv%&n+`pe?%kBHD+9^KDWF)Hp+jNl(1MzM%1(8@JMSC@)7 jVI3B5tzC&=?CVX3Ms0FO01(4tZ$WgK4*qO8an#KwY@gU;+@Zjdbegin + class_ttt; + {gr := value} + end + end; + end; + +begin + Assert(1=1) +end. \ No newline at end of file diff --git a/TestSuite/questionpoint1.pas b/TestSuite/questionpoint1.pas deleted file mode 100644 index c582fceca..000000000 --- a/TestSuite/questionpoint1.pas +++ /dev/null @@ -1,11 +0,0 @@ -type - t1=class - o: object; - - property p1: System.Type read o?.GetType; - end; - -begin - var t := new t1; - Assert(t.p1=nil); -end. \ No newline at end of file diff --git a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs index a76c0f373..2f49217b5 100644 --- a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs +++ b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesTreeBuilder.cs @@ -178,7 +178,9 @@ namespace TreeConverter.LambdaExpressions.Closure ; //trjuk, chtoby ne perelopachivat ves kod. zamenjaem ident na self.ident // Использую этот трюк для нестатических полей предков - они не захватываются из-за плохого алгоритма захвата - if ((si.sym_info.semantic_node_type == semantic_node_type.class_field && !(si.sym_info as class_field).IsStatic || si.sym_info.semantic_node_type == semantic_node_type.common_event || si.sym_info.semantic_node_type == semantic_node_type.common_property_node) && InLambdaContext) + if ((si.sym_info.semantic_node_type == semantic_node_type.class_field && !(si.sym_info as class_field).IsStatic + || si.sym_info.semantic_node_type == semantic_node_type.common_method_node && !(si.sym_info as common_method_node).IsStatic + || si.sym_info.semantic_node_type == semantic_node_type.common_event || si.sym_info.semantic_node_type == semantic_node_type.common_property_node) && InLambdaContext) { dot_node dn = new dot_node(new ident("self", id.source_context), new ident(id.name, id.source_context), id.source_context); bool ok = true; diff --git a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs index a3260092b..344b36bfc 100644 --- a/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs +++ b/TreeConverter/TreeConversion/SyntaxTreeVisitorNodes/Patterns.cs @@ -225,7 +225,8 @@ namespace PascalABCCompiler.TreeConverter /// private void ExecuteCommonChecks(common_function_node deconstructor) { - if ((deconstructor as common_method_node).IsStatic) + var dd = deconstructor as common_method_node; + if (dd != null && dd.IsStatic) AddError(deconstructor.loc, "DECONSTRUCTOR_SHOULD_NOT_BE_STATIC"); if (deconstructor.return_value_type != null) AddError(deconstructor.loc, "DECONSTRUCTOR_SHOULD_BE_A_PROCEDURE");