diff options
| author | dibyendumajumdar <mobile@majumdar.org.uk> | 2023-11-01 09:28:40 +0000 |
|---|---|---|
| committer | Dibyendu Majumdar <dibyendumajumdar@users.noreply.github.com> | 2023-11-01 18:56:50 +0000 |
| commit | d9f18bd107bacf12d5fc96200eb7b095e6116968 (patch) | |
| tree | e62b37124f30e0245e1ed121460b6d675b4d67f2 /chapter05/src/main/java | |
| parent | 43f2a09f106072727eaceb6134be02c03429b425 (diff) | |
| download | Simple-d9f18bd107bacf12d5fc96200eb7b095e6116968.tar.gz Simple-d9f18bd107bacf12d5fc96200eb7b095e6116968.zip | |
Revert "Report unclosed block in parsing (#28)"
This reverts commit e3c412bbbdd6f6eefe2ac889f6d59aeaef71beb1.
Diffstat (limited to 'chapter05/src/main/java')
| -rw-r--r-- | chapter05/src/main/java/com/seaofnodes/simple/Parser.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/chapter05/src/main/java/com/seaofnodes/simple/Parser.java b/chapter05/src/main/java/com/seaofnodes/simple/Parser.java index a287f997..79b50672 100644 --- a/chapter05/src/main/java/com/seaofnodes/simple/Parser.java +++ b/chapter05/src/main/java/com/seaofnodes/simple/Parser.java @@ -115,9 +115,7 @@ public class Parser { // Enter a new scope _scope.push(); Node n = null; - while (!match("}")) { - if (_lexer.isEOF()) throw errorSyntax("}"); - + while (!match("}") && !_lexer.isEOF()) { Node n0 = parseStatement(); if (n0 != null) n = n0; // Allow null returns from eg showGraph } |
