From d6442ce5d00b9bea52d366ff4d6ae8c03b84aabb Mon Sep 17 00:00:00 2001 From: Thalia Archibald Date: Mon, 1 Jul 2024 08:42:23 -0700 Subject: 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 --- chapter09/src/main/java/com/seaofnodes/simple/Parser.java | 3 +-- chapter09/src/test/java/com/seaofnodes/simple/Chapter08Test.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'chapter09/src') diff --git a/chapter09/src/main/java/com/seaofnodes/simple/Parser.java b/chapter09/src/main/java/com/seaofnodes/simple/Parser.java index c4ce71eb..1827bae2 100644 --- a/chapter09/src/main/java/com/seaofnodes/simple/Parser.java +++ b/chapter09/src/main/java/com/seaofnodes/simple/Parser.java @@ -651,9 +651,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() { diff --git a/chapter09/src/test/java/com/seaofnodes/simple/Chapter08Test.java b/chapter09/src/test/java/com/seaofnodes/simple/Chapter08Test.java index 05485d8c..d78d5358 100644 --- a/chapter09/src/test/java/com/seaofnodes/simple/Chapter08Test.java +++ b/chapter09/src/test/java/com/seaofnodes/simple/Chapter08Test.java @@ -4,7 +4,6 @@ import com.seaofnodes.simple.node.*; import com.seaofnodes.simple.type.TypeInteger; import org.junit.Assert; import org.junit.Test; -import org.junit.Ignore; import static org.junit.Assert.*; -- cgit v1.2.3