diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 031f32ac2..5c567932d 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 = "8"; public const string Build = "2"; - public const string Revision = "3069"; + public const string Revision = "3071"; 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 b8db25841..af4616b5e 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=3069 +%REVISION%=3071 %COREVERSION%=2 %MAJOR%=3 diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 351747fda..9baae50e4 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: DESKTOP-G8V08V4 -// DateTime: 28.12.2021 18:50:18 +// DateTime: 29.01.2022 17:58:31 // UserName: ????????? // GPLEX input file // GPLEX frame file diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 758a46670..08c83d124 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -3412,7 +3412,7 @@ new_expr { // sugared node var l = $4 as name_assign_expr_list; - var exprs = l.name_expr.Select(x=>x.expr).ToList(); + var exprs = l.name_expr.Select(x=>x.expr.Clone() as expression).ToList(); var typename = "AnonymousType#"+Guid(); var type = new named_type_reference(typename,@1); @@ -3424,13 +3424,13 @@ new_expr ; field_in_unnamed_object - : identifier tkAssign relop_expr + : identifier tkAssign expr_l1 { if ($3 is nil_const) parsertools.AddErrorFromResource("NIL_IN_UNNAMED_OBJECT",@$); $$ = new name_assign_expr($1,$3,@$); } - | relop_expr + | expr_l1 { ident name = null; var id = $1 as ident; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 86b35df0b..81b27d093 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,7 +2,7 @@ // GPPG version 1.3.6 // Machine: DESKTOP-G8V08V4 -// DateTime: 28.12.2021 18:50:19 +// DateTime: 29.01.2022 17:58:31 // UserName: ????????? // Input file @@ -1634,15 +1634,15 @@ public partial class GPPGParser: ShiftReduceParser identifier, tkAssign, relop_expr + case 624: // field_in_unnamed_object -> identifier, tkAssign, expr_l1 { if (ValueStack[ValueStack.Depth-1].ex is nil_const) parsertools.AddErrorFromResource("NIL_IN_UNNAMED_OBJECT",CurrentLocationSpan); CurrentSemanticValue.ob = new name_assign_expr(ValueStack[ValueStack.Depth-3].id,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); } break; - case 625: // field_in_unnamed_object -> relop_expr + case 625: // field_in_unnamed_object -> expr_l1 { ident name = null; var id = ValueStack[ValueStack.Depth-1].ex as ident; diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 66b283ed8..633c398c2 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -353,5 +353,6 @@ script= + diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index fc97284e7..3ec570cfa 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.2.3069 +3.8.2.3071 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index bb17fbf36..8b2b1b3c5 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.2.3069' +!define VERSION '3.8.2.3071' diff --git a/TestSuite/ifexpr_in_newclass.pas b/TestSuite/ifexpr_in_newclass.pas new file mode 100644 index 000000000..fdc5c502f --- /dev/null +++ b/TestSuite/ifexpr_in_newclass.pas @@ -0,0 +1,5 @@ +## +var a := new class(x := true?1:2); //Ошибка: Встречено '?', а ожидалось '=' +var b := new class(x := if true then 1 else 2); //Ошибка: Встречено 'if', а ожидалось выражение +Assert(a.x = 1); +Assert(b.x = 1); \ No newline at end of file