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:
cfc515d
)
Abort now resets the input stream.
author
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 12 Jun 2016 00:16:33 +0000
(12:16 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 12 Jun 2016 00:16:33 +0000
(12:16 +1200)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
f10ea04
..
609897a
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-585,6
+585,14
@@
end)
sources = Array{Any,1}()
currentSource() = sources[length(sources)]
sources = Array{Any,1}()
currentSource() = sources[length(sources)]
+CLOSEFILES_CFA = defPrimWord("CLOSEFILES", () -> begin
+ while currentSource() != STDIN
+ close(pop!(sources))
+ end
+
+ return NEXT
+end)
+
EOF_CFA = defPrimWord("\x04", () -> begin
if currentSource() != STDIN
close(pop!(sources))
EOF_CFA = defPrimWord("\x04", () -> begin
if currentSource() != STDIN
close(pop!(sources))
@@
-1031,7
+1039,7
@@
QUIT_CFA = defWord("QUIT",
BRANCH_CFA,-4])
ABORT_CFA = defWord("ABORT",
BRANCH_CFA,-4])
ABORT_CFA = defWord("ABORT",
- [PSP0_CFA, PSPSTORE_CFA, QUIT_CFA])
+ [
CLOSEFILES_CFA,
PSP0_CFA, PSPSTORE_CFA, QUIT_CFA])
BYE_CFA = defPrimWord("BYE", () -> begin
println("\nBye!")
BYE_CFA = defPrimWord("BYE", () -> begin
println("\nBye!")