From 73c00ab4eaab4545dbfef2e19081ad2fa2ac4086 Mon Sep 17 00:00:00 2001 From: Nocturn9x Date: Sat, 23 Oct 2021 12:00:26 +0200 Subject: [PATCH] Added missing '?' grammar rule for import statements --- docs/grammar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/grammar.md b/docs/grammar.md index 115e84f..cb4ef29 100644 --- a/docs/grammar.md +++ b/docs/grammar.md @@ -86,7 +86,7 @@ statement → exprStmt | forStmt | ifStmt | returnStmt| whileStmt| blockStm exprStmt → expression ";"; // Any expression followed by a semicolon is technically a statement returnStmt → "return" expression? ";"; // Returns from a function, illegal in top-level code breakStmt → "break" ";"; -importStmt -> ("from" IDENTIFIER)? "import" (IDENTIFIER ("as" IDENTIFIER)? ",")+ ";"; +importStmt -> ("from" IDENTIFIER)? "import" (IDENTIFIER ("as" IDENTIFIER)? ","?)+ ";"; assertStmt → "assert" expression ";"; delStmt → "del" expression ";" continueStmt → "continue" ";";