Add keywords to parser

This commit is contained in:
Alexander Zakharenko 2018-05-12 18:10:37 +03:00
parent 5bed9fa995
commit 8be0622eeb
4 changed files with 1486 additions and 1435 deletions

View file

@ -2,7 +2,7 @@
// This CSharp output file generated by Gardens Point LEX
// Version: 1.1.3.301
// Machine: ALEXANDER-PC
// DateTime: 11.05.2018 18:06:46
// DateTime: 12.05.2018 15:47:47
// UserName: Alexander
// GPLEX input file <ABCPascal.lex>
// GPLEX frame file <embedded resource>

View file

@ -3716,6 +3716,10 @@ keyword
{ $$ = $1; }
| tkYield
{ $$ = $1; }
| tkMatch
{ $$ = $1; }
| tkWhen
{ $$ = $1; }
;
reserved_keyword

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,37 @@
// Source
match x with
My(string(s), integer(t)) when s = 'asd':
end
// Desugared code (match, 1st stage)
var <>matchDone := false;
var <>genVarExpr := x;
if not matchDone and <>genVarExpr is My(string(s), integer(t)) then
begin
if s = 'asd' then
begin
<>match1Done := true;
<ACTION>
end;
end;
// Desugared code (is, 2nd stage)
var <>matchDone := false;
var <>genVarExpr := x;
var <>genVar1: My;
if IsTest(<>genVarExpr, <>genVar1) then
var s: string;
var t: integer;
if <>genVarExpr is My(string(s), integer(t)) then
begin
if s = 'asd' then
begin
<>match1Done := true;
<ACTION>
end;
end;