From c9f3e788acaa7dc7ecb338c3ce905186d81b4f94 Mon Sep 17 00:00:00 2001 From: Calamity210 Date: Sun, 6 Sep 2020 21:57:31 -0400 Subject: [PATCH] Corrected One Statement Compound's parsing --- examples/control_flow.birb | 7 ++++++- lib/parser/parser.dart | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/control_flow.birb b/examples/control_flow.birb index 1d4f292..e161823 100644 --- a/examples/control_flow.birb +++ b/examples/control_flow.birb @@ -17,4 +17,9 @@ year += 1; } assert(year == 2030); -screm(year); // output 2030 \ No newline at end of file +screm(year); // output 2030 + +if (true) + screm('Single Statement Compound'); // output Single Statement Compound + +screm('just testing'); // output just testing \ No newline at end of file diff --git a/lib/parser/parser.dart b/lib/parser/parser.dart index 707eaf3..8ca5419 100644 --- a/lib/parser/parser.dart +++ b/lib/parser/parser.dart @@ -93,7 +93,6 @@ ASTNode parseOneStatementCompound(Parser parser, Scope scope) { compound.scope = scope; var statement = parseStatement(parser, scope); - eat(parser, TokenType.TOKEN_SEMI); compound.compoundValue.add(statement); return compound;