From 2f2d18567f31f5d2de2668bf26e9b81809ba2a1d Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 27 Apr 2025 14:51:23 -0700 Subject: Mid hack --- chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java | 1 - chapter22/src/test/java/com/seaofnodes/simple/Eval2.java | 3 ++- .../src/test/java/com/seaofnodes/simple/fuzzer/ScriptGenerator.java | 2 +- chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp (limited to 'chapter22/src/test') diff --git a/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java b/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java index 106932f5..dccf00bc 100644 --- a/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java +++ b/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java @@ -28,7 +28,6 @@ public class Chapter22Test { assertEquals(stop, code._stop.toString()); } - @Test public void testCoRecur() { String src = """ diff --git a/chapter22/src/test/java/com/seaofnodes/simple/Eval2.java b/chapter22/src/test/java/com/seaofnodes/simple/Eval2.java index ecea97dd..38da6898 100644 --- a/chapter22/src/test/java/com/seaofnodes/simple/Eval2.java +++ b/chapter22/src/test/java/com/seaofnodes/simple/Eval2.java @@ -407,7 +407,8 @@ public abstract class Eval2 { // Since never can close the type cycle, without cyclic types, have // to handle FRefs even here if( tmp.isFRef() ) - tmp = tmp.makeFrom(((TypeMemPtr)Parser.TYPES.get(tmp._obj._name))._obj); + //tmp = tmp.makeFrom(((TypeMemPtr)Parser.TYPES.get(tmp._obj._name))._obj); + throw Utils.TODO(); Object[] xs = (Object[])x; // Array of fields if( tmp._obj.isAry() ) { diff --git a/chapter22/src/test/java/com/seaofnodes/simple/fuzzer/ScriptGenerator.java b/chapter22/src/test/java/com/seaofnodes/simple/fuzzer/ScriptGenerator.java index f119fa1a..c9f7d801 100644 --- a/chapter22/src/test/java/com/seaofnodes/simple/fuzzer/ScriptGenerator.java +++ b/chapter22/src/test/java/com/seaofnodes/simple/fuzzer/ScriptGenerator.java @@ -97,7 +97,7 @@ public class ScriptGenerator { private static final List INTTYPES = new ArrayList<>(); static { - for( var e : Parser.defaultTypes().entrySet() ) { + for( var e : Parser.PRIMS.entrySet() ) { if( e.getValue() instanceof TypeInteger ) { INTTYPES.add(new TypeInt(e.getKey())); } diff --git a/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp b/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp new file mode 100644 index 00000000..0234aa73 --- /dev/null +++ b/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp @@ -0,0 +1,2 @@ +// -*- mode: java; -*- +sys.libc.write(1,"Hello, World!\n",14); -- cgit v1.2.3