The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3546a89
)
Compiler working again.
author
Tim Vaughan
<tgvaughan@gmail.com>
Sat, 7 May 2016 08:01:35 +0000
(20:01 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sat, 7 May 2016 08:01:35 +0000
(20:01 +1200)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
940e6f3
..
3305d5e
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-812,6
+812,11
@@
PARSE = defPrimWord("PARSE", () -> begin
return NEXT
end)
return NEXT
end)
+BYE = defPrimWord("BYE", () -> begin
+ println("Bye!")
+ return 0
+end)
+
STATE, STATE_CFA = defNewVar("STATE", 0)
INTERPRET = defWord("INTERPRET",
STATE, STATE_CFA = defNewVar("STATE", 0)
INTERPRET = defWord("INTERPRET",
@@
-834,7
+839,7
@@
INTERPRET = defWord("INTERPRET",
COMMA, BRANCH, -36,
# No word found, parse number
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,
# Interpreting
DUP, FIND, QDUP, ZBRANCH, 7,
@@
-861,11
+866,6
@@
QUIT = defWord("QUIT",
INTERPRET, PROMPT,
BRANCH,-4])
INTERPRET, PROMPT,
BRANCH,-4])
-BYE = defPrimWord("BYE", () -> begin
- println("Bye!")
- return 0
-end)
-
INCLUDE = defPrimWord("INCLUDE", () -> begin
pushPS(32)
callPrim(mem[WORD])
INCLUDE = defPrimWord("INCLUDE", () -> begin
pushPS(32)
callPrim(mem[WORD])