Added differentiation between yield statement and yield expressions and added missing semicolon to delStmt
This commit is contained in:
parent
7dc9ea17d5
commit
118b8e5ffc
|
@ -88,7 +88,8 @@ returnStmt → "return" expression? ";"; // Returns from a function, illega
|
||||||
breakStmt → "break" ";";
|
breakStmt → "break" ";";
|
||||||
importStmt -> ("from" IDENTIFIER)? "import" (IDENTIFIER ("as" IDENTIFIER)? ","?)+ ";";
|
importStmt -> ("from" IDENTIFIER)? "import" (IDENTIFIER ("as" IDENTIFIER)? ","?)+ ";";
|
||||||
assertStmt → "assert" expression ";";
|
assertStmt → "assert" expression ";";
|
||||||
delStmt → "del" expression ";"
|
delStmt → "del" expression ";";
|
||||||
|
yieldStmt → "yield" expression ";";
|
||||||
continueStmt → "continue" ";";
|
continueStmt → "continue" ";";
|
||||||
blockStmt → "{" declaration* "}"; // Blocks create a new scope that lasts until they're closed
|
blockStmt → "{" declaration* "}"; // Blocks create a new scope that lasts until they're closed
|
||||||
ifStmt → "if" "(" expression ")" statement ("else" statement)?; // If statements are conditional jumps
|
ifStmt → "if" "(" expression ")" statement ("else" statement)?; // If statements are conditional jumps
|
||||||
|
@ -100,7 +101,7 @@ foreachStmt → "foreach" "(" (IDENTIFIER ":" expression) ")" statement;
|
||||||
// Expressions (rules that produce a value, but also have side effects)
|
// Expressions (rules that produce a value, but also have side effects)
|
||||||
expression → assignment;
|
expression → assignment;
|
||||||
assignment → (call ".")? IDENTIFIER "=" yield; // Assignment is the highest-level expression
|
assignment → (call ".")? IDENTIFIER "=" yield; // Assignment is the highest-level expression
|
||||||
yield → "yield" expression;
|
yield → "(" "yield" expression ")";
|
||||||
logic_or → logic_and ("and" logic_and)*;
|
logic_or → logic_and ("and" logic_and)*;
|
||||||
logic_and → equality ("or" equality)*;
|
logic_and → equality ("or" equality)*;
|
||||||
equality → comparison (( "!=" | "==" ) comparison )*;
|
equality → comparison (( "!=" | "==" ) comparison )*;
|
||||||
|
|
Loading…
Reference in New Issue