Skip to content

Commit 9487090

Browse files
committed
Simpler fix
1 parent b67dad0 commit 9487090

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

build.zig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ pub fn build(b: *std.Build) !void {
6767
std.fs.path.basename(sub_path),
6868
);
6969
emcc_step.dependOn(&file.step);
70-
if (comptime std.mem.eql(u8, sub_path, "jonesforth/jonesforth.f")) {
71-
const patch = b.addSystemCommand(&.{
72-
"patch",
73-
b.getInstallPath(file.dir, file.dest_rel_path),
74-
});
75-
patch.addFileArg(b.path("src/jonesforth.f.patch"));
76-
emcc_step.dependOn(&patch.step);
77-
}
7870
}
7971
b.getInstallStep().dependOn(emcc_step);
8072

src/jonesforth.f.patch

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/zorth.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ fn _interpret(self: *Interp, sp: [*]isize, rsp: [*][*]const Instr, ip: [*]const
849849
}
850850
} else if (fmt.parseInt(isize, self.buffer[0..c], @truncate(@abs(self.base)))) |a| {
851851
if (self.state == 1) {
852-
self.append(.{ .word = codeFieldAddress(&lit) });
852+
self.append(.{ .word = &.{.{ .code = _lit }} });
853853
self.append(.{ .literal = a });
854854
} else {
855855
s = sp - 1;
@@ -1093,7 +1093,7 @@ test forth {
10931093
\\: OF IMMEDIATE ' OVER , ' = , [COMPILE] IF ' DROP , ;
10941094
\\: ENDOF IMMEDIATE [COMPILE] ELSE ;
10951095
\\: ENDCASE IMMEDIATE ' DROP , BEGIN ?DUP WHILE [COMPILE] THEN REPEAT ;
1096-
\\: CFA> LATEST @ BEGIN ?DUP WHILE 2DUP >CFA = IF NIP EXIT THEN @ REPEAT DROP 0 ;
1096+
\\: CFA> LATEST @ BEGIN ?DUP WHILE 2DUP SWAP < IF NIP EXIT THEN @ REPEAT DROP 0 ;
10971097
\\: SEE WORD FIND HERE @ LATEST @ BEGIN 2 PICK OVER <> WHILE NIP DUP @ REPEAT DROP SWAP
10981098
\\ ':' EMIT SPACE DUP ID. SPACE DUP ?IMMEDIATE IF ." IMMEDIATE " THEN >DFA
10991099
\\ BEGIN 2DUP > WHILE DUP @

0 commit comments

Comments
 (0)