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 --- chapter06/src/main/java/com/seaofnodes/simple/Parser.java | 3 +-- chapter06/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'chapter06/src') 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.*; -- cgit v1.2.3