From dce5abc6b425f68622531d2e08082fa27bf3dd0f Mon Sep 17 00:00:00 2001 From: Ivan Bondarev Date: Fri, 24 Dec 2021 14:52:33 +0100 Subject: [PATCH] fix #2575 --- Parsers/PascalABCParserNewSaushkin/ABCPascal.cs | 6 +++--- Parsers/PascalABCParserNewSaushkin/ABCPascal.y | 2 ++ Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs | 8 +++++--- TestSuite/errors/err0449.pas | 5 +++++ 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 TestSuite/errors/err0449.pas diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index df0c7a448..af9aaac9b 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-G8V08V4 -// DateTime: 24.12.2021 11:23:25 -// UserName: ????????? +// Machine: DESKTOP-2BJCJ7I +// DateTime: 24.12.2021 14:49:33 +// UserName: ibond // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index cf79d51e6..1e586ddb4 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -4320,6 +4320,8 @@ variable } | variable tkRoundOpen optional_expr_list tkRoundClose { + if ($1 is index) + parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", @1, "^"); $$ = new method_call($1 as addressed_value,$3 as expression_list, @$); } | variable tkPoint identifier_keyword_operatorname diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 86f2caa00..535ac3627 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-G8V08V4 -// DateTime: 24.12.2021 11:23:26 -// UserName: ????????? +// Machine: DESKTOP-2BJCJ7I +// DateTime: 24.12.2021 14:49:34 +// UserName: ibond // Input file // options: no-lines gplex @@ -6789,6 +6789,8 @@ public partial class GPPGParser: ShiftReduceParser variable, tkRoundOpen, optional_expr_list, tkRoundClose { + if (ValueStack[ValueStack.Depth-4].ex is index) + parsertools.AddErrorFromResource("UNEXPECTED_SYMBOL{0}", LocationStack[LocationStack.Depth-4], "^"); CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-4].ex as addressed_value,ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; diff --git a/TestSuite/errors/err0449.pas b/TestSuite/errors/err0449.pas new file mode 100644 index 000000000..c07919377 --- /dev/null +++ b/TestSuite/errors/err0449.pas @@ -0,0 +1,5 @@ +//!Неожиданный символ '^' +begin + var p: pointer; + (^integer)(p)^.print; +end. \ No newline at end of file