Updated grammar with nee assert keyword
This commit is contained in:
parent
aeaaff2555
commit
cd84f8a187
|
@ -85,6 +85,7 @@ forStmt → "for" "(" ( varDecl | exprStmt | ";" ) expression? ";" expres
|
||||||
ifStmt → "if" "(" expression ")" statement ( "else" statement )?; // If statements are conditional jumps
|
ifStmt → "if" "(" expression ")" statement ( "else" statement )?; // If statements are conditional jumps
|
||||||
returnStmt → "return" expression? ";"; // Returns from a function, illegal in top-level code
|
returnStmt → "return" expression? ";"; // Returns from a function, illegal in top-level code
|
||||||
breakStmt → "break" ";";
|
breakStmt → "break" ";";
|
||||||
|
assertStmt → "assert" expression ";"
|
||||||
continueStmt → "continue" ";";
|
continueStmt → "continue" ";";
|
||||||
whileStmt → "while" "(" expression ")" statement; // While loops run until their condition is truthy
|
whileStmt → "while" "(" expression ")" statement; // While loops run until their condition is truthy
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue