diff options
Diffstat (limited to 'sanctuary.fs')
| -rw-r--r-- | sanctuary.fs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sanctuary.fs b/sanctuary.fs index 0922cbc..e555055 100644 --- a/sanctuary.fs +++ b/sanctuary.fs @@ -215,7 +215,7 @@ init-source value source-id : ." postpone s" postpone type ; immediate compile-only \ " : e." postpone s" postpone warn ; immediate compile-only \ " -: (abort") ( ? a u -- ) rot 0<> if warn abort else 2drop then ; +: (abort") ( a u -- ) warn abort ; : abort" postpone s" postpone (abort") ; immediate compile-only \ ERROR MESSAGES {{{ @@ -324,6 +324,14 @@ privatise : evaluate ( a u -- ) tib @ >r #tib @ >r >in @ >r (evaluate) r> >in ! r> #tib ! r> tib ! ; + +: ?include-depth include-depth #buffers >= if + 0 to include-depth abort" too many input buffers" then ; +: include-file ( fd -- ) source-id >r ( fd ) dup to source-id + 1 +to include-depth ?include-depth + 0 cbuffer-used ! 0 cbuffer->in ! ( fd ) cbuffer-fd ! + begin refill while interpret repeat + 1 -to include-depth r> to source-id ; \ }}} \ \ VOCABULARY {{{ |
