summaryrefslogtreecommitdiff
path: root/chapter05/src/main/java/com/seaofnodes
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2024-07-01 08:42:23 -0700
committerGitHub <noreply@github.com>2024-07-01 08:42:23 -0700
commitd6442ce5d00b9bea52d366ff4d6ae8c03b84aabb (patch)
treef74a567beac80bbe4c7dfb8cecac853d7ba6ec80 /chapter05/src/main/java/com/seaofnodes
parent383a1b7c38d444ea8a1b8643b0be2608a6f8e84d (diff)
downloadSimple-d6442ce5d00b9bea52d366ff4d6ae8c03b84aabb.tar.gz
Simple-d6442ce5d00b9bea52d366ff4d6ae8c03b84aabb.zip
Fix grammar and forward-port minor changes (#91)
* Backport test exception handling to chapter 1 * Add unary ! to chapter 10 and 11 grammars * Lex { } ! as punctuation * Forward-port format whitespace * Forward-port test organization * Forward-port replace build-graphs.sh with Makefile * Add chapter title to chapter 11
Diffstat (limited to 'chapter05/src/main/java/com/seaofnodes')
-rw-r--r--chapter05/src/main/java/com/seaofnodes/simple/Parser.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/chapter05/src/main/java/com/seaofnodes/simple/Parser.java b/chapter05/src/main/java/com/seaofnodes/simple/Parser.java
index 8a02766f..0fd52788 100644
--- a/chapter05/src/main/java/com/seaofnodes/simple/Parser.java
+++ b/chapter05/src/main/java/com/seaofnodes/simple/Parser.java
@@ -512,9 +512,8 @@ public class Parser {
return new String(_input, start, --_position - start);
}
- //
private boolean isPunctuation(char ch) {
- return "=;[]<>()+-/*".indexOf(ch) != -1;
+ return "=;[]<>(){}+-/*!".indexOf(ch) != -1;
}
private String parsePunctuation() {