fix #2166
This commit is contained in:
parent
ecba520fad
commit
94142b84aa
|
|
@ -1,9 +1,9 @@
|
|||
//
|
||||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: DESKTOP-P4NLNB1
|
||||
// DateTime: 5/5/2020 6:55:25 PM
|
||||
// UserName: fatco
|
||||
// Machine: IVAN-PC
|
||||
// DateTime: 31.05.2020 20:42:32
|
||||
// UserName: Ivan
|
||||
// GPLEX input file <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
//
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
// GPPG error listing for yacc source file <ABCPascal.y>
|
||||
// ==========================================================================
|
||||
// Version: 1.3.6
|
||||
// Machine: DESKTOP-P4NLNB1
|
||||
// DateTime: 4/20/2020 4:00:49 PM
|
||||
// UserName: fatco
|
||||
// Machine: IVAN-PC
|
||||
// DateTime: 31.05.2020 20:31:33
|
||||
// UserName: Ivan
|
||||
// ==========================================================================
|
||||
|
||||
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
%type <ex> const_simple_expr term term1 simple_term typed_const typed_const_plus typed_var_init_expression expr expr_with_func_decl_lambda const_expr elem range_expr const_elem array_const factor relop_expr expr_dq expr_l1 expr_l1_func_decl_lambda expr_l1_for_lambda simple_expr range_term range_factor
|
||||
%type <ex> external_directive_ident init_const_expr case_label variable var_reference /*optional_write_expr*/ optional_read_expr simple_expr_or_nothing var_question_point expr_l1_for_question_expr expr_l1_for_new_question_expr
|
||||
%type <ob> for_cycle_type
|
||||
%type <ex> format_expr format_const_expr const_expr_or_nothing simple_expr_with_deref_or_nothing simple_expr_with_deref /*expr_l1_for_indexer*/
|
||||
%type <ex> format_expr format_const_expr const_expr_or_nothing /* simple_expr_with_deref_or_nothing simple_expr_with_deref expr_l1_for_indexer*/
|
||||
%type <stn> foreach_stmt
|
||||
%type <stn> for_stmt loop_stmt yield_stmt yield_sequence_stmt
|
||||
%type <stn> fp_list fp_sect_list
|
||||
|
|
@ -191,17 +191,12 @@
|
|||
%type <ob> pattern_out_param_list pattern_out_param_list_optional_var collection_pattern_expr_list tuple_pattern_item_list const_pattern_expr_list
|
||||
|
||||
%%
|
||||
// Error: NonTerminal symbol "simple_expr_with_deref_or_nothing" has no productions
|
||||
// Warning: NonTerminal symbol "simple_expr_with_deref" is unreachable
|
||||
// Error: NonTerminal symbol "simple_expr_with_deref" has no productions
|
||||
// Warning: NonTerminal symbol "simple_expr_with_deref_or_nothing" is unreachable
|
||||
// Error: There are 2 non-terminating NonTerminal Symbols
|
||||
// {simple_expr_with_deref_or_nothing, simple_expr_with_deref}
|
||||
// Warning: Terminating simple_expr_with_deref_or_nothing fixes the following size-1 NonTerminal set
|
||||
// {simple_expr_with_deref_or_nothing}
|
||||
// Warning: Terminating simple_expr_with_deref fixes the following size-1 NonTerminal set
|
||||
// {simple_expr_with_deref}
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Error: NonTerminal symbol "tkExtensionmethod" has no productions
|
||||
// Warning: Terminating tkExtensionmethod fixes the following size-1 NonTerminal set
|
||||
// {tkExtensionmethod}
|
||||
// Error: There are 1 non-terminating NonTerminal Symbols
|
||||
// {tkExtensionmethod}
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
parse_goal
|
||||
: program_file
|
||||
|
|
@ -961,9 +956,7 @@ const_variable
|
|||
if (fe.format1 == null)
|
||||
fe.format1 = new int32_const(int.MaxValue,@3);
|
||||
}
|
||||
var from = fe.expr is index ? fe.expr : new index(fe.expr, false, fe.expr.source_context);
|
||||
var to = fe.format1 is index ? fe.format1 : new index(fe.format1, false, fe.format1.source_context);
|
||||
$$ = new slice_expr($1 as addressed_value,from,to,fe.format2,@$);
|
||||
$$ = new slice_expr($1 as addressed_value,fe.expr,fe.format1,fe.format2,@$);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
@ -2734,9 +2727,7 @@ assignment
|
|||
if (fe.format1 == null)
|
||||
fe.format1 = new int32_const(int.MaxValue,@3);
|
||||
}
|
||||
var from = fe.expr is index ? fe.expr : new index(fe.expr, false, fe.expr.source_context);
|
||||
var to = fe.format1 is index ? fe.format1 : new index(fe.format1, false, fe.format1.source_context);
|
||||
var left = new slice_expr_question($1 as addressed_value,from.to,fe.format2,@$);
|
||||
var left = new slice_expr_question($1 as addressed_value,fe.expr,fe.format1,fe.format2,@$);
|
||||
$$ = new assign(left, $6, $5.type, @$);
|
||||
}
|
||||
;
|
||||
|
|
@ -3145,16 +3136,12 @@ expr_with_func_decl_lambda
|
|||
expr
|
||||
: expr_l1
|
||||
{ $$ = $1; }
|
||||
| tkDeref expr_l1
|
||||
{ $$ = new simple_expr_with_deref($2, true); }
|
||||
| format_expr
|
||||
{ $$ = $1; }
|
||||
;
|
||||
/*
|
||||
expr_l1_for_indexer
|
||||
: tkDeref expr_l1
|
||||
{ $$ = new simple_expr_with_deref($2, true); }
|
||||
| expr_l1
|
||||
: expr_l1
|
||||
{ $$ = $1; }
|
||||
| format_expr
|
||||
{ $$ = $1; }
|
||||
|
|
@ -3385,6 +3372,10 @@ relop_expr
|
|||
{
|
||||
$$ = new bin_expr($1, $3, $2.type, @$);
|
||||
}
|
||||
| relop_expr relop new_question_expr
|
||||
{
|
||||
$$ = new bin_expr($1, $3, $2.type, @$);
|
||||
}
|
||||
| is_type_expr tkRoundOpen pattern_out_param_list tkRoundClose
|
||||
{
|
||||
var isTypeCheck = $1 as typecast_node;
|
||||
|
|
@ -3803,6 +3794,10 @@ term1
|
|||
{
|
||||
$$ = new bin_expr($1, $3, $2.type, @$);
|
||||
}
|
||||
| term1 addop new_question_expr
|
||||
{
|
||||
$$ = new bin_expr($1, $3, $2.type, @$);
|
||||
}
|
||||
;
|
||||
|
||||
addop
|
||||
|
|
@ -3871,6 +3866,8 @@ term
|
|||
{ $$ = new bin_expr($1,$3,($2).type, @$); }
|
||||
| term mulop power_expr
|
||||
{ $$ = new bin_expr($1,$3,($2).type, @$); }
|
||||
| term mulop new_question_expr
|
||||
{ $$ = new bin_expr($1,$3,($2).type, @$); }
|
||||
| as_is_expr
|
||||
{ $$ = $1; }
|
||||
;
|
||||
|
|
@ -4080,9 +4077,7 @@ variable
|
|||
if (fe.format1 == null)
|
||||
fe.format1 = new int32_const(int.MaxValue,@3);
|
||||
}
|
||||
var from = fe.expr is index ? fe.expr : new index(fe.expr, false, fe.expr.source_context);
|
||||
var to = fe.format1 is index ? fe.format1 : new index(fe.format1, false, fe.format1.source_context);
|
||||
$$ = new slice_expr($1 as addressed_value,from,to,fe.format2,@$);
|
||||
$$ = new slice_expr($1 as addressed_value,fe.expr,fe.format1,fe.format2,@$);
|
||||
}
|
||||
else $$ = new indexer($1 as addressed_value, el, @$);
|
||||
}
|
||||
|
|
@ -4096,9 +4091,7 @@ variable
|
|||
if (fe.format1 == null)
|
||||
fe.format1 = new int32_const(int.MaxValue,@3);
|
||||
}
|
||||
var from = fe.expr is index ? fe.expr : new index(fe.expr, false, fe.expr.source_context);
|
||||
var to = fe.format1 is index ? fe.format1 : new index(fe.format1, false, fe.format1.source_context);
|
||||
$$ = new slice_expr_question($1 as addressed_value,from,to,fe.format2,@$);
|
||||
$$ = new slice_expr_question($1 as addressed_value,fe.expr,fe.format1,fe.format2,@$);
|
||||
}
|
||||
| variable tkRoundOpen optional_expr_list tkRoundClose
|
||||
{
|
||||
|
|
@ -4469,6 +4462,28 @@ keyword
|
|||
{ $$ = $1; }
|
||||
| tkWhen
|
||||
{ $$ = $1; }
|
||||
| tkAbstract
|
||||
{ $$ = $1; }
|
||||
| tkLock
|
||||
{ $$ = $1; }
|
||||
| tkImplicit
|
||||
{ $$ = $1; }
|
||||
| tkExplicit
|
||||
{ $$ = $1; }
|
||||
| tkOn
|
||||
{ $$ = $1; }
|
||||
| tkVirtual
|
||||
{ $$ = $1; }
|
||||
| tkOverride
|
||||
{ $$ = $1; }
|
||||
| tkLoop
|
||||
{ $$ = $1; }
|
||||
| tkExtensionmethod
|
||||
{ $$ = $1; }
|
||||
| tkOverload
|
||||
{ $$ = $1; }
|
||||
| tkReintroduce
|
||||
{ $$ = $1; }
|
||||
;
|
||||
|
||||
reserved_keyword
|
||||
|
|
|
|||
|
|
@ -4445,6 +4445,32 @@ keyword
|
|||
{ $$ = $1; }
|
||||
| tkWhen
|
||||
{ $$ = $1; }
|
||||
| tkPartial
|
||||
{ $$ = $1; }
|
||||
| tkAbstract
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkLock
|
||||
{ $$ = $1; }
|
||||
| tkImplicit
|
||||
{ $$ = $1; }
|
||||
| tkExplicit
|
||||
{ $$ = $1; }
|
||||
| tkOn
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkVirtual
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkOverride
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkLoop
|
||||
{ $$ = $1; }
|
||||
| tkExtensionMethod
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkOverload
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkReintroduce
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
| tkForward
|
||||
{ $$ = new token_info($1.name, @$); }
|
||||
;
|
||||
|
||||
reserved_keyword
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
33
TestSuite/CompilationSamples/keywords.pas
Normal file
33
TestSuite/CompilationSamples/keywords.pas
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
type
|
||||
T = class
|
||||
public static procedure &Abstract := exit;
|
||||
public static procedure &Operator := exit;
|
||||
public static procedure &Partial := exit;
|
||||
public static procedure &Lock := exit;
|
||||
public static procedure &Implicit := exit;
|
||||
public static procedure &Explicit := exit;
|
||||
public static procedure &On := exit;
|
||||
public static procedure &Overload := exit;
|
||||
public static procedure &Reintroduce := exit;
|
||||
public static procedure &Override := exit;
|
||||
public static procedure &Extensionmethod := exit;
|
||||
public static procedure &Virtual := exit;
|
||||
public static procedure &Forward := exit;
|
||||
public static procedure &Loop := exit;
|
||||
end;
|
||||
|
||||
begin
|
||||
T.Abstract(); //Program2.pas(20) : Встречено 'Abstract', а ожидался оператор
|
||||
T.Partial(); //Program2.pas(22) : Встречено 'Partial', а ожидался оператор
|
||||
T.Lock(); //Program2.pas(23) : Встречено 'Lock', а ожидался оператор
|
||||
T.Implicit(); //Program2.pas(24) : Встречено 'Implicit', а ожидался оператор
|
||||
T.Explicit(); //Program2.pas(25) : Встречено 'Explicit', а ожидался оператор
|
||||
T.On(); //Program2.pas(26) : Встречено 'On', а ожидался оператор
|
||||
T.Overload(); //Program2.pas(27) : Встречено 'Overload', а ожидался оператор
|
||||
T.Reintroduce(); //Program2.pas(28) : Встречено 'Reintroduce', а ожидался оператор
|
||||
T.Override(); //Program2.pas(29) : Встречено 'Override', а ожидался оператор
|
||||
T.Extensionmethod(); //Program2.pas(30) : Встречено 'Extensionmethod', а ожидался оператор
|
||||
T.Virtual(); //Program2.pas(31) : Встречено 'Virtual', а ожидался оператор
|
||||
T.Forward(); //Program2.pas(32) : Встречено 'Forward', а ожидался оператор
|
||||
T.Loop(); //Program2.pas(33) : Встречено 'Loop', а ожидался оператор
|
||||
end.
|
||||
Loading…
Reference in a new issue