compute block added

This commit is contained in:
Jordi Baylina
2019-08-29 16:26:19 +02:00
parent 597deb1eaa
commit f05c4e1338
7 changed files with 229 additions and 168 deletions

View File

@@ -40,6 +40,7 @@ if { return 'if'; }
else { return 'else'; }
for { return 'for'; }
while { return 'while'; }
compute { return 'compute'; }
do { return 'do'; }
return { return 'return'; }
include { return 'include'; }
@@ -198,6 +199,10 @@ statment
{
$$ = $1;
}
| computeStatment
{
$$ = $1;
}
| returnStatment
{
$$ = $1;
@@ -302,6 +307,14 @@ doWhileStatment
}
;
computeStatment
: 'compute' statment
{
$$ = { type: "COMPUTE", body: $2 };
setLines($$, @1, @2);
}
;
returnStatment
: 'return' expression ';'
{

File diff suppressed because one or more lines are too long