diff options
| author | Thalia Archibald <thalia@archibald.dev> | 2024-07-01 08:42:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-01 08:42:23 -0700 |
| commit | d6442ce5d00b9bea52d366ff4d6ae8c03b84aabb (patch) | |
| tree | f74a567beac80bbe4c7dfb8cecac853d7ba6ec80 /chapter06 | |
| parent | 383a1b7c38d444ea8a1b8643b0be2608a6f8e84d (diff) | |
| download | Simple-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 'chapter06')
| -rw-r--r-- | chapter06/src/main/java/com/seaofnodes/simple/Parser.java | 3 | ||||
| -rw-r--r-- | chapter06/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 2 |
2 files changed, 1 insertions, 4 deletions
diff --git a/chapter06/src/main/java/com/seaofnodes/simple/Parser.java b/chapter06/src/main/java/com/seaofnodes/simple/Parser.java index 83eaa099..5a844f0e 100644 --- a/chapter06/src/main/java/com/seaofnodes/simple/Parser.java +++ b/chapter06/src/main/java/com/seaofnodes/simple/Parser.java @@ -513,9 +513,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/chapter06/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter06/src/test/java/com/seaofnodes/simple/Chapter05Test.java index fa576700..b5fcbeaf 100644 --- a/chapter06/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter06/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -2,9 +2,7 @@ package com.seaofnodes.simple; import com.seaofnodes.simple.node.*; import com.seaofnodes.simple.type.TypeInteger; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import static org.junit.Assert.*; |
