From 75e79d9a82e9c17ca1279c98df1aaea5529acb6d Mon Sep 17 00:00:00 2001 From: nevermind322 <81963698+nevermind322@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:54:40 +0300 Subject: [PATCH] Assign tuple optimizer (#3160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * branch init * add BindCollectLightSymInfo * moved lightsyminfo to syntaxVisitors * LIghtSymInfo fixes * binder 0.1 * Attributes -> SymbolAttributes * AssignTupleOptimizer -> AssignTupleDesugar * moved algorithm classes to AssignTupleDesugarAlgorithm namespace * fixes and refactoring * LightSymInfo rework * add rebuildDebug and build units * enable VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer * remove CollectFullLightSymInfo call * bind now return BindResult * change BindResult path type * path testing * fix Current in BindCollectLightSymInfo * fix Current in BindCollectLightSymInfo * fix #3116 * (the rest of the fix) * potential symomyms handling without assigns count minimization * assign count minimization * rename AssignTuplesDesugar * move NewAssignTupleDesugar * add optimization switch * delete AssignTupleDesugar project * remove comments * collect symbols from var tuples * optimize var_tuple_def_statement and assign_var_tuple * fix * fix Tuple Visitor * #3091 * #3125 * revert #3125 * #3125 * #3123 * #3123 * #3127 * fix * del doc * await переместил * Перегенерировал грамматику * s.ToLines RenameDirectory * Исправление ToLines * Убрал из грамматики узлы await - случайно оставались * Sync `.ToLines` with `System.IO.StringReader` (#3154) * 3.9.0.3494 * add const optimization * #3152 * #3152 --------- Co-authored-by: Sun Serega Co-authored-by: Ivan Bondarev Co-authored-by: Mikhalkovich Stanislav Co-authored-by: Артём Филонов --- Compiler/Compiler.cs | 28 +- Compiler/PCU/PCUReader.cs | 5 +- Compiler/PCU/PCUWriter.cs | 5 +- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- .../PascalABCParserNewSaushkin/ABCPascal.cs | 6 +- .../PascalABCParserNewSaushkin/ABCPascal.y | 2 - .../ABCPascalYacc.cs | 4584 ++++++++--------- .../PascalABCParserNewSaushkin/PABC.ymc | 3 + Localization/DefaultLang.resources | Bin 101866 -> 102073 bytes NETGenerator/NETGenerator.cs | 14 +- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- .../RenameSameBlockLocalVarsVisitor.cs | 7 +- TestSuite/CompilationSamples/PABCSystem.pas | 81 +- TestSuite/errors/err0538.pas | 8 + TestSuite/errors/err0539.pas | 11 + TestSuite/recinit3.pas | 11 + TestSuite/units/u_events6.pas | 10 + TestSuite/usesunits/use_events6.pas | 20 + TestSuite/yield8.pas | 29 + .../TreeConversion/syntax_tree_visitor.cs | 7 +- bin/Lib/PABCSystem.pas | 81 +- 23 files changed, 2549 insertions(+), 2373 deletions(-) create mode 100644 TestSuite/errors/err0538.pas create mode 100644 TestSuite/errors/err0539.pas create mode 100644 TestSuite/recinit3.pas create mode 100644 TestSuite/units/u_events6.pas create mode 100644 TestSuite/usesunits/use_events6.pas create mode 100644 TestSuite/yield8.pas diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index 027f296c6..3c97424ae 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -2709,16 +2709,19 @@ namespace PascalABCCompiler if (!PCUFileNamesDictionary.TryGetValue(cacheKey, out var fileNameWithPriority)) { - if (FindFileWithExtensionInDirs(fileName, out _, currentPath) is string resultFileName1) + if (Path.GetExtension(fileName) != CompilerOptions.CompiledUnitExtension) + fileNameWithPriority = null; + + else if (FindFileWithExtensionInDirs(fileName, out _, currentPath) is string resultFileName1) fileNameWithPriority = Tuple.Create(resultFileName1, 1); - else if (FindFileWithExtensionInDirs(Path.GetFileName(fileName), out _, CompilerOptions.OutputDirectory) is string resultFileName2) + else if (CompilerOptions.OutputDirectory != CompilerOptions.SourceFileDirectory && FindFileWithExtensionInDirs(Path.GetFileName(fileName), out _, CompilerOptions.OutputDirectory) is string resultFileName2) fileNameWithPriority = Tuple.Create(resultFileName2, 2); else if (FindFileWithExtensionInDirs(fileName, out var dirIndex, CompilerOptions.SearchDirectories.ToArray()) is string resultFileName3) fileNameWithPriority = Tuple.Create(resultFileName3, 3 + dirIndex); else fileNameWithPriority = null; - PCUFileNamesDictionary[cacheKey] = fileNameWithPriority; + PCUFileNamesDictionary[cacheKey] = fileNameWithPriority; } folderPriority = fileNameWithPriority?.Item2 ?? 0; @@ -2730,8 +2733,9 @@ namespace PascalABCCompiler var cacheKey = Tuple.Create(fileName.ToLower(), currentPath?.ToLower()); if (!SourceFileNamesDictionary.TryGetValue(cacheKey, out var fileNameWithPriority)) - { - if (FindSourceFileNameInDirs(fileName, out _, currentPath) is string resultFileName1) + { + + if (FindSourceFileNameInDirs(fileName, out _, currentPath) is string resultFileName1) fileNameWithPriority = Tuple.Create(resultFileName1, 1); else if (FindSourceFileNameInDirs(fileName, out var dirIndex, CompilerOptions.SearchDirectories.ToArray()) is string resultFileName2) fileNameWithPriority = Tuple.Create(resultFileName2, 3 + dirIndex); @@ -3362,8 +3366,18 @@ namespace PascalABCCompiler // It's not always possible to solve by re-ordering the references, since there are cases of // mutually-dependent assemblies (i.e. dependency loops) in the wild. foreach (var reference in referenceDirectives) - PreloadReference(reference); - + { + try + { + PreloadReference(reference); + } + catch (FileLoadException ex) + { + throw new CommonCompilerError(ex.Message, compilationUnit.SyntaxTree.file_name, reference.location.begin_line_num, reference.location.end_line_num); + } + } + + foreach (var reference in referenceDirectives) CompileReference(dlls, reference); diff --git a/Compiler/PCU/PCUReader.cs b/Compiler/PCU/PCUReader.cs index baf3a0279..42acd1a4e 100644 --- a/Compiler/PCU/PCUReader.cs +++ b/Compiler/PCU/PCUReader.cs @@ -1847,7 +1847,10 @@ namespace PascalABCCompiler.PCU common_method_node raise_meth = null; if (CanReadObject()) raise_meth = GetClassMethod(br.ReadInt32()); - class_field cf = GetClassField(br.ReadInt32()); + int field_off = br.ReadInt32(); + class_field cf = null; + if (field_off > 0) + cf = GetClassField(field_off); common_type_node cont = (common_type_node)GetTypeReference(br.ReadInt32()); if (name==null) name = GetStringInClass(cont, name_ref); diff --git a/Compiler/PCU/PCUWriter.cs b/Compiler/PCU/PCUWriter.cs index c85cdaf1f..e75c2e3e9 100644 --- a/Compiler/PCU/PCUWriter.cs +++ b/Compiler/PCU/PCUWriter.cs @@ -3021,7 +3021,10 @@ namespace PascalABCCompiler.PCU bw.Write(GetMemberOffset(_event.remove_method)); if (CanWriteObject(_event.raise_method)) bw.Write(GetMemberOffset(_event.raise_method)); - bw.Write(GetMemberOffset(_event.field)); + if (!_event.cont_type.IsInterface) + bw.Write(GetMemberOffset(_event.field)); + else + bw.Write(0); bw.Write(offset); bw.Write((byte)_event.field_access_level); bw.Write((byte)_event.polymorphic_state); diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 3eed9784f..e551f563c 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 = "9"; public const string Build = "0"; - public const string Revision = "3489"; + public const string Revision = "3494"; 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 f77451bb9..e120ee4a5 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=9 -%REVISION%=3489 %COREVERSION%=0 +%REVISION%=3494 +%MINOR%=9 %MAJOR%=3 diff --git a/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.cs b/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.cs index 5f1bb305c..3dc56fbf3 100644 --- a/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-V3E9T2U -// DateTime: 25.05.2024 22:13:44 -// UserName: alex +// Machine: DESKTOP-G8V08V4 +// DateTime: 17.06.2024 16:43:45 +// UserName: ????????? // GPLEX input file // GPLEX frame file // diff --git a/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.y b/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.y index ebc8d14d3..f55b27386 100644 --- a/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascal.y @@ -3373,8 +3373,6 @@ expr_l1_for_lambda expr_dq : relop_expr { $$ = $1; } - | tkAwait relop_expr - { $$ = $2; } | expr_dq tkDoubleQuestion relop_expr { $$ = new double_question_node($1 as expression, $3 as expression, @$);} ; diff --git a/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 43dd19986..740f623e0 100644 --- a/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Languages/Pascal/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-V3E9T2U -// DateTime: 25.05.2024 22:13:45 -// UserName: alex +// Machine: DESKTOP-G8V08V4 +// DateTime: 17.06.2024 16:43:46 +// UserName: ????????? // Input file // options: no-lines gplex @@ -72,8 +72,8 @@ public partial class GPPGParser: ShiftReduceParser aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[1028]; - private static State[] states = new State[1704]; + private static Rule[] rules = new Rule[1027]; + private static State[] states = new State[1702]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "class_or_static", "assignment", "optional_array_initializer", "attribute_declarations", "ot_visibility_specifier", "one_attribute", "attribute_variable", @@ -170,13 +170,13 @@ public partial class GPPGParser: ShiftReduceParser relop_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 619: // expr_dq -> tkAwait, relop_expr -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 620: // expr_dq -> expr_dq, tkDoubleQuestion, relop_expr + case 619: // expr_dq -> expr_dq, tkDoubleQuestion, relop_expr { CurrentSemanticValue.ex = new double_question_node(ValueStack[ValueStack.Depth-3].ex as expression, ValueStack[ValueStack.Depth-1].ex as expression, CurrentLocationSpan);} break; - case 621: // sizeof_expr -> tkSizeOf, tkRoundOpen, simple_or_template_type_reference, + case 620: // sizeof_expr -> tkSizeOf, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new sizeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, null, CurrentLocationSpan); } break; - case 622: // typeof_expr -> tkTypeOf, tkRoundOpen, simple_or_template_type_reference, + case 621: // typeof_expr -> tkTypeOf, tkRoundOpen, simple_or_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new typeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 623: // typeof_expr -> tkTypeOf, tkRoundOpen, empty_template_type_reference, + case 622: // typeof_expr -> tkTypeOf, tkRoundOpen, empty_template_type_reference, // tkRoundClose { CurrentSemanticValue.ex = new typeof_operator((named_type_reference)ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 624: // question_expr -> expr_l1_for_question_expr, tkQuestion, + case 623: // question_expr -> expr_l1_for_question_expr, tkQuestion, // expr_l1_for_question_expr, tkColon, // expr_l1_for_question_expr { @@ -5935,7 +5929,7 @@ public partial class GPPGParser: ShiftReduceParser tkIf, expr_l1_for_new_question_expr, tkThen, + case 624: // new_question_expr -> tkIf, expr_l1_for_new_question_expr, tkThen, // expr_l1_for_new_question_expr, tkElse, // expr_l1_for_new_question_expr { @@ -5951,58 +5945,58 @@ public partial class GPPGParser: ShiftReduceParser simple_type_identifier, + case 625: // empty_template_type_reference -> simple_type_identifier, // template_type_empty_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-2].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 627: // empty_template_type_reference -> simple_type_identifier, tkAmpersend, + case 626: // empty_template_type_reference -> simple_type_identifier, tkAmpersend, // template_type_empty_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-3].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 628: // simple_or_template_type_reference -> simple_type_identifier + case 627: // simple_or_template_type_reference -> simple_type_identifier { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 629: // simple_or_template_type_reference -> simple_type_identifier, + case 628: // simple_or_template_type_reference -> simple_type_identifier, // template_type_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-2].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 630: // simple_or_template_type_reference -> simple_type_identifier, tkAmpersend, + case 629: // simple_or_template_type_reference -> simple_type_identifier, tkAmpersend, // template_type_params { CurrentSemanticValue.td = new template_type_reference((named_type_reference)ValueStack[ValueStack.Depth-3].td, (template_param_list)ValueStack[ValueStack.Depth-1].stn, CurrentLocationSpan); } break; - case 631: // simple_or_template_or_question_type_reference -> + case 630: // simple_or_template_or_question_type_reference -> // simple_or_template_type_reference { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 632: // simple_or_template_or_question_type_reference -> simple_type_question + case 631: // simple_or_template_or_question_type_reference -> simple_type_question { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 633: // optional_array_initializer -> tkRoundOpen, typed_const_list, tkRoundClose + case 632: // optional_array_initializer -> tkRoundOpen, typed_const_list, tkRoundClose { CurrentSemanticValue.stn = new array_const((expression_list)ValueStack[ValueStack.Depth-2].stn, CurrentLocationSpan); } break; - case 635: // new_expr -> tkNew, simple_or_template_type_reference, + case 634: // new_expr -> tkNew, simple_or_template_type_reference, // optional_expr_list_with_bracket { CurrentSemanticValue.ex = new new_expr(ValueStack[ValueStack.Depth-2].td, ValueStack[ValueStack.Depth-1].stn as expression_list, false, null, CurrentLocationSpan); } break; - case 636: // new_expr -> tkNew, simple_or_template_type_reference, tkSquareOpen, + case 635: // new_expr -> tkNew, simple_or_template_type_reference, tkSquareOpen, // optional_expr_list, tkSquareClose, optional_array_initializer { var el = ValueStack[ValueStack.Depth-3].stn as expression_list; @@ -6018,7 +6012,7 @@ public partial class GPPGParser: ShiftReduceParser tkNew, tkClass, tkRoundOpen, list_fields_in_unnamed_object, + case 636: // new_expr -> tkNew, tkClass, tkRoundOpen, list_fields_in_unnamed_object, // tkRoundClose { // sugared node @@ -6033,14 +6027,14 @@ public partial class GPPGParser: ShiftReduceParser identifier, tkAssign, expr_l1 + case 637: // 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 639: // field_in_unnamed_object -> expr_l1 + case 638: // field_in_unnamed_object -> expr_l1 { ident name = null; var id = ValueStack[ValueStack.Depth-1].ex as ident; @@ -6060,13 +6054,13 @@ public partial class GPPGParser: ShiftReduceParser field_in_unnamed_object + case 639: // list_fields_in_unnamed_object -> field_in_unnamed_object { var l = new name_assign_expr_list(); CurrentSemanticValue.ob = l.Add(ValueStack[ValueStack.Depth-1].ob as name_assign_expr); } break; - case 641: // list_fields_in_unnamed_object -> list_fields_in_unnamed_object, tkComma, + case 640: // list_fields_in_unnamed_object -> list_fields_in_unnamed_object, tkComma, // field_in_unnamed_object { var nel = ValueStack[ValueStack.Depth-3].ob as name_assign_expr_list; @@ -6077,17 +6071,17 @@ public partial class GPPGParser: ShiftReduceParser /* empty */ + case 641: // optional_expr_list_with_bracket -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 643: // optional_expr_list_with_bracket -> tkRoundOpen, optional_expr_list, + case 642: // optional_expr_list_with_bracket -> tkRoundOpen, optional_expr_list, // tkRoundClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 644: // relop_expr -> simple_expr + case 643: // relop_expr -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 645: // relop_expr -> relop_expr, relop, simple_expr + case 644: // relop_expr -> relop_expr, relop, simple_expr { if (ValueStack[ValueStack.Depth-2].op.type == Operators.NotIn) CurrentSemanticValue.ex = new un_expr(new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, Operators.In, CurrentLocationSpan),Operators.LogicalNOT,CurrentLocationSpan); @@ -6095,7 +6089,7 @@ public partial class GPPGParser: ShiftReduceParser relop_expr, relop, new_question_expr + case 645: // relop_expr -> relop_expr, relop, new_question_expr { if (ValueStack[ValueStack.Depth-2].op.type == Operators.NotIn) CurrentSemanticValue.ex = new un_expr(new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, Operators.In, CurrentLocationSpan),Operators.LogicalNOT,CurrentLocationSpan); @@ -6103,26 +6097,26 @@ public partial class GPPGParser: ShiftReduceParser is_type_expr, tkRoundOpen, pattern_out_param_list, tkRoundClose + case 646: // relop_expr -> is_type_expr, tkRoundOpen, pattern_out_param_list, tkRoundClose { var isTypeCheck = ValueStack[ValueStack.Depth-4].ex as typecast_node; var deconstructorPattern = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, isTypeCheck.type_def, null, CurrentLocationSpan); CurrentSemanticValue.ex = new is_pattern_expr(isTypeCheck.expr, deconstructorPattern, CurrentLocationSpan); } break; - case 648: // pattern -> simple_or_template_type_reference, tkRoundOpen, + case 647: // pattern -> simple_or_template_type_reference, tkRoundOpen, // pattern_out_param_list, tkRoundClose { CurrentSemanticValue.stn = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 649: // pattern_optional_var -> simple_or_template_type_reference, tkRoundOpen, + case 648: // pattern_optional_var -> simple_or_template_type_reference, tkRoundOpen, // pattern_out_param_list_optional_var, tkRoundClose { CurrentSemanticValue.stn = new deconstructor_pattern(ValueStack[ValueStack.Depth-2].ob as List, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 650: // deconstruction_or_const_pattern -> simple_or_template_type_reference, + case 649: // deconstruction_or_const_pattern -> simple_or_template_type_reference, // tkRoundOpen, // pattern_out_param_list_optional_var, // tkRoundClose @@ -6130,18 +6124,18 @@ public partial class GPPGParser: ShiftReduceParser, ValueStack[ValueStack.Depth-4].td, null, CurrentLocationSpan); } break; - case 651: // deconstruction_or_const_pattern -> const_pattern_expr_list + case 650: // deconstruction_or_const_pattern -> const_pattern_expr_list { CurrentSemanticValue.stn = new const_pattern(ValueStack[ValueStack.Depth-1].ob as List, CurrentLocationSpan); } break; - case 652: // const_pattern_expr_list -> const_pattern_expression + case 651: // const_pattern_expr_list -> const_pattern_expression { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn); } break; - case 653: // const_pattern_expr_list -> const_pattern_expr_list, tkComma, + case 652: // const_pattern_expr_list -> const_pattern_expr_list, tkComma, // const_pattern_expression { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -6149,36 +6143,36 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 653: // const_pattern_expression -> literal_or_number { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 655: // const_pattern_expression -> simple_or_template_type_reference + case 654: // const_pattern_expression -> simple_or_template_type_reference { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } break; - case 656: // const_pattern_expression -> tkNil + case 655: // const_pattern_expression -> tkNil { CurrentSemanticValue.stn = new nil_const(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 657: // const_pattern_expression -> sizeof_expr + case 656: // const_pattern_expression -> sizeof_expr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 658: // const_pattern_expression -> typeof_expr + case 657: // const_pattern_expression -> typeof_expr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].ex; } break; - case 659: // collection_pattern -> tkSquareOpen, collection_pattern_expr_list, tkSquareClose + case 658: // collection_pattern -> tkSquareOpen, collection_pattern_expr_list, tkSquareClose { CurrentSemanticValue.stn = new collection_pattern(ValueStack[ValueStack.Depth-2].ob as List, CurrentLocationSpan); } break; - case 660: // collection_pattern_expr_list -> collection_pattern_list_item + case 659: // collection_pattern_expr_list -> collection_pattern_list_item { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 661: // collection_pattern_expr_list -> collection_pattern_expr_list, tkComma, + case 660: // collection_pattern_expr_list -> collection_pattern_expr_list, tkComma, // collection_pattern_list_item { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -6186,108 +6180,108 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 661: // collection_pattern_list_item -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 663: // collection_pattern_list_item -> collection_pattern_var_item + case 662: // collection_pattern_list_item -> collection_pattern_var_item { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 664: // collection_pattern_list_item -> tkUnderscore + case 663: // collection_pattern_list_item -> tkUnderscore { CurrentSemanticValue.stn = new collection_pattern_wild_card(CurrentLocationSpan); } break; - case 665: // collection_pattern_list_item -> pattern_optional_var + case 664: // collection_pattern_list_item -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 666: // collection_pattern_list_item -> collection_pattern + case 665: // collection_pattern_list_item -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 667: // collection_pattern_list_item -> tuple_pattern + case 666: // collection_pattern_list_item -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 668: // collection_pattern_list_item -> tkDotDot + case 667: // collection_pattern_list_item -> tkDotDot { CurrentSemanticValue.stn = new collection_pattern_gap_parameter(CurrentLocationSpan); } break; - case 669: // collection_pattern_var_item -> tkVar, identifier + case 668: // collection_pattern_var_item -> tkVar, identifier { CurrentSemanticValue.stn = new collection_pattern_var_parameter(ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 670: // tuple_pattern -> tkRoundOpen, tuple_pattern_item_list, tkRoundClose + case 669: // tuple_pattern -> tkRoundOpen, tuple_pattern_item_list, tkRoundClose { if ((ValueStack[ValueStack.Depth-2].ob as List).Count>6) parserTools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",CurrentLocationSpan); CurrentSemanticValue.stn = new tuple_pattern(ValueStack[ValueStack.Depth-2].ob as List, CurrentLocationSpan); } break; - case 671: // tuple_pattern_item -> tkUnderscore + case 670: // tuple_pattern_item -> tkUnderscore { CurrentSemanticValue.stn = new tuple_pattern_wild_card(CurrentLocationSpan); } break; - case 672: // tuple_pattern_item -> literal_or_number + case 671: // tuple_pattern_item -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 673: // tuple_pattern_item -> sign, literal_or_number + case 672: // tuple_pattern_item -> sign, literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan), CurrentLocationSpan); } break; - case 674: // tuple_pattern_item -> tkVar, identifier + case 673: // tuple_pattern_item -> tkVar, identifier { CurrentSemanticValue.stn = new tuple_pattern_var_parameter(ValueStack[ValueStack.Depth-1].id, null, CurrentLocationSpan); } break; - case 675: // tuple_pattern_item -> pattern_optional_var + case 674: // tuple_pattern_item -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 676: // tuple_pattern_item -> collection_pattern + case 675: // tuple_pattern_item -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 677: // tuple_pattern_item -> tuple_pattern + case 676: // tuple_pattern_item -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 678: // tuple_pattern_item_list -> tuple_pattern_item + case 677: // tuple_pattern_item_list -> tuple_pattern_item { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 679: // tuple_pattern_item_list -> tuple_pattern_item_list, tkComma, tuple_pattern_item + case 678: // tuple_pattern_item_list -> tuple_pattern_item_list, tkComma, tuple_pattern_item { var list = ValueStack[ValueStack.Depth-3].ob as List; list.Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); CurrentSemanticValue.ob = list; } break; - case 680: // pattern_out_param_list_optional_var -> pattern_out_param_optional_var + case 679: // pattern_out_param_list_optional_var -> pattern_out_param_optional_var { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 681: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, + case 680: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, // tkSemiColon, // pattern_out_param_optional_var { @@ -6296,7 +6290,7 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param_list_optional_var, + case 681: // pattern_out_param_list_optional_var -> pattern_out_param_list_optional_var, // tkComma, // pattern_out_param_optional_var { @@ -6305,13 +6299,13 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param + case 682: // pattern_out_param_list -> pattern_out_param { CurrentSemanticValue.ob = new List(); (CurrentSemanticValue.ob as List).Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); } break; - case 684: // pattern_out_param_list -> pattern_out_param_list, tkSemiColon, + case 683: // pattern_out_param_list -> pattern_out_param_list, tkSemiColon, // pattern_out_param { var list = ValueStack[ValueStack.Depth-3].ob as List; @@ -6319,182 +6313,182 @@ public partial class GPPGParser: ShiftReduceParser pattern_out_param_list, tkComma, pattern_out_param + case 684: // pattern_out_param_list -> pattern_out_param_list, tkComma, pattern_out_param { var list = ValueStack[ValueStack.Depth-3].ob as List; list.Add(ValueStack[ValueStack.Depth-1].stn as pattern_parameter); CurrentSemanticValue.ob = list; } break; - case 686: // pattern_out_param -> tkUnderscore + case 685: // pattern_out_param -> tkUnderscore { CurrentSemanticValue.stn = new wild_card_deconstructor_parameter(CurrentLocationSpan); } break; - case 687: // pattern_out_param -> literal_or_number + case 686: // pattern_out_param -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 688: // pattern_out_param -> tkVar, identifier, tkColon, type_ref + case 687: // pattern_out_param -> tkVar, identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, true, CurrentLocationSpan); } break; - case 689: // pattern_out_param -> tkVar, identifier + case 688: // pattern_out_param -> tkVar, identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, true, CurrentLocationSpan); } break; - case 690: // pattern_out_param -> pattern + case 689: // pattern_out_param -> pattern { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 691: // pattern_out_param -> collection_pattern + case 690: // pattern_out_param -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 692: // pattern_out_param -> tuple_pattern + case 691: // pattern_out_param -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 693: // pattern_out_param_optional_var -> tkUnderscore + case 692: // pattern_out_param_optional_var -> tkUnderscore { CurrentSemanticValue.stn = new wild_card_deconstructor_parameter(CurrentLocationSpan); } break; - case 694: // pattern_out_param_optional_var -> literal_or_number + case 693: // pattern_out_param_optional_var -> literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 695: // pattern_out_param_optional_var -> sign, literal_or_number + case 694: // pattern_out_param_optional_var -> sign, literal_or_number { CurrentSemanticValue.stn = new const_pattern_parameter(new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan), CurrentLocationSpan); } break; - case 696: // pattern_out_param_optional_var -> identifier, tkColon, type_ref + case 695: // pattern_out_param_optional_var -> identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, false, CurrentLocationSpan); } break; - case 697: // pattern_out_param_optional_var -> identifier + case 696: // pattern_out_param_optional_var -> identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, false, CurrentLocationSpan); } break; - case 698: // pattern_out_param_optional_var -> tkVar, identifier, tkColon, type_ref + case 697: // pattern_out_param_optional_var -> tkVar, identifier, tkColon, type_ref { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].td, true, CurrentLocationSpan); } break; - case 699: // pattern_out_param_optional_var -> tkVar, identifier + case 698: // pattern_out_param_optional_var -> tkVar, identifier { CurrentSemanticValue.stn = new var_deconstructor_parameter(ValueStack[ValueStack.Depth-1].id, null, true, CurrentLocationSpan); } break; - case 700: // pattern_out_param_optional_var -> pattern_optional_var + case 699: // pattern_out_param_optional_var -> pattern_optional_var { CurrentSemanticValue.stn = new recursive_deconstructor_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 701: // pattern_out_param_optional_var -> collection_pattern + case 700: // pattern_out_param_optional_var -> collection_pattern { CurrentSemanticValue.stn = new recursive_collection_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 702: // pattern_out_param_optional_var -> tuple_pattern + case 701: // pattern_out_param_optional_var -> tuple_pattern { CurrentSemanticValue.stn = new recursive_tuple_parameter(ValueStack[ValueStack.Depth-1].stn as pattern_node, CurrentLocationSpan); } break; - case 703: // simple_expr_or_nothing -> simple_expr + case 702: // simple_expr_or_nothing -> simple_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 704: // simple_expr_or_nothing -> /* empty */ + case 703: // simple_expr_or_nothing -> /* empty */ { CurrentSemanticValue.ex = null; } break; - case 705: // const_expr_or_nothing -> const_expr + case 704: // const_expr_or_nothing -> const_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 706: // const_expr_or_nothing -> /* empty */ + case 705: // const_expr_or_nothing -> /* empty */ { CurrentSemanticValue.ex = null; } break; - case 707: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing + case 706: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 708: // format_expr -> tkColon, simple_expr_or_nothing + case 707: // format_expr -> tkColon, simple_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 709: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing, tkColon, + case 708: // format_expr -> simple_expr, tkColon, simple_expr_or_nothing, tkColon, // simple_expr { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 710: // format_expr -> tkColon, simple_expr_or_nothing, tkColon, simple_expr + case 709: // format_expr -> tkColon, simple_expr_or_nothing, tkColon, simple_expr { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 711: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing + case 710: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 712: // format_const_expr -> tkColon, const_expr_or_nothing + case 711: // format_const_expr -> tkColon, const_expr_or_nothing { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan); } break; - case 713: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing, tkColon, + case 712: // format_const_expr -> const_expr, tkColon, const_expr_or_nothing, tkColon, // const_expr { CurrentSemanticValue.ex = new format_expr(ValueStack[ValueStack.Depth-5].ex, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 714: // format_const_expr -> tkColon, const_expr_or_nothing, tkColon, const_expr + case 713: // format_const_expr -> tkColon, const_expr_or_nothing, tkColon, const_expr { CurrentSemanticValue.ex = new format_expr(null, ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 715: // relop -> tkEqual + case 714: // relop -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 716: // relop -> tkNotEqual + case 715: // relop -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 717: // relop -> tkLower + case 716: // relop -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 718: // relop -> tkGreater + case 717: // relop -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 719: // relop -> tkLowerEqual + case 718: // relop -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 720: // relop -> tkGreaterEqual + case 719: // relop -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 721: // relop -> tkIn + case 720: // relop -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 722: // relop -> tkNot, tkIn + case 721: // relop -> tkNot, tkIn { if (parserTools.buildTreeForFormatter) CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; @@ -6505,10 +6499,10 @@ public partial class GPPGParser: ShiftReduceParser term1 + case 722: // simple_expr -> term1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 724: // simple_expr -> simple_expr, tkDotDot, term1 + case 723: // simple_expr -> simple_expr, tkDotDot, term1 { if (parserTools.buildTreeForFormatter) CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan); @@ -6516,128 +6510,128 @@ public partial class GPPGParser: ShiftReduceParser term + case 724: // term1 -> term { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 726: // term1 -> term1, addop, term + case 725: // term1 -> term1, addop, term { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 727: // term1 -> term1, addop, new_question_expr + case 726: // term1 -> term1, addop, new_question_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 728: // addop -> tkPlus + case 727: // addop -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 729: // addop -> tkMinus + case 728: // addop -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 730: // addop -> tkOr + case 729: // addop -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 731: // addop -> tkXor + case 730: // addop -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 732: // addop -> tkCSharpStyleOr + case 731: // addop -> tkCSharpStyleOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 733: // typecast_op -> tkAs + case 732: // typecast_op -> tkAs { CurrentSemanticValue.ob = op_typecast.as_op; } break; - case 734: // typecast_op -> tkIs + case 733: // typecast_op -> tkIs { CurrentSemanticValue.ob = op_typecast.is_op; } break; - case 735: // as_is_expr -> is_type_expr + case 734: // as_is_expr -> is_type_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 736: // as_is_expr -> as_expr + case 735: // as_is_expr -> as_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 737: // as_expr -> term, tkAs, simple_or_template_type_reference + case 736: // as_expr -> term, tkAs, simple_or_template_type_reference { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.as_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 738: // as_expr -> term, tkAs, array_type + case 737: // as_expr -> term, tkAs, array_type { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.as_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 739: // is_type_expr -> term, tkIs, simple_or_template_type_reference + case 738: // is_type_expr -> term, tkIs, simple_or_template_type_reference { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.is_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 740: // is_type_expr -> term, tkIs, array_type + case 739: // is_type_expr -> term, tkIs, array_type { CurrentSemanticValue.ex = NewAsIsExpr(ValueStack[ValueStack.Depth-3].ex, op_typecast.is_op, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 741: // power_expr -> factor_without_unary_op, tkStarStar, factor + case 740: // power_expr -> factor_without_unary_op, tkStarStar, factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 742: // power_expr -> factor_without_unary_op, tkStarStar, power_expr + case 741: // power_expr -> factor_without_unary_op, tkStarStar, power_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 743: // power_expr -> sign, power_expr + case 742: // power_expr -> sign, power_expr { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 744: // term -> factor + case 743: // term -> factor { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 745: // term -> new_expr + case 744: // term -> new_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 746: // term -> power_expr + case 745: // term -> power_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 747: // term -> term, mulop, factor + case 746: // term -> term, mulop, factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 748: // term -> term, mulop, power_expr + case 747: // term -> term, mulop, power_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 749: // term -> term, mulop, new_question_expr + case 748: // term -> term, mulop, new_question_expr { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex,ValueStack[ValueStack.Depth-1].ex,(ValueStack[ValueStack.Depth-2].op).type, CurrentLocationSpan); } break; - case 750: // term -> as_is_expr + case 749: // term -> as_is_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 751: // mulop -> tkStar + case 750: // mulop -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 752: // mulop -> tkSlash + case 751: // mulop -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 753: // mulop -> tkDiv + case 752: // mulop -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 754: // mulop -> tkMod + case 753: // mulop -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 755: // mulop -> tkShl + case 754: // mulop -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 756: // mulop -> tkShr + case 755: // mulop -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 757: // mulop -> tkAnd + case 756: // mulop -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 758: // default_expr -> tkDefault, tkRoundOpen, + case 757: // default_expr -> tkDefault, tkRoundOpen, // simple_or_template_or_question_type_reference, tkRoundClose { CurrentSemanticValue.ex = new default_operator(ValueStack[ValueStack.Depth-2].td as named_type_reference, CurrentLocationSpan); } break; - case 759: // tuple -> tkRoundOpen, expr_l1_or_unpacked, tkComma, expr_l1_or_unpacked_list, + case 758: // tuple -> tkRoundOpen, expr_l1_or_unpacked, tkComma, expr_l1_or_unpacked_list, // lambda_type_ref, optional_full_lambda_fp_list, tkRoundClose { if (ValueStack[ValueStack.Depth-6].ex is unpacked_list_of_ident_or_list) @@ -6656,35 +6650,35 @@ public partial class GPPGParser: ShiftReduceParser literal_or_number + case 759: // factor_without_unary_op -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 761: // factor_without_unary_op -> var_reference + case 760: // factor_without_unary_op -> var_reference { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 762: // factor -> tkNil + case 761: // factor -> tkNil { CurrentSemanticValue.ex = new nil_const(); CurrentSemanticValue.ex.source_context = CurrentLocationSpan; } break; - case 763: // factor -> literal_or_number + case 762: // factor -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 764: // factor -> default_expr + case 763: // factor -> default_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 765: // factor -> tkSquareOpen, elem_list, tkSquareClose + case 764: // factor -> tkSquareOpen, elem_list, tkSquareClose { CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 766: // factor -> tkNot, factor + case 765: // factor -> tkNot, factor { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 767: // factor -> sign, factor + case 766: // factor -> sign, factor { if (ValueStack[ValueStack.Depth-2].op.type == Operators.Minus) { @@ -6710,109 +6704,109 @@ public partial class GPPGParser: ShiftReduceParser tkDeref, factor + case 767: // factor -> tkDeref, factor { CurrentSemanticValue.ex = new index(ValueStack[ValueStack.Depth-1].ex, true, CurrentLocationSpan); } break; - case 769: // factor -> var_reference + case 768: // factor -> var_reference { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 770: // factor -> tuple + case 769: // factor -> tuple { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 771: // literal_or_number -> literal + case 770: // literal_or_number -> literal { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 772: // literal_or_number -> unsigned_number + case 771: // literal_or_number -> unsigned_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 773: // var_question_point -> variable, tkQuestionPoint, variable + case 772: // var_question_point -> variable, tkQuestionPoint, variable { CurrentSemanticValue.ex = new dot_question_node(ValueStack[ValueStack.Depth-3].ex as addressed_value,ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 774: // var_question_point -> variable, tkQuestionPoint, var_question_point + case 773: // var_question_point -> variable, tkQuestionPoint, var_question_point { CurrentSemanticValue.ex = new dot_question_node(ValueStack[ValueStack.Depth-3].ex as addressed_value,ValueStack[ValueStack.Depth-1].ex as addressed_value,CurrentLocationSpan); } break; - case 775: // var_reference -> var_address, variable + case 774: // var_reference -> var_address, variable { CurrentSemanticValue.ex = NewVarReference(ValueStack[ValueStack.Depth-2].stn as get_address, ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); } break; - case 776: // var_reference -> variable + case 775: // var_reference -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 777: // var_reference -> var_question_point + case 776: // var_reference -> var_question_point { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 778: // var_reference -> tkRoundOpen, tkVar, identifier, tkAssign, expr_dq, + case 777: // var_reference -> tkRoundOpen, tkVar, identifier, tkAssign, expr_dq, // tkRoundClose { CurrentSemanticValue.ex = new let_var_expr(ValueStack[ValueStack.Depth-4].id,ValueStack[ValueStack.Depth-2].ex,CurrentLocationSpan); } break; - case 779: // var_address -> tkAddressOf + case 778: // var_address -> tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(CurrentLocationSpan); } break; - case 780: // var_address -> var_address, tkAddressOf + case 779: // var_address -> var_address, tkAddressOf { CurrentSemanticValue.stn = NewVarAddress(ValueStack[ValueStack.Depth-2].stn as get_address, CurrentLocationSpan); } break; - case 781: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket + case 780: // attribute_variable -> simple_type_identifier, optional_expr_list_with_bracket { CurrentSemanticValue.stn = new attribute(null, ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as expression_list, CurrentLocationSpan); } break; - case 782: // attribute_variable -> template_type, optional_expr_list_with_bracket + case 781: // attribute_variable -> template_type, optional_expr_list_with_bracket { CurrentSemanticValue.stn = new attribute(null, ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as expression_list, CurrentLocationSpan); } break; - case 783: // dotted_identifier -> identifier + case 782: // dotted_identifier -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 784: // dotted_identifier -> dotted_identifier, tkPoint, identifier_or_keyword + case 783: // dotted_identifier -> dotted_identifier, tkPoint, identifier_or_keyword { if (ValueStack[ValueStack.Depth-3].ex is index) parserTools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-3], "^"); CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 785: // variable_as_type -> dotted_identifier + case 784: // variable_as_type -> dotted_identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex;} break; - case 786: // variable_as_type -> dotted_identifier, template_type_params + case 785: // variable_as_type -> dotted_identifier, template_type_params { CurrentSemanticValue.ex = new ident_with_templateparams(ValueStack[ValueStack.Depth-2].ex as addressed_value, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 787: // variable_or_literal_or_number -> variable + case 786: // variable_or_literal_or_number -> variable { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 788: // variable_or_literal_or_number -> literal_or_number + case 787: // variable_or_literal_or_number -> literal_or_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 789: // var_with_init_for_expr_with_let -> tkVar, identifier, tkAssign, expr, + case 788: // var_with_init_for_expr_with_let -> tkVar, identifier, tkAssign, expr, // tkSemiColon { CurrentSemanticValue.stn = new assign(ValueStack[ValueStack.Depth-4].id as addressed_value, ValueStack[ValueStack.Depth-2].ex, Operators.Assignment, CurrentLocationSpan); } break; - case 790: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let + case 789: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 791: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let_list, + case 790: // var_with_init_for_expr_with_let_list -> var_with_init_for_expr_with_let_list, // var_with_init_for_expr_with_let { ValueStack[ValueStack.Depth-2].stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 792: // proc_func_call -> variable, tkRoundOpen, optional_expr_list_func_param, + case 791: // proc_func_call -> variable, tkRoundOpen, optional_expr_list_func_param, // tkRoundClose { if (ValueStack[ValueStack.Depth-4].ex is index) @@ -6820,18 +6814,18 @@ public partial class GPPGParser: ShiftReduceParser identifier + case 792: // variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 794: // variable -> operator_name_ident + case 793: // variable -> operator_name_ident { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 795: // variable -> tkInherited, identifier + case 794: // variable -> tkInherited, identifier { CurrentSemanticValue.ex = new inherited_ident(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 796: // variable -> tkRoundOpen, expr, tkRoundClose + case 795: // variable -> tkRoundOpen, expr, tkRoundClose { if (!parserTools.buildTreeForFormatter) { @@ -6841,7 +6835,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, var_with_init_for_expr_with_let_list, expr, + case 796: // variable -> tkRoundOpen, var_with_init_for_expr_with_let_list, expr, // tkRoundClose { if (!parserTools.buildTreeForFormatter) @@ -6852,20 +6846,20 @@ public partial class GPPGParser: ShiftReduceParser sizeof_expr + case 797: // variable -> sizeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 799: // variable -> typeof_expr + case 798: // variable -> typeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 800: // variable -> literal_or_number, tkPoint, identifier_or_keyword + case 799: // variable -> literal_or_number, tkPoint, identifier_or_keyword { if (ValueStack[ValueStack.Depth-3].ex is index) parserTools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-3], "^"); CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 801: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, + case 800: // variable -> variable_or_literal_or_number, tkSquareOpen, expr_list, // tkSquareClose { var el = ValueStack[ValueStack.Depth-2].stn as expression_list; // SSM 10/03/16 @@ -6911,7 +6905,7 @@ public partial class GPPGParser: ShiftReduceParser variable_or_literal_or_number, tkQuestionSquareOpen, format_expr, + case 801: // variable -> variable_or_literal_or_number, tkQuestionSquareOpen, format_expr, // tkSquareClose { var fe = ValueStack[ValueStack.Depth-2].ex as format_expr; // SSM 9/01/17 @@ -6925,82 +6919,82 @@ public partial class GPPGParser: ShiftReduceParser tkVertParen, elem_list, tkVertParen + case 802: // variable -> tkVertParen, elem_list, tkVertParen { CurrentSemanticValue.ex = new array_const_new(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 804: // variable -> proc_func_call + case 803: // variable -> proc_func_call { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 805: // variable -> variable, tkPoint, identifier_keyword_operatorname + case 804: // variable -> variable, tkPoint, identifier_keyword_operatorname { if (ValueStack[ValueStack.Depth-3].ex is index) parserTools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-3], "^"); CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 806: // variable -> tuple, tkPoint, identifier_keyword_operatorname + case 805: // variable -> tuple, tkPoint, identifier_keyword_operatorname { CurrentSemanticValue.ex = new dot_node(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 807: // variable -> variable, tkDeref + case 806: // variable -> variable, tkDeref { CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-2].ex as addressed_value,CurrentLocationSpan); } break; - case 808: // variable -> variable, tkAmpersend, template_type_params + case 807: // variable -> variable, tkAmpersend, template_type_params { CurrentSemanticValue.ex = new ident_with_templateparams(ValueStack[ValueStack.Depth-3].ex as addressed_value, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 809: // optional_expr_list -> expr_list + case 808: // optional_expr_list -> expr_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 810: // optional_expr_list -> /* empty */ + case 809: // optional_expr_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 811: // optional_expr_list_func_param -> expr_list_func_param + case 810: // optional_expr_list_func_param -> expr_list_func_param { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 812: // optional_expr_list_func_param -> /* empty */ + case 811: // optional_expr_list_func_param -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 813: // elem_list -> elem_list1 + case 812: // elem_list -> elem_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 814: // elem_list -> /* empty */ + case 813: // elem_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 815: // elem_list1 -> elem + case 814: // elem_list1 -> elem { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 816: // elem_list1 -> elem_list1, tkComma, elem + case 815: // elem_list1 -> elem_list1, tkComma, elem { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 817: // elem -> expr + case 816: // elem -> expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 818: // elem -> expr, tkDotDot, expr + case 817: // elem -> expr, tkDotDot, expr { CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 819: // one_literal -> tkStringLiteral + case 818: // one_literal -> tkStringLiteral { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 820: // one_literal -> tkAsciiChar + case 819: // one_literal -> tkAsciiChar { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].stn as literal; } break; - case 821: // literal -> literal_list + case 820: // literal -> literal_list { CurrentSemanticValue.ex = NewLiteral(ValueStack[ValueStack.Depth-1].stn as literal_const_line); } break; - case 822: // literal -> tkFormatStringLiteral + case 821: // literal -> tkFormatStringLiteral { if (parserTools.buildTreeForFormatter) { @@ -7012,7 +7006,7 @@ public partial class GPPGParser: ShiftReduceParser tkMultilineStringLiteral + case 822: // literal -> tkMultilineStringLiteral { if (parserTools.buildTreeForFormatter) { @@ -7026,12 +7020,12 @@ public partial class GPPGParser: ShiftReduceParser one_literal + case 823: // literal_list -> one_literal { CurrentSemanticValue.stn = new literal_const_line(ValueStack[ValueStack.Depth-1].ex as literal, CurrentLocationSpan); } break; - case 825: // literal_list -> literal_list, one_literal + case 824: // literal_list -> literal_list, one_literal { var line = ValueStack[ValueStack.Depth-2].stn as literal_const_line; if (line.literals.Last() is string_const && ValueStack[ValueStack.Depth-1].ex is string_const) @@ -7039,481 +7033,481 @@ public partial class GPPGParser: ShiftReduceParser tkOperator, overload_operator + case 825: // operator_name_ident -> tkOperator, overload_operator { CurrentSemanticValue.ex = new operator_name_ident((ValueStack[ValueStack.Depth-1].op as op_type_node).text, (ValueStack[ValueStack.Depth-1].op as op_type_node).type, CurrentLocationSpan); } break; - case 827: // optional_method_modificators -> tkSemiColon + case 826: // optional_method_modificators -> tkSemiColon { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 828: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon + case 827: // optional_method_modificators -> tkSemiColon, meth_modificators, tkSemiColon { //parserTools.AddModifier((procedure_attributes_list)$2, proc_attribute.attr_overload); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 829: // optional_method_modificators1 -> /* empty */ + case 828: // optional_method_modificators1 -> /* empty */ { CurrentSemanticValue.stn = new procedure_attributes_list(new List(),CurrentLocationSpan); } break; - case 830: // optional_method_modificators1 -> tkSemiColon, meth_modificators + case 829: // optional_method_modificators1 -> tkSemiColon, meth_modificators { //parserTools.AddModifier((procedure_attributes_list)$2, proc_attribute.attr_overload); CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 831: // meth_modificators -> meth_modificator + case 830: // meth_modificators -> meth_modificator { CurrentSemanticValue.stn = new procedure_attributes_list(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 832: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator + case 831: // meth_modificators -> meth_modificators, tkSemiColon, meth_modificator { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as procedure_attributes_list).Add(ValueStack[ValueStack.Depth-1].id as procedure_attribute, CurrentLocationSpan); } break; - case 833: // identifier -> tkIdentifier + case 832: // identifier -> tkIdentifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 834: // identifier -> property_specifier_directives + case 833: // identifier -> property_specifier_directives { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 835: // identifier -> non_reserved + case 834: // identifier -> non_reserved { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 836: // identifier -> tkStep + case 835: // identifier -> tkStep { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 837: // identifier -> tkIndex + case 836: // identifier -> tkIndex { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 838: // identifier_or_keyword -> identifier + case 837: // identifier_or_keyword -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 839: // identifier_or_keyword -> keyword + case 838: // identifier_or_keyword -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 840: // identifier_or_keyword -> reserved_keyword + case 839: // identifier_or_keyword -> reserved_keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 841: // identifier_keyword_operatorname -> identifier + case 840: // identifier_keyword_operatorname -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 842: // identifier_keyword_operatorname -> keyword + case 841: // identifier_keyword_operatorname -> keyword { CurrentSemanticValue.id = new ident(ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 843: // identifier_keyword_operatorname -> operator_name_ident + case 842: // identifier_keyword_operatorname -> operator_name_ident { CurrentSemanticValue.id = (ident)ValueStack[ValueStack.Depth-1].ex; } break; - case 844: // meth_modificator -> tkAbstract + case 843: // meth_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 845: // meth_modificator -> tkOverload + case 844: // meth_modificator -> tkOverload { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; parserTools.AddWarningFromResource("OVERLOAD_IS_NOT_USED", ValueStack[ValueStack.Depth-1].id.source_context); } break; - case 846: // meth_modificator -> tkReintroduce + case 845: // meth_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 847: // meth_modificator -> tkOverride + case 846: // meth_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 848: // meth_modificator -> tkExtensionMethod + case 847: // meth_modificator -> tkExtensionMethod { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 849: // meth_modificator -> tkVirtual + case 848: // meth_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 850: // property_modificator -> tkVirtual + case 849: // property_modificator -> tkVirtual { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 851: // property_modificator -> tkOverride + case 850: // property_modificator -> tkOverride { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 852: // property_modificator -> tkAbstract + case 851: // property_modificator -> tkAbstract { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 853: // property_modificator -> tkReintroduce + case 852: // property_modificator -> tkReintroduce { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 854: // property_specifier_directives -> tkRead + case 853: // property_specifier_directives -> tkRead { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 855: // property_specifier_directives -> tkWrite + case 854: // property_specifier_directives -> tkWrite { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 856: // non_reserved -> tkName + case 855: // non_reserved -> tkName { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 857: // non_reserved -> tkNew + case 856: // non_reserved -> tkNew { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 858: // visibility_specifier -> tkInternal + case 857: // visibility_specifier -> tkInternal { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 859: // visibility_specifier -> tkPublic + case 858: // visibility_specifier -> tkPublic { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 860: // visibility_specifier -> tkProtected + case 859: // visibility_specifier -> tkProtected { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 861: // visibility_specifier -> tkPrivate + case 860: // visibility_specifier -> tkPrivate { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 862: // keyword -> visibility_specifier + case 861: // keyword -> visibility_specifier { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 863: // keyword -> tkSealed + case 862: // keyword -> tkSealed { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 864: // keyword -> tkTemplate + case 863: // keyword -> tkTemplate { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 865: // keyword -> tkOr + case 864: // keyword -> tkOr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 866: // keyword -> tkTypeOf + case 865: // keyword -> tkTypeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 867: // keyword -> tkSizeOf + case 866: // keyword -> tkSizeOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 868: // keyword -> tkDefault + case 867: // keyword -> tkDefault { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 869: // keyword -> tkWhere + case 868: // keyword -> tkWhere { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 870: // keyword -> tkXor + case 869: // keyword -> tkXor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 871: // keyword -> tkAnd + case 870: // keyword -> tkAnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 872: // keyword -> tkDiv + case 871: // keyword -> tkDiv { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 873: // keyword -> tkMod + case 872: // keyword -> tkMod { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 874: // keyword -> tkShl + case 873: // keyword -> tkShl { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 875: // keyword -> tkShr + case 874: // keyword -> tkShr { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 876: // keyword -> tkNot + case 875: // keyword -> tkNot { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 877: // keyword -> tkAs + case 876: // keyword -> tkAs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 878: // keyword -> tkIn + case 877: // keyword -> tkIn { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 879: // keyword -> tkIs + case 878: // keyword -> tkIs { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 880: // keyword -> tkArray + case 879: // keyword -> tkArray { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 881: // keyword -> tkSequence + case 880: // keyword -> tkSequence { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 882: // keyword -> tkBegin + case 881: // keyword -> tkBegin { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 883: // keyword -> tkCase + case 882: // keyword -> tkCase { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 884: // keyword -> tkClass + case 883: // keyword -> tkClass { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 885: // keyword -> tkConst + case 884: // keyword -> tkConst { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 886: // keyword -> tkConstructor + case 885: // keyword -> tkConstructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 887: // keyword -> tkDestructor + case 886: // keyword -> tkDestructor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 888: // keyword -> tkDownto + case 887: // keyword -> tkDownto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 889: // keyword -> tkDo + case 888: // keyword -> tkDo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 890: // keyword -> tkElse + case 889: // keyword -> tkElse { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 891: // keyword -> tkEnd + case 890: // keyword -> tkEnd { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 892: // keyword -> tkExcept + case 891: // keyword -> tkExcept { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 893: // keyword -> tkFile + case 892: // keyword -> tkFile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 894: // keyword -> tkAuto + case 893: // keyword -> tkAuto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 895: // keyword -> tkFinalization + case 894: // keyword -> tkFinalization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 896: // keyword -> tkFinally + case 895: // keyword -> tkFinally { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 897: // keyword -> tkFor + case 896: // keyword -> tkFor { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 898: // keyword -> tkForeach + case 897: // keyword -> tkForeach { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 899: // keyword -> tkFunction + case 898: // keyword -> tkFunction { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 900: // keyword -> tkIf + case 899: // keyword -> tkIf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 901: // keyword -> tkImplementation + case 900: // keyword -> tkImplementation { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 902: // keyword -> tkInherited + case 901: // keyword -> tkInherited { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 903: // keyword -> tkInitialization + case 902: // keyword -> tkInitialization { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 904: // keyword -> tkInterface + case 903: // keyword -> tkInterface { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 905: // keyword -> tkProcedure + case 904: // keyword -> tkProcedure { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 906: // keyword -> tkProperty + case 905: // keyword -> tkProperty { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 907: // keyword -> tkRaise + case 906: // keyword -> tkRaise { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 908: // keyword -> tkRecord + case 907: // keyword -> tkRecord { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 909: // keyword -> tkRepeat + case 908: // keyword -> tkRepeat { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 910: // keyword -> tkSet + case 909: // keyword -> tkSet { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 911: // keyword -> tkTry + case 910: // keyword -> tkTry { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 912: // keyword -> tkType + case 911: // keyword -> tkType { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 913: // keyword -> tkStatic + case 912: // keyword -> tkStatic { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 914: // keyword -> tkThen + case 913: // keyword -> tkThen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 915: // keyword -> tkTo + case 914: // keyword -> tkTo { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 916: // keyword -> tkUntil + case 915: // keyword -> tkUntil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 917: // keyword -> tkUses + case 916: // keyword -> tkUses { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 918: // keyword -> tkVar + case 917: // keyword -> tkVar { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 919: // keyword -> tkWhile + case 918: // keyword -> tkWhile { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 920: // keyword -> tkWith + case 919: // keyword -> tkWith { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 921: // keyword -> tkNil + case 920: // keyword -> tkNil { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 922: // keyword -> tkGoto + case 921: // keyword -> tkGoto { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 923: // keyword -> tkOf + case 922: // keyword -> tkOf { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 924: // keyword -> tkLabel + case 923: // keyword -> tkLabel { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 925: // keyword -> tkProgram + case 924: // keyword -> tkProgram { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 926: // keyword -> tkUnit + case 925: // keyword -> tkUnit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 927: // keyword -> tkLibrary + case 926: // keyword -> tkLibrary { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 928: // keyword -> tkNamespace + case 927: // keyword -> tkNamespace { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 929: // keyword -> tkExternal + case 928: // keyword -> tkExternal { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 930: // keyword -> tkParams + case 929: // keyword -> tkParams { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 931: // keyword -> tkEvent + case 930: // keyword -> tkEvent { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 932: // keyword -> tkYield + case 931: // keyword -> tkYield { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 933: // keyword -> tkMatch + case 932: // keyword -> tkMatch { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 934: // keyword -> tkWhen + case 933: // keyword -> tkWhen { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 935: // keyword -> tkPartial + case 934: // keyword -> tkPartial { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 936: // keyword -> tkAbstract + case 935: // keyword -> tkAbstract { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 937: // keyword -> tkLock + case 936: // keyword -> tkLock { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 938: // keyword -> tkImplicit + case 937: // keyword -> tkImplicit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 939: // keyword -> tkExplicit + case 938: // keyword -> tkExplicit { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].op; } break; - case 940: // keyword -> tkOn + case 939: // keyword -> tkOn { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 941: // keyword -> tkVirtual + case 940: // keyword -> tkVirtual { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 942: // keyword -> tkOverride + case 941: // keyword -> tkOverride { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 943: // keyword -> tkLoop + case 942: // keyword -> tkLoop { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 944: // keyword -> tkExtensionMethod + case 943: // keyword -> tkExtensionMethod { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 945: // keyword -> tkOverload + case 944: // keyword -> tkOverload { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 946: // keyword -> tkReintroduce + case 945: // keyword -> tkReintroduce { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 947: // keyword -> tkForward + case 946: // keyword -> tkForward { CurrentSemanticValue.ti = new token_info(ValueStack[ValueStack.Depth-1].id.name, CurrentLocationSpan); } break; - case 948: // reserved_keyword -> tkOperator + case 947: // reserved_keyword -> tkOperator { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 949: // overload_operator -> tkMinus + case 948: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 950: // overload_operator -> tkPlus + case 949: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 951: // overload_operator -> tkSlash + case 950: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 952: // overload_operator -> tkStar + case 951: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 953: // overload_operator -> tkEqual + case 952: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 954: // overload_operator -> tkGreater + case 953: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 955: // overload_operator -> tkGreaterEqual + case 954: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 956: // overload_operator -> tkLower + case 955: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 957: // overload_operator -> tkLowerEqual + case 956: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 958: // overload_operator -> tkNotEqual + case 957: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 959: // overload_operator -> tkOr + case 958: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 960: // overload_operator -> tkXor + case 959: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 961: // overload_operator -> tkAnd + case 960: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 962: // overload_operator -> tkDiv + case 961: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 963: // overload_operator -> tkMod + case 962: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 964: // overload_operator -> tkShl + case 963: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 965: // overload_operator -> tkShr + case 964: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 966: // overload_operator -> tkNot + case 965: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 967: // overload_operator -> tkIn + case 966: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 968: // overload_operator -> tkImplicit + case 967: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 969: // overload_operator -> tkExplicit + case 968: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 970: // overload_operator -> assign_operator + case 969: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 971: // overload_operator -> tkStarStar + case 970: // overload_operator -> tkStarStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 972: // assign_operator -> tkAssign + case 971: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 973: // assign_operator -> tkPlusEqual + case 972: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 974: // assign_operator -> tkMinusEqual + case 973: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 975: // assign_operator -> tkMultEqual + case 974: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 976: // assign_operator -> tkDivEqual + case 975: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 977: // lambda_unpacked_params -> tkBackSlashRoundOpen, + case 976: // lambda_unpacked_params -> tkBackSlashRoundOpen, // lambda_list_of_unpacked_params_or_id, tkComma, // lambda_unpacked_params_or_id, tkRoundClose { @@ -7522,24 +7516,24 @@ public partial class GPPGParser: ShiftReduceParser lambda_unpacked_params + case 977: // lambda_unpacked_params_or_id -> lambda_unpacked_params { CurrentSemanticValue.ob = new ident_or_list(ValueStack[ValueStack.Depth-1].ex as unpacked_list_of_ident_or_list); } break; - case 979: // lambda_unpacked_params_or_id -> identifier + case 978: // lambda_unpacked_params_or_id -> identifier { CurrentSemanticValue.ob = new ident_or_list(ValueStack[ValueStack.Depth-1].id as ident); } break; - case 980: // lambda_list_of_unpacked_params_or_id -> lambda_unpacked_params_or_id + case 979: // lambda_list_of_unpacked_params_or_id -> lambda_unpacked_params_or_id { CurrentSemanticValue.ob = new unpacked_list_of_ident_or_list(); (CurrentSemanticValue.ob as unpacked_list_of_ident_or_list).Add(ValueStack[ValueStack.Depth-1].ob as ident_or_list); (CurrentSemanticValue.ob as unpacked_list_of_ident_or_list).source_context = LocationStack[LocationStack.Depth-1]; } break; - case 981: // lambda_list_of_unpacked_params_or_id -> lambda_list_of_unpacked_params_or_id, + case 980: // lambda_list_of_unpacked_params_or_id -> lambda_list_of_unpacked_params_or_id, // tkComma, lambda_unpacked_params_or_id { CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-3].ob; @@ -7547,24 +7541,24 @@ public partial class GPPGParser: ShiftReduceParser expr_l1 + case 981: // expr_l1_or_unpacked -> expr_l1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 983: // expr_l1_or_unpacked -> lambda_unpacked_params + case 982: // expr_l1_or_unpacked -> lambda_unpacked_params { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 984: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked + case 983: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 985: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked_list, tkComma, + case 984: // expr_l1_or_unpacked_list -> expr_l1_or_unpacked_list, tkComma, // expr_l1_or_unpacked { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 986: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 985: // func_decl_lambda -> identifier, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]); var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new lambda_any_type_node_syntax(), LocationStack[LocationStack.Depth-3]), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]); @@ -7575,7 +7569,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 986: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, // tkArrow, lambda_function_body { // �?дес�? надо анализи�?ова�?�? по �?ел�? и либо ос�?авля�?�? lambda_inferred_type, либо дела�?�? его null! @@ -7585,7 +7579,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 987: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-7].id, LocationStack[LocationStack.Depth-7]); @@ -7597,7 +7591,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 988: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -7611,7 +7605,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 989: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -7626,7 +7620,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1_or_unpacked, tkComma, + case 990: // func_decl_lambda -> tkRoundOpen, expr_l1_or_unpacked, tkComma, // expr_l1_or_unpacked_list, lambda_type_ref, // optional_full_lambda_fp_list, tkRoundClose, rem_lambda { @@ -7736,7 +7730,7 @@ public partial class GPPGParser: ShiftReduceParser lambda_unpacked_params, rem_lambda + case 991: // func_decl_lambda -> lambda_unpacked_params, rem_lambda { var pair = ValueStack[ValueStack.Depth-1].ob as pair_type_stlist; // пока �?о�?мал�?н�?е па�?аме�?�?�? - null. Раск�?оем и�? са�?а�?н�?м визи�?о�?ом @@ -7748,62 +7742,62 @@ public partial class GPPGParser: ShiftReduceParser expl_func_decl_lambda + case 992: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 994: // optional_full_lambda_fp_list -> /* empty */ + case 993: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 995: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 994: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 996: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 995: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body { CurrentSemanticValue.ob = new pair_type_stlist(ValueStack[ValueStack.Depth-3].td,ValueStack[ValueStack.Depth-1].stn as statement_list); } break; - case 997: // expl_func_decl_lambda -> tkFunction, lambda_type_ref_noproctype, tkArrow, + case 996: // expl_func_decl_lambda -> tkFunction, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 998: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, + case 997: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 999: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 998: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, 1, CurrentLocationSpan); } break; - case 1000: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 999: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 1001: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 1000: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, // lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 1002: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 1001: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, tkArrow, lambda_procedure_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), ValueStack[ValueStack.Depth-4].stn as formal_parameters, null, ValueStack[ValueStack.Depth-1].stn as statement_list, 2, CurrentLocationSpan); } break; - case 1003: // full_lambda_fp_list -> lambda_simple_fp_sect + case 1002: // full_lambda_fp_list -> lambda_simple_fp_sect { var typed_pars = ValueStack[ValueStack.Depth-1].stn as typed_parameters; if (typed_pars.vars_type is lambda_inferred_type) @@ -7823,102 +7817,102 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 1003: // full_lambda_fp_list -> full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect { CurrentSemanticValue.stn =(ValueStack[ValueStack.Depth-3].stn as formal_parameters).Add(ValueStack[ValueStack.Depth-1].stn as typed_parameters, CurrentLocationSpan); } break; - case 1005: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 1004: // lambda_simple_fp_sect -> ident_list, lambda_type_ref { CurrentSemanticValue.stn = new typed_parameters(ValueStack[ValueStack.Depth-2].stn as ident_list, ValueStack[ValueStack.Depth-1].td, parametr_kind.none, null, CurrentLocationSpan); } break; - case 1006: // lambda_type_ref -> /* empty */ + case 1005: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new lambda_any_type_node_syntax(), null); } break; - case 1007: // lambda_type_ref -> tkColon, fptype + case 1006: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 1008: // lambda_type_ref_noproctype -> /* empty */ + case 1007: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new lambda_any_type_node_syntax(), null); } break; - case 1009: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 1008: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 1010: // common_lambda_body -> compound_stmt + case 1009: // common_lambda_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 1011: // common_lambda_body -> if_stmt + case 1010: // common_lambda_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1012: // common_lambda_body -> while_stmt + case 1011: // common_lambda_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1013: // common_lambda_body -> repeat_stmt + case 1012: // common_lambda_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1014: // common_lambda_body -> for_stmt + case 1013: // common_lambda_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1015: // common_lambda_body -> foreach_stmt + case 1014: // common_lambda_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1016: // common_lambda_body -> loop_stmt + case 1015: // common_lambda_body -> loop_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1017: // common_lambda_body -> case_stmt + case 1016: // common_lambda_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1018: // common_lambda_body -> try_stmt + case 1017: // common_lambda_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1019: // common_lambda_body -> lock_stmt + case 1018: // common_lambda_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1020: // common_lambda_body -> raise_stmt + case 1019: // common_lambda_body -> raise_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1021: // common_lambda_body -> yield_stmt + case 1020: // common_lambda_body -> yield_stmt { parserTools.AddErrorFromResource("YIELD_STATEMENT_CANNOT_BE_USED_IN_LAMBDA_BODY", CurrentLocationSpan); } break; - case 1022: // common_lambda_body -> tkRoundOpen, assignment, tkRoundClose + case 1021: // common_lambda_body -> tkRoundOpen, assignment, tkRoundClose { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-2].stn as statement, LocationStack[LocationStack.Depth-2]); } break; - case 1023: // lambda_function_body -> expr_l1_for_lambda + case 1022: // lambda_function_body -> expr_l1_for_lambda { var id = SyntaxVisitors.HasNameVisitor.HasName(ValueStack[ValueStack.Depth-1].ex, "Result"); if (id != null) @@ -7930,22 +7924,22 @@ public partial class GPPGParser: ShiftReduceParser common_lambda_body + case 1023: // lambda_function_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 1025: // lambda_procedure_body -> proc_call + case 1024: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1026: // lambda_procedure_body -> assignment + case 1025: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 1027: // lambda_procedure_body -> common_lambda_body + case 1026: // lambda_procedure_body -> common_lambda_body { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } diff --git a/Languages/Pascal/PascalABCParserNewSaushkin/PABC.ymc b/Languages/Pascal/PascalABCParserNewSaushkin/PABC.ymc index b5d315699..6962664dc 100644 --- a/Languages/Pascal/PascalABCParserNewSaushkin/PABC.ymc +++ b/Languages/Pascal/PascalABCParserNewSaushkin/PABC.ymc @@ -377,6 +377,9 @@ script= + + + diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 13b78889db13e579af4d88eeb3c0fbf10de205f5..f65cae7905c3a80c1de480ae1affb7e3b271977f 100644 GIT binary patch delta 218 zcmaDgn{DS@wh0dyuWo!;>}Qvno>^RyTI86Q;+&sXQk0()kW-qTnWvYMSi;Mt8W7~_ z<{6=C%gd#&9|TpZkeHXE098CWkWr#O$kp95IK(w5-qFt`-r3(TB*@<q!lU2s-@ShO j^sNFfmz#f(FQy5+Twn*4=9OgTrZz|UZ;$e4oL~n4!`)#) delta 23 fcmdlvm+jSTwh0dy*)~2b_G?xS*sdJFIL!_Kf9VOQ diff --git a/NETGenerator/NETGenerator.cs b/NETGenerator/NETGenerator.cs index 3de9348f9..2cac39046 100644 --- a/NETGenerator/NETGenerator.cs +++ b/NETGenerator/NETGenerator.cs @@ -4707,9 +4707,12 @@ namespace PascalABCCompiler.NETGenerator { ICommonTypeNode ctn = init_value.type as ICommonTypeNode; IExpressionNode[] FieldValues = init_value.FieldValues; - ICommonClassFieldNode[] Fields = ctn.fields; + List Fields = new List(); + foreach (var field in ctn.fields) + if (field.polymorphic_state != polymorphic_state.ps_static) + Fields.Add(field); - for (int i = 0; i < Fields.Length; i++) + for (int i = 0; i < Fields.Count; i++) { FldInfo field = helper.GetField(Fields[i]); if (FieldValues[i] is IArrayInitializer) @@ -4750,9 +4753,12 @@ namespace PascalABCCompiler.NETGenerator { ICommonTypeNode ctn = init_value.type as ICommonTypeNode; IConstantNode[] FieldValues = init_value.FieldValues; - ICommonClassFieldNode[] Fields = ctn.fields; + List Fields = new List(); + foreach (var field in ctn.fields) + if (field.polymorphic_state != polymorphic_state.ps_static) + Fields.Add(field); - for (int i = 0; i < Fields.Length; i++) + for (int i = 0; i < Fields.Count; i++) { FldInfo field = helper.GetField(Fields[i]); if (FieldValues[i] is IArrayConstantNode) diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 5deb85bf2..3c2f4b38d 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.9.0.3489 +3.9.0.3494 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index a53ac66de..4e4a61ffb 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.9.0.3489' +!define VERSION '3.9.0.3494' diff --git a/SyntaxVisitors/YieldVisitors/RenameSameBlockLocalVarsVisitor.cs b/SyntaxVisitors/YieldVisitors/RenameSameBlockLocalVarsVisitor.cs index b0777dd3b..f051721f1 100644 --- a/SyntaxVisitors/YieldVisitors/RenameSameBlockLocalVarsVisitor.cs +++ b/SyntaxVisitors/YieldVisitors/RenameSameBlockLocalVarsVisitor.cs @@ -113,13 +113,16 @@ namespace SyntaxVisitors return; } + var newNameCache = new Dictionary(); + var newLocalNames = var_def.vars.idents.Select(id => { var low = id.name.ToLower(); var newName = this.CreateNewVariableName(low); //BlockNamesStack[CurrentLevel].Add(low, newName); - BlockNamesStack[CurrentLevel][low] = newName; + //BlockNamesStack[CurrentLevel][low] = newName; + newNameCache[low] = newName; return new ident(newName, id.source_context); }); @@ -130,6 +133,8 @@ namespace SyntaxVisitors Replace(var_def, newVS); listNodes[listNodes.Count - 1] = newVS; //SSM 8.11.18 ProcessNode(newVS.inital_value); // SSM 10.06.2020 #2103 + foreach (var key in newNameCache.Keys) + BlockNamesStack[CurrentLevel][key] = newNameCache[key]; //base.visit(newVS); // SSM 10.06.2020 - зачем обходить всё? } diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 9b503384c..b568baf7f 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -1430,24 +1430,26 @@ function ParamStr(i: integer): string; /// Возвращает текущий каталог function GetDir: string; /// Меняет текущий каталог -procedure ChDir(s: string); +procedure ChDir(dirName: string); /// Создает каталог -procedure MkDir(s: string); +procedure MkDir(dirName: string); /// Удаляет каталог -procedure RmDir(s: string); +procedure RmDir(dirName: string); /// Создает каталог. Возвращает True, если каталог успешно создан -function CreateDir(s: string): boolean; +function CreateDir(dirName: string): boolean; /// Удаляет файл. Если файл не может быть удален, то возвращает False -function DeleteFile(fname: string): boolean; +function DeleteFile(fileName: string): boolean; /// Возвращает текущий каталог function GetCurrentDir: string; /// Удаляет каталог. Возвращает True, если каталог успешно удален -function RemoveDir(s: string): boolean; +function RemoveDir(dirName: string): boolean; /// Переименовывает файл fileName, давая ему новое имя newfileName. Возвращает True, если файл успешно переименован function RenameFile(fileName, newfileName: string): boolean; +/// Переименовывает каталог dirName, давая ему новое имя newDirName. Возвращает True, если каталог успешно переименован +function RenameDirectory(dirName, newDirName: string): boolean; /// Устанавливает текущий каталог. Возвращает True, если каталог успешно удален -function SetCurrentDir(s: string): boolean; +function SetCurrentDir(dirName: string): boolean; /// Изменяет расширение файла с именем fileName на newExt function ChangeFileNameExtension(fileName, newExt: string): string; @@ -1462,9 +1464,9 @@ procedure Assert(cond: boolean; sourceFile: string := ''; line: integer := 0); procedure Assert(cond: boolean; message: string; sourceFile: string := ''; line: integer := 0); /// Возвращает свободное место в байтах на диске с именем diskname -function DiskFree(diskname: string): int64; +function DiskFree(diskName: string): int64; /// Возвращает размер в байтах на диске с именем diskname -function DiskSize(diskname: string): int64; +function DiskSize(diskName: string): int64; /// Возвращает свободное место в байтах на диске disk. disk=0 - текущий диск, disk=1 - диск A: , disk=2 - диск B: и т.д. function DiskFree(disk: integer): int64; /// Возвращает размер в байтах на диске disk. disk=0 - текущий диск, disk=1 - диск A: , disk=2 - диск B: и т.д. @@ -8459,41 +8461,41 @@ begin Result := Environment.CurrentDirectory; end; -procedure ChDir(s: string); +procedure ChDir(dirName: string); begin - Environment.CurrentDirectory := s; + Environment.CurrentDirectory := dirName; end; -procedure MkDir(s: string); +procedure MkDir(dirName: string); begin - Directory.CreateDirectory(s); + Directory.CreateDirectory(dirName); end; -procedure RmDir(s: string); +procedure RmDir(dirName: string); begin - Directory.Delete(s); + Directory.Delete(dirName); end; -function CreateDir(s: string): boolean; +function CreateDir(dirName: string): boolean; begin try Result := True; - Directory.CreateDirectory(s); + Directory.CreateDirectory(dirName); except Result := False; end; end; -function DeleteFile(fname: string): boolean; +function DeleteFile(fileName: string): boolean; begin - if not &File.Exists(fname) then + if not &File.Exists(fileName) then begin Result := False; exit end; try Result := True; - &File.Delete(fname); + &File.Delete(fileName); except Result := False; end; @@ -8504,11 +8506,11 @@ begin Result := Environment.CurrentDirectory; end; -function RemoveDir(s: string): boolean; +function RemoveDir(dirName: string): boolean; begin try Result := True; - Directory.Delete(s); + Directory.Delete(dirName); except Result := False; end; @@ -8524,11 +8526,21 @@ begin end; end; -function SetCurrentDir(s: string): boolean; +function RenameDirectory(dirName, newDirName: string): boolean; begin try Result := True; - Environment.CurrentDirectory := s; + Directory.Move(dirName, newDirName); + except + Result := False; + end; +end; + +function SetCurrentDir(dirName: string): boolean; +begin + try + Result := True; + Environment.CurrentDirectory := dirName; except Result := False; end; @@ -8596,7 +8608,7 @@ begin System.Diagnostics.Contracts.Contract.Assert(cond,'Файл '+sourceFile+', строка '+line.ToString() + ': ' + message) end; -function DiskFree(diskname: string): int64; +function DiskFree(diskName: string): int64; begin try var d := new System.IO.DriveInfo(diskname); @@ -8606,7 +8618,7 @@ begin end; end; -function DiskSize(diskname: string): int64; +function DiskSize(diskName: string): int64; begin try var d := new System.IO.DriveInfo(diskname); @@ -13743,6 +13755,23 @@ begin Result := Self.Split(delims.ToCharArray, System.StringSplitOptions.RemoveEmptyEntries); end; +/// Преобразует многострочную строку в массив строк +function ToLines(Self: string): array of string; extensionmethod; +begin + Result := Self.Split(| + #13#10, // CR+LF: Win + #10, // LF: Linux + #13 // CR: Mac + // https://en.m.wikipedia.org/wiki/Newline#Unicode + // But standard .Net things like System.IO.StringReader don't support these, so for now - commented out +// #11, // Vertical Tab +// #12, // Form feed +// char($85), // Next Line +// char($2028), // Line Separator +// char($2029), // Paragraph SeparatorS + |, System.StringSplitOptions.None); +end; + procedure PassSpaces(var s: string; var from: integer); begin while (from <= s.Length) and char.IsWhiteSpace(s[from]) do diff --git a/TestSuite/errors/err0538.pas b/TestSuite/errors/err0538.pas new file mode 100644 index 000000000..a0f78db91 --- /dev/null +++ b/TestSuite/errors/err0538.pas @@ -0,0 +1,8 @@ +//!Повторно объявленный идентификатор name +type + name = (name); + +begin + // Ожидался тип + var v1: name; +end. \ No newline at end of file diff --git a/TestSuite/errors/err0539.pas b/TestSuite/errors/err0539.pas new file mode 100644 index 000000000..e0e25e2b0 --- /dev/null +++ b/TestSuite/errors/err0539.pas @@ -0,0 +1,11 @@ +//!Количество полей не совпадает с количеством полей в записи +type + r1 = record + a: byte; + static b: word; + end; + +begin + // Работает, но не должно + var a: r1 := (a: 1; b: 2); +end. \ No newline at end of file diff --git a/TestSuite/recinit3.pas b/TestSuite/recinit3.pas new file mode 100644 index 000000000..956111e24 --- /dev/null +++ b/TestSuite/recinit3.pas @@ -0,0 +1,11 @@ +type + r1 = record + a: byte; + static b: word; + end; + +begin + //Ошибка: Количество полей не совпадает с количеством полей в записи + var a: r1 := (a: 1); + assert(a.a = 1); +end. \ No newline at end of file diff --git a/TestSuite/units/u_events6.pas b/TestSuite/units/u_events6.pas new file mode 100644 index 000000000..8b9a79bea --- /dev/null +++ b/TestSuite/units/u_events6.pas @@ -0,0 +1,10 @@ +unit u_events6; + +uses System; + +type + I1 = interface + event E1: Action; + end; + +end. \ No newline at end of file diff --git a/TestSuite/usesunits/use_events6.pas b/TestSuite/usesunits/use_events6.pas new file mode 100644 index 000000000..654831e92 --- /dev/null +++ b/TestSuite/usesunits/use_events6.pas @@ -0,0 +1,20 @@ +uses u_events6, System; + +type TClass = class(I1) + event E1: Action; + + procedure RaiseMethod; + begin + if E1 <> nil then + E1(); + end; + +end; + +begin + var i := 0; + var o := new TClass; + o.E1 += () -> begin Inc(i) end; + o.RaiseMethod(); + assert(i = 1); +end. \ No newline at end of file diff --git a/TestSuite/yield8.pas b/TestSuite/yield8.pas new file mode 100644 index 000000000..d58afdcbb --- /dev/null +++ b/TestSuite/yield8.pas @@ -0,0 +1,29 @@ +function V(n: byte) := 1; + +function f1: sequence of integer; +begin + //Ошибка: Ожидалось имя процедуры или функции + var v := V(0); + // Если закомментировать эту строчку - предыдущая строчка работает + yield v; +end; + +function f2: sequence of integer; +begin + //Ошибка: Ожидалось имя процедуры или функции + var v := V(0); + var w := v + 1; + // Если закомментировать эту строчку - предыдущая строчка работает + yield w; +end; + +begin + var i := 0; + foreach var j in f1 do + i := j; + assert(i = 1); + + foreach var j in f2 do + i := j; + assert(i = 2); +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 61a06225f..e0d4d0612 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -12211,6 +12211,8 @@ namespace PascalABCCompiler.TreeConverter context.check_name_free(name, loc); is_direct_type_decl = true; type_node tn = convert_strong(_type_declaration.type_def); + if (_type_declaration.type_def is enum_type_definition) + context.check_name_free(name, loc); assign_doc_info(tn,_type_declaration); is_direct_type_decl = false; if (_type_declaration.type_def is SyntaxTree.named_type_reference|| @@ -15595,13 +15597,14 @@ namespace PascalABCCompiler.TreeConverter private record_initializer ConvertRecordInitializer(common_type_node ctn, record_initializer constant) { location loc = constant.location; + var non_static_fields = ctn.fields.Where(x => !x.IsStatic).ToArray(); if (!ctn.is_value_type) AddError(loc, "RECORD_CONST_NOT_ALLOWED_{0}", ctn.name); - if (ctn.fields.Count != constant.record_const_definition_list.Count) + if (non_static_fields.Length != constant.record_const_definition_list.Count) AddError(loc, "INVALID_RECORD_CONST_FIELD_COUNT"); constant.type = ctn; constant.field_values.Clear(); - for (int i = 0; i < ctn.fields.Count; i++) + for (int i = 0; i < non_static_fields.Length; i++) { class_field cf = ctn.fields[i]; if (cf.name.ToLower() != constant.record_const_definition_list[i].name.name.ToLower()) diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 9b503384c..b568baf7f 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -1430,24 +1430,26 @@ function ParamStr(i: integer): string; /// Возвращает текущий каталог function GetDir: string; /// Меняет текущий каталог -procedure ChDir(s: string); +procedure ChDir(dirName: string); /// Создает каталог -procedure MkDir(s: string); +procedure MkDir(dirName: string); /// Удаляет каталог -procedure RmDir(s: string); +procedure RmDir(dirName: string); /// Создает каталог. Возвращает True, если каталог успешно создан -function CreateDir(s: string): boolean; +function CreateDir(dirName: string): boolean; /// Удаляет файл. Если файл не может быть удален, то возвращает False -function DeleteFile(fname: string): boolean; +function DeleteFile(fileName: string): boolean; /// Возвращает текущий каталог function GetCurrentDir: string; /// Удаляет каталог. Возвращает True, если каталог успешно удален -function RemoveDir(s: string): boolean; +function RemoveDir(dirName: string): boolean; /// Переименовывает файл fileName, давая ему новое имя newfileName. Возвращает True, если файл успешно переименован function RenameFile(fileName, newfileName: string): boolean; +/// Переименовывает каталог dirName, давая ему новое имя newDirName. Возвращает True, если каталог успешно переименован +function RenameDirectory(dirName, newDirName: string): boolean; /// Устанавливает текущий каталог. Возвращает True, если каталог успешно удален -function SetCurrentDir(s: string): boolean; +function SetCurrentDir(dirName: string): boolean; /// Изменяет расширение файла с именем fileName на newExt function ChangeFileNameExtension(fileName, newExt: string): string; @@ -1462,9 +1464,9 @@ procedure Assert(cond: boolean; sourceFile: string := ''; line: integer := 0); procedure Assert(cond: boolean; message: string; sourceFile: string := ''; line: integer := 0); /// Возвращает свободное место в байтах на диске с именем diskname -function DiskFree(diskname: string): int64; +function DiskFree(diskName: string): int64; /// Возвращает размер в байтах на диске с именем diskname -function DiskSize(diskname: string): int64; +function DiskSize(diskName: string): int64; /// Возвращает свободное место в байтах на диске disk. disk=0 - текущий диск, disk=1 - диск A: , disk=2 - диск B: и т.д. function DiskFree(disk: integer): int64; /// Возвращает размер в байтах на диске disk. disk=0 - текущий диск, disk=1 - диск A: , disk=2 - диск B: и т.д. @@ -8459,41 +8461,41 @@ begin Result := Environment.CurrentDirectory; end; -procedure ChDir(s: string); +procedure ChDir(dirName: string); begin - Environment.CurrentDirectory := s; + Environment.CurrentDirectory := dirName; end; -procedure MkDir(s: string); +procedure MkDir(dirName: string); begin - Directory.CreateDirectory(s); + Directory.CreateDirectory(dirName); end; -procedure RmDir(s: string); +procedure RmDir(dirName: string); begin - Directory.Delete(s); + Directory.Delete(dirName); end; -function CreateDir(s: string): boolean; +function CreateDir(dirName: string): boolean; begin try Result := True; - Directory.CreateDirectory(s); + Directory.CreateDirectory(dirName); except Result := False; end; end; -function DeleteFile(fname: string): boolean; +function DeleteFile(fileName: string): boolean; begin - if not &File.Exists(fname) then + if not &File.Exists(fileName) then begin Result := False; exit end; try Result := True; - &File.Delete(fname); + &File.Delete(fileName); except Result := False; end; @@ -8504,11 +8506,11 @@ begin Result := Environment.CurrentDirectory; end; -function RemoveDir(s: string): boolean; +function RemoveDir(dirName: string): boolean; begin try Result := True; - Directory.Delete(s); + Directory.Delete(dirName); except Result := False; end; @@ -8524,11 +8526,21 @@ begin end; end; -function SetCurrentDir(s: string): boolean; +function RenameDirectory(dirName, newDirName: string): boolean; begin try Result := True; - Environment.CurrentDirectory := s; + Directory.Move(dirName, newDirName); + except + Result := False; + end; +end; + +function SetCurrentDir(dirName: string): boolean; +begin + try + Result := True; + Environment.CurrentDirectory := dirName; except Result := False; end; @@ -8596,7 +8608,7 @@ begin System.Diagnostics.Contracts.Contract.Assert(cond,'Файл '+sourceFile+', строка '+line.ToString() + ': ' + message) end; -function DiskFree(diskname: string): int64; +function DiskFree(diskName: string): int64; begin try var d := new System.IO.DriveInfo(diskname); @@ -8606,7 +8618,7 @@ begin end; end; -function DiskSize(diskname: string): int64; +function DiskSize(diskName: string): int64; begin try var d := new System.IO.DriveInfo(diskname); @@ -13743,6 +13755,23 @@ begin Result := Self.Split(delims.ToCharArray, System.StringSplitOptions.RemoveEmptyEntries); end; +/// Преобразует многострочную строку в массив строк +function ToLines(Self: string): array of string; extensionmethod; +begin + Result := Self.Split(| + #13#10, // CR+LF: Win + #10, // LF: Linux + #13 // CR: Mac + // https://en.m.wikipedia.org/wiki/Newline#Unicode + // But standard .Net things like System.IO.StringReader don't support these, so for now - commented out +// #11, // Vertical Tab +// #12, // Form feed +// char($85), // Next Line +// char($2028), // Line Separator +// char($2029), // Paragraph SeparatorS + |, System.StringSplitOptions.None); +end; + procedure PassSpaces(var s: string; var from: integer); begin while (from <= s.Length) and char.IsWhiteSpace(s[from]) do