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:
8723639
)
Improved error reporting.
author
Tim Vaughan
<tgvaughan@gmail.com>
Thu, 28 Sep 2017 22:15:24 +0000
(
00:15
+0200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Thu, 28 Sep 2017 22:15:24 +0000
(
00:15
+0200)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
4c81dc3
..
3882a53
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-677,6
+677,10
@@
READ_LINE_CFA = defPrimWord("READ-LINE", () -> begin
maxSize = popPS()
addr = popPS()
+ if !(fid in keys(openFiles))
+ error(string("Invalid FID ", fid, "."))
+ end
+
fh = openFiles[fid]
line = readline(fh, chomp=false)
@@
-1336,6
+1340,7
@@
function run(fileName=nothing; initialize=true)
jmp = callPrim(jmp)
catch ex
+ println(string("Error in primitive '", getPrimName(jmp), "' at address ", jmp))
showerror(STDOUT, ex)
println()