From 4a425c35b81b144006907361fe55f2b3390e5d7c Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 29 Oct 2023 09:52:59 -0700 Subject: Fix broken error report --- .../src/test/java/com/seaofnodes/simple/Chapter05Test.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'chapter05/src/test/java/com') diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java index 32ac5aac..2ad7e59a 100644 --- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -115,7 +115,16 @@ return c; assertEquals("Expected an identifier, found 'else'",e.getMessage()); } } - + + @Test + public void testChapter5Keyword3() { + try { + new Parser("int a=1; ififif(arg)inta=2;return a;").parse(); + fail(); + } catch( RuntimeException e ) { + assertEquals("Syntax error, expected =: (",e.getMessage()); + } + } @Test public void testChapter4Peephole() { Parser parser = new Parser("return 1+arg+2; #showGraph;"); -- cgit v1.2.3