diff --git a/CodeCompletion/CodeFormatter.cs b/CodeCompletion/CodeFormatter.cs index 6f1418299..6e960840e 100644 --- a/CodeCompletion/CodeFormatter.cs +++ b/CodeCompletion/CodeFormatter.cs @@ -2790,9 +2790,7 @@ namespace CodeFormatters { //multiline_stack_push(at); visit_node(at.vars); - //add_space_before = true; add_space_after = true; - //sb.Append(" := "); visit_node(at.expr); //multiline_stack_pop(at); } @@ -2803,8 +2801,6 @@ namespace CodeFormatters var i = 0; foreach (var av in al.variables) { - /*if (i > 0) - sb.Append(", ");*/ visit_node(av); add_space_after = true; i++; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 0ec90bfe6..04ecb2a6e 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: SSM -// DateTime: 09.04.2016 22:21:39 +// DateTime: 13.04.2016 11:35:20 // UserName: ????????? // GPLEX input file // GPLEX frame file @@ -2375,24 +2375,32 @@ public static class Keywords keywords.Add("class",(int)Tokens.tkClass); keywords.Add("const",(int)Tokens.tkConst); keywords.Add("constructor",(int)Tokens.tkConstructor); + keywords.Add("default",(int)Tokens.tkDefault); keywords.Add("destructor",(int)Tokens.tkDestructor); keywords.Add("downto",(int)Tokens.tkDownto); keywords.Add("do",(int)Tokens.tkDo); keywords.Add("else",(int)Tokens.tkElse); keywords.Add("end",(int)Tokens.tkEnd); + keywords.Add("event",(int)Tokens.tkEvent); keywords.Add("except",(int)Tokens.tkExcept); + keywords.Add("exports",(int)Tokens.tkExports); keywords.Add("file",(int)Tokens.tkFile); keywords.Add("finalization",(int)Tokens.tkFinalization); keywords.Add("finally",(int)Tokens.tkFinally); keywords.Add("for",(int)Tokens.tkFor); keywords.Add("foreach",(int)Tokens.tkForeach); keywords.Add("function",(int)Tokens.tkFunction); + keywords.Add("goto",(int)Tokens.tkGoto); keywords.Add("if",(int)Tokens.tkIf); keywords.Add("implementation",(int)Tokens.tkImplementation); keywords.Add("inherited",(int)Tokens.tkInherited); keywords.Add("initialization",(int)Tokens.tkInitialization); keywords.Add("interface",(int)Tokens.tkInterface); + keywords.Add("label",(int)Tokens.tkLabel); + keywords.Add("lock",(int)Tokens.tkLock); + keywords.Add("nil",(int)Tokens.tkNil); keywords.Add("procedure",(int)Tokens.tkProcedure); + keywords.Add("of",(int)Tokens.tkOf); keywords.Add("operator",(int)Tokens.tkOperator); keywords.Add("property",(int)Tokens.tkProperty); keywords.Add("raise",(int)Tokens.tkRaise); @@ -2408,17 +2416,9 @@ public static class Keywords keywords.Add("var",(int)Tokens.tkVar); keywords.Add("while",(int)Tokens.tkWhile); keywords.Add("with",(int)Tokens.tkWith); - keywords.Add("nil",(int)Tokens.tkNil); - keywords.Add("goto",(int)Tokens.tkGoto); - keywords.Add("of",(int)Tokens.tkOf); - keywords.Add("label",(int)Tokens.tkLabel); - keywords.Add("lock",(int)Tokens.tkLock); keywords.Add("program",(int)Tokens.tkProgram); - keywords.Add("event",(int)Tokens.tkEvent); - keywords.Add("default",(int)Tokens.tkDefault); keywords.Add("template",(int)Tokens.tkTemplate); keywords.Add("packed",(int)Tokens.tkPacked); - keywords.Add("exports",(int)Tokens.tkExports); keywords.Add("resourcestring",(int)Tokens.tkResourceString); keywords.Add("threadvar",(int)Tokens.tkThreadvar); keywords.Add("sealed",(int)Tokens.tkSealed); diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex index 63a80e1dc..ec8c7ffe6 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex @@ -547,24 +547,32 @@ public static class Keywords keywords.Add("class",(int)Tokens.tkClass); keywords.Add("const",(int)Tokens.tkConst); keywords.Add("constructor",(int)Tokens.tkConstructor); + keywords.Add("default",(int)Tokens.tkDefault); keywords.Add("destructor",(int)Tokens.tkDestructor); keywords.Add("downto",(int)Tokens.tkDownto); keywords.Add("do",(int)Tokens.tkDo); keywords.Add("else",(int)Tokens.tkElse); keywords.Add("end",(int)Tokens.tkEnd); + keywords.Add("event",(int)Tokens.tkEvent); keywords.Add("except",(int)Tokens.tkExcept); + keywords.Add("exports",(int)Tokens.tkExports); keywords.Add("file",(int)Tokens.tkFile); keywords.Add("finalization",(int)Tokens.tkFinalization); keywords.Add("finally",(int)Tokens.tkFinally); keywords.Add("for",(int)Tokens.tkFor); keywords.Add("foreach",(int)Tokens.tkForeach); keywords.Add("function",(int)Tokens.tkFunction); + keywords.Add("goto",(int)Tokens.tkGoto); keywords.Add("if",(int)Tokens.tkIf); keywords.Add("implementation",(int)Tokens.tkImplementation); keywords.Add("inherited",(int)Tokens.tkInherited); keywords.Add("initialization",(int)Tokens.tkInitialization); keywords.Add("interface",(int)Tokens.tkInterface); + keywords.Add("label",(int)Tokens.tkLabel); + keywords.Add("lock",(int)Tokens.tkLock); + keywords.Add("nil",(int)Tokens.tkNil); keywords.Add("procedure",(int)Tokens.tkProcedure); + keywords.Add("of",(int)Tokens.tkOf); keywords.Add("operator",(int)Tokens.tkOperator); keywords.Add("property",(int)Tokens.tkProperty); keywords.Add("raise",(int)Tokens.tkRaise); @@ -580,17 +588,9 @@ public static class Keywords keywords.Add("var",(int)Tokens.tkVar); keywords.Add("while",(int)Tokens.tkWhile); keywords.Add("with",(int)Tokens.tkWith); - keywords.Add("nil",(int)Tokens.tkNil); - keywords.Add("goto",(int)Tokens.tkGoto); - keywords.Add("of",(int)Tokens.tkOf); - keywords.Add("label",(int)Tokens.tkLabel); - keywords.Add("lock",(int)Tokens.tkLock); keywords.Add("program",(int)Tokens.tkProgram); - keywords.Add("event",(int)Tokens.tkEvent); - keywords.Add("default",(int)Tokens.tkDefault); keywords.Add("template",(int)Tokens.tkTemplate); keywords.Add("packed",(int)Tokens.tkPacked); - keywords.Add("exports",(int)Tokens.tkExports); keywords.Add("resourcestring",(int)Tokens.tkResourceString); keywords.Add("threadvar",(int)Tokens.tkThreadvar); keywords.Add("sealed",(int)Tokens.tkSealed); diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 792142571..b223e8dc7 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -3353,6 +3353,10 @@ keyword { $$ = $1; } | tkParams { $$ = $1; } + | tkEvent + { $$ = $1; } + | tkYield + { $$ = $1; } ; reserved_keyword diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index b24f7e3a1..53a2a0da8 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,9 +2,9 @@ // GPPG version 1.3.6 // Machine: SSM -// DateTime: 09.04.2016 22:21:40 +// DateTime: 13.04.2016 11:35:20 // UserName: ????????? -// Input file +// Input file // options: no-lines gplex @@ -56,7 +56,7 @@ public abstract class ScanBase : AbstractScanner { - // Verbatim content from ABCPascal.y + // Verbatim content from D:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y // ��� ���������� ����������� � ����� GPPGParser, �������������� ����� ������, ������������ �������� gppg public syntax_tree_node root; // �������� ���� ��������������� ������ @@ -68,13 +68,13 @@ public partial class GPPGParser: ShiftReduceParser scanner) : base(scanner) { } - // End verbatim content from ABCPascal.y + // End verbatim content from D:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y #pragma warning disable 649 private static Dictionary aliasses; #pragma warning restore 649 - private static Rule[] rules = new Rule[794]; - private static State[] states = new State[1265]; + private static Rule[] rules = new Rule[796]; + private static State[] states = new State[1267]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "assignment", "optional_array_initializer", "attribute_declarations", "ot_visibility_specifier", "one_attribute", "attribute_variable", @@ -150,13 +150,13 @@ public partial class GPPGParser: ShiftReduceParser tkParams { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 727: // reserved_keyword -> tkOperator + case 727: // keyword -> tkEvent { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 728: // reserved_keyword -> tkEnd + case 728: // keyword -> tkYield { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 729: // overload_operator -> tkMinus + case 729: // reserved_keyword -> tkOperator +{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } + break; + case 730: // reserved_keyword -> tkEnd +{ CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } + break; + case 731: // overload_operator -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 730: // overload_operator -> tkPlus + case 732: // overload_operator -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 731: // overload_operator -> tkSlash + case 733: // overload_operator -> tkSlash { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 732: // overload_operator -> tkStar + case 734: // overload_operator -> tkStar { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 733: // overload_operator -> tkEqual + case 735: // overload_operator -> tkEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 734: // overload_operator -> tkGreater + case 736: // overload_operator -> tkGreater { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 735: // overload_operator -> tkGreaterEqual + case 737: // overload_operator -> tkGreaterEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 736: // overload_operator -> tkLower + case 738: // overload_operator -> tkLower { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 737: // overload_operator -> tkLowerEqual + case 739: // overload_operator -> tkLowerEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 738: // overload_operator -> tkNotEqual + case 740: // overload_operator -> tkNotEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 739: // overload_operator -> tkOr + case 741: // overload_operator -> tkOr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 740: // overload_operator -> tkXor + case 742: // overload_operator -> tkXor { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 741: // overload_operator -> tkAnd + case 743: // overload_operator -> tkAnd { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 742: // overload_operator -> tkDiv + case 744: // overload_operator -> tkDiv { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 743: // overload_operator -> tkMod + case 745: // overload_operator -> tkMod { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 744: // overload_operator -> tkShl + case 746: // overload_operator -> tkShl { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 745: // overload_operator -> tkShr + case 747: // overload_operator -> tkShr { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 746: // overload_operator -> tkNot + case 748: // overload_operator -> tkNot { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 747: // overload_operator -> tkIn + case 749: // overload_operator -> tkIn { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 748: // overload_operator -> tkImplicit + case 750: // overload_operator -> tkImplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 749: // overload_operator -> tkExplicit + case 751: // overload_operator -> tkExplicit { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 750: // overload_operator -> assign_operator + case 752: // overload_operator -> assign_operator { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 751: // assign_operator -> tkAssign + case 753: // assign_operator -> tkAssign { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 752: // assign_operator -> tkPlusEqual + case 754: // assign_operator -> tkPlusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 753: // assign_operator -> tkMinusEqual + case 755: // assign_operator -> tkMinusEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 754: // assign_operator -> tkMultEqual + case 756: // assign_operator -> tkMultEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 755: // assign_operator -> tkDivEqual + case 757: // assign_operator -> tkDivEqual { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 756: // func_decl_lambda -> identifier, tkArrow, lambda_function_body + case 758: // 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 PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]); CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 757: // func_decl_lambda -> tkRoundOpen, tkRoundClose, lambda_type_ref_noproctype, + case 759: // func_decl_lambda -> 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, CurrentLocationSpan); } break; - case 758: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkRoundClose, + case 760: // 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]); @@ -5404,7 +5414,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, + case 761: // func_decl_lambda -> tkRoundOpen, identifier, tkSemiColon, full_lambda_fp_list, // tkRoundClose, lambda_type_ref_noproctype, tkArrow, // lambda_function_body { @@ -5415,7 +5425,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, + case 762: // func_decl_lambda -> tkRoundOpen, identifier, tkColon, fptype, tkSemiColon, // full_lambda_fp_list, tkRoundClose, // lambda_type_ref_noproctype, tkArrow, lambda_function_body { @@ -5427,7 +5437,7 @@ public partial class GPPGParser: ShiftReduceParser tkRoundOpen, expr_l1, tkComma, expr_l1_list, + case 763: // func_decl_lambda -> tkRoundOpen, expr_l1, tkComma, expr_l1_list, // lambda_type_ref, optional_full_lambda_fp_list, // tkRoundClose, rem_lambda { @@ -5510,64 +5520,64 @@ public partial class GPPGParser: ShiftReduceParser expl_func_decl_lambda + case 764: // func_decl_lambda -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 763: // optional_full_lambda_fp_list -> /* empty */ + case 765: // optional_full_lambda_fp_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 764: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list + case 766: // optional_full_lambda_fp_list -> tkSemiColon, full_lambda_fp_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 765: // rem_lambda -> /* empty */ + case 767: // rem_lambda -> /* empty */ { CurrentSemanticValue.ob = null; } break; - case 766: // rem_lambda -> lambda_type_ref_noproctype, tkArrow, lambda_function_body + case 768: // 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 767: // expl_func_decl_lambda -> tkFunction, lambda_type_ref, tkArrow, + case 769: // expl_func_decl_lambda -> tkFunction, lambda_type_ref, 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, CurrentLocationSpan); } break; - case 768: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, lambda_type_ref, + case 770: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, tkRoundClose, lambda_type_ref, // 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, CurrentLocationSpan); } break; - case 769: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, + case 771: // expl_func_decl_lambda -> tkFunction, tkRoundOpen, full_lambda_fp_list, // tkRoundClose, lambda_type_ref, 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, CurrentLocationSpan); } break; - case 770: // expl_func_decl_lambda -> tkProcedure, tkArrow, lambda_procedure_body + case 772: // 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, CurrentLocationSpan); } break; - case 771: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, tkRoundClose, tkArrow, + case 773: // 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, CurrentLocationSpan); } break; - case 772: // expl_func_decl_lambda -> tkProcedure, tkRoundOpen, full_lambda_fp_list, + case 774: // 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, CurrentLocationSpan); } break; - case 773: // full_lambda_fp_list -> lambda_simple_fp_sect + case 775: // 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) @@ -5587,102 +5597,102 @@ public partial class GPPGParser: ShiftReduceParser full_lambda_fp_list, tkSemiColon, lambda_simple_fp_sect + case 776: // 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 775: // lambda_simple_fp_sect -> ident_list, lambda_type_ref + case 777: // 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 776: // lambda_type_ref -> /* empty */ + case 778: // lambda_type_ref -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 777: // lambda_type_ref -> tkColon, fptype + case 779: // lambda_type_ref -> tkColon, fptype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 778: // lambda_type_ref_noproctype -> /* empty */ + case 780: // lambda_type_ref_noproctype -> /* empty */ { CurrentSemanticValue.td = new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null); } break; - case 779: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype + case 781: // lambda_type_ref_noproctype -> tkColon, fptype_noproctype { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 780: // lambda_function_body -> expr_l1 + case 782: // lambda_function_body -> expr_l1 { CurrentSemanticValue.stn = NewLambdaBody(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 781: // lambda_function_body -> compound_stmt + case 783: // lambda_function_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 782: // lambda_procedure_body -> proc_call + case 784: // lambda_procedure_body -> proc_call { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 783: // lambda_procedure_body -> compound_stmt + case 785: // lambda_procedure_body -> compound_stmt { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 784: // lambda_procedure_body -> if_stmt + case 786: // lambda_procedure_body -> if_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 785: // lambda_procedure_body -> while_stmt + case 787: // lambda_procedure_body -> while_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 786: // lambda_procedure_body -> repeat_stmt + case 788: // lambda_procedure_body -> repeat_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 787: // lambda_procedure_body -> for_stmt + case 789: // lambda_procedure_body -> for_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 788: // lambda_procedure_body -> foreach_stmt + case 790: // lambda_procedure_body -> foreach_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 789: // lambda_procedure_body -> case_stmt + case 791: // lambda_procedure_body -> case_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 790: // lambda_procedure_body -> try_stmt + case 792: // lambda_procedure_body -> try_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 791: // lambda_procedure_body -> lock_stmt + case 793: // lambda_procedure_body -> lock_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 792: // lambda_procedure_body -> yield_stmt + case 794: // lambda_procedure_body -> yield_stmt { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } break; - case 793: // lambda_procedure_body -> assignment + case 795: // lambda_procedure_body -> assignment { CurrentSemanticValue.stn = new statement_list(ValueStack[ValueStack.Depth-1].stn as statement, CurrentLocationSpan); } diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 1a8db0701..b20934ab4 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -128,5 +128,6 @@ script= + diff --git a/SyntaxTree/tree/tree.nin b/SyntaxTree/tree/tree.nin index ede5a8c8e..1b6725d68 100644 Binary files a/SyntaxTree/tree/tree.nin and b/SyntaxTree/tree/tree.nin differ diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index a8fb71b3b..51bdab640 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -7781,13 +7781,15 @@ end; // ----------------------------------------------------- // Дополнения февраль 2016: Iterate, Step, &Repeat, Cycle -/// Возвращает бесконечную рекуррентную последовательность элементов, задаваемую начальным элементом и функцией next +// Возвращает бесконечную рекуррентную последовательность элементов, задаваемую начальным элементом и функцией next +///-- function Iterate(Self: T; next: T -> T): sequence of T; extensionmethod; begin Result := Iterate&(Self,next); end; -/// Возвращает бесконечную рекуррентную последовательность элементов, задаваемую начальным элементом, следующим за ним элементом и функцией next +// Возвращает бесконечную рекуррентную последовательность элементов, задаваемую начальным элементом, следующим за ним элементом и функцией next +///-- function Iterate(Self,second: T; next: (T,T) -> T): sequence of T; extensionmethod; begin Result := Iterate&(Self,second,next); @@ -7813,7 +7815,8 @@ begin Result := IntNumbersClass.Create().Select(x->x*step+slf); end; -/// Возвращает бесконечную последовательность элементов, совпадающих с данным +// Возвращает бесконечную последовательность элементов, совпадающих с данным +///-- function &Repeat(Self: T): sequence of T; extensionmethod; begin Result := SeqFill(MaxInt,Self);