summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs9
1 files changed, 7 insertions, 2 deletions
diff --git a/jefs.fs b/jefs.fs
index 18ea7e1..e80b1d7 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -3,6 +3,7 @@
\ :noname
\ DO LOOP
\ s\"
+\ add error handling to compiling words
\ <builds does>
\ argc/argv
\ file io
@@ -64,6 +65,10 @@ hex : ret, c3 c, ; decimal
: endcase ' drop compile, begin ?dup while [compile] then repeat ; immediate
\ }}}
+: value create [compile] lit ret, ;
+: to parse find drop >cfa 6 + state @ if
+ [compile] lit ' ! compile, else ! then ; immediate
+
\ TODO interpret mode strings?
: s" 1 >in +! [ char " ] literal cparse branch >mark >r 2dup cmove, nip r> dup >resolve 4 + [compile] lit [compile] lit ; immediate
: ." [compile] s" ' say compile, ; immediate \ lol this word breaks the highlighting, here have another "
@@ -202,7 +207,7 @@ variable hld
2 of ." word not found" endof
." unknown error"
endcase cr fuck ;
-: _ ' (handler) handler ! ; _ \ i should do immediate ' at some point
+: _ ' (handler) to handler ; _ \ i should do immediate ' at some point
: >ffa ( lfa -- ffa ) 8 + ;
: >nfa ( lfa -- nfa ) 9 + ;
@@ -250,7 +255,7 @@ make file-buffer file-buffer-length allot
: open-file ( mode zstr -- ?fd flag ) 0 -rot sysopen errno ;
: close-file ( fd -- flag ) sysclose errno-flag ;
: read-file ( c-addr u fd -- ?u flag ) >r swap r> sysread errno ;
-: write-file ( c-addr u fd -- ?u flag ) >r swap r> syswrite errno ;
+: write-file ( c-addr u fd -- ?u flag ) >r swap r> syswrite errno ;
\ }}}
.free bye