summaryrefslogtreecommitdiff
path: root/chapter06/src/test/java
diff options
context:
space:
mode:
authorDibyendu Majumdar <dibyendumajumdar@users.noreply.github.com>2023-12-07 09:26:54 +0000
committerGitHub <noreply@github.com>2023-12-07 09:26:54 +0000
commit499906b94893cb808df96810d46441857ae432d4 (patch)
treebad8c25c95ca59065f04bf24a9791962b51af017 /chapter06/src/test/java
parent6415e3ae9013e3a9ae0437553ea0c3702381469b (diff)
downloadSimple-499906b94893cb808df96810d46441857ae432d4.tar.gz
Simple-499906b94893cb808df96810d46441857ae432d4.zip
Backport some of the code refactoring to previous chapters (#50)
* #44 Revise docs and comments * #44 Add starting scope to xScopes * #44 back some of the code refactoring port to previous chapters * #44 add_def should not be public * #44 add_def should not be public. Rename method names so that they are camelcase
Diffstat (limited to 'chapter06/src/test/java')
-rw-r--r--chapter06/src/test/java/com/seaofnodes/simple/Chapter06Test.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/chapter06/src/test/java/com/seaofnodes/simple/Chapter06Test.java b/chapter06/src/test/java/com/seaofnodes/simple/Chapter06Test.java
index 7767b203..d0e55cc7 100644
--- a/chapter06/src/test/java/com/seaofnodes/simple/Chapter06Test.java
+++ b/chapter06/src/test/java/com/seaofnodes/simple/Chapter06Test.java
@@ -624,8 +624,8 @@ return a;""");
@Test
public void testVarScopeNoPeephole() {
- Node._disablePeephole = true;
Parser parser = new Parser("int a=1; int b=2; int c=0; { int b=3; c=a+b; #showGraph; } return c; #showGraph;");
+ Node._disablePeephole = true;
StopNode ret = parser.parse();
Node._disablePeephole = false;
assertEquals("return (1+3);", ret.print());
@@ -650,8 +650,8 @@ return a;""");
@Test
public void testChapter2ParseGrammar() {
- Node._disablePeephole = true; // disable peephole so we can observe full graph
Parser parser = new Parser("return 1+2*3+-5;");
+ Node._disablePeephole = true; // disable peephole so we can observe full graph
StopNode ret = parser.parse();
assertEquals("return (1+((2*3)+(-5)));", ret.print());
GraphVisualizer gv = new GraphVisualizer();