X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=blobdiff_plain;f=src%2Fforth.jl;h=3305d5e9e46104854b9b36ffdf553f3e898eca58;hp=940e6f3fcd9c08faa72b6e9ddb40d178c04b583b;hb=fca502cc9896f8289b80f20d515f2adbf88ce6a0;hpb=3546a8908320d9fafc9d3b054d573bd7bece8670 diff --git a/src/forth.jl b/src/forth.jl index 940e6f3..3305d5e 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -812,6 +812,11 @@ PARSE = defPrimWord("PARSE", () -> begin return NEXT end) +BYE = defPrimWord("BYE", () -> begin + println("Bye!") + return 0 +end) + STATE, STATE_CFA = defNewVar("STATE", 0) INTERPRET = defWord("INTERPRET", @@ -834,7 +839,7 @@ INTERPRET = defWord("INTERPRET", COMMA, BRANCH, -36, # No word found, parse number - BTICK, LIT, COMMA, TRACE, NUMBER, COMMA, BRANCH, -44, + NUMBER, BTICK, LIT, COMMA, COMMA, TRACE, BRANCH, -44, # Interpreting DUP, FIND, QDUP, ZBRANCH, 7, @@ -861,11 +866,6 @@ QUIT = defWord("QUIT", INTERPRET, PROMPT, BRANCH,-4]) -BYE = defPrimWord("BYE", () -> begin - println("Bye!") - return 0 -end) - INCLUDE = defPrimWord("INCLUDE", () -> begin pushPS(32) callPrim(mem[WORD])