From: Tim Vaughan Date: Mon, 10 Oct 2016 01:15:51 +0000 (+1300) Subject: INCLUDE now reads lib.4th up to first nested INCLUDE. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=401ed885668f77b6182ca6b34ff03d291984ce29;p=forth.jl.git INCLUDE now reads lib.4th up to first nested INCLUDE. --- diff --git a/src/forth.jl b/src/forth.jl index c2019d4..6db24ea 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -970,10 +970,12 @@ NUMFIB, NUMFIB_CFA = defNewVar("#FIB", 0) IB_CFA = defPrimWord("IB", () -> begin pushPS(mem[SOURCE_ID] == 0 ? TIB : FIB) + return NEXT end) NUMIB_CFA = defPrimWord("#IB", () -> begin pushPS(mem[SOURCE_ID] == 0 ? NUMTIB : NUMFIB) + return NEXT end) TOIN, TOIN_CFA = defNewVar(">IN", 0) @@ -1003,6 +1005,7 @@ QUERY_FILE_CFA = defWord("QUERY-FILE", [FIB_CFA, LIT_CFA, 160, ROT_CFA, READ_LINE_CFA, DROP_CFA, SWAP_CFA, NUMFIB_CFA, STORE_CFA, + LIT_CFA, 0, TOIN_CFA, STORE_CFA, EXIT_CFA]) WORD_CFA = defPrimWord("WORD", () -> begin @@ -1038,7 +1041,7 @@ WORD_CFA = defPrimWord("WORD", () -> begin mem[countAddr] = count pushPS(countAddr) - #println("Processing word: '$(getString(countAddr+1,mem[countAddr]))'") + println("Processing word: '$(getString(countAddr+1,mem[countAddr]))' (state $(mem[STATE]))") return NEXT end)