From cd84f8a187b680acf968728227c137276a797e46 Mon Sep 17 00:00:00 2001 From: nocturn9x Date: Sat, 21 Aug 2021 15:05:14 +0200 Subject: [PATCH] Updated grammar with nee assert keyword --- docs/grammar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/grammar.md b/docs/grammar.md index a0edce4..13ec758 100644 --- a/docs/grammar.md +++ b/docs/grammar.md @@ -85,6 +85,7 @@ forStmt → "for" "(" ( varDecl | exprStmt | ";" ) expression? ";" expres ifStmt → "if" "(" expression ")" statement ( "else" statement )?; // If statements are conditional jumps returnStmt → "return" expression? ";"; // Returns from a function, illegal in top-level code breakStmt → "break" ";"; +assertStmt → "assert" expression ";" continueStmt → "continue" ";"; 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