Commit 4bfb9d0e authored by pazsan's avatar pazsan

Changed string compilation to not use the return stack to skipp the string

added control-rack property to specify if the return stack does point to
control-relevant information
parent 96786df5
......@@ -1175,6 +1175,7 @@ false DefaultValue backtrace
false DefaultValue new-input
false DefaultValue peephole
false DefaultValue abranch
true DefaultValue control-rack
[THEN]
true DefaultValue interpreter
......@@ -1703,7 +1704,7 @@ Ghost (loop) Ghost (+loop) 2drop
Ghost (next) drop
Ghost (does>) Ghost (compile) 2drop
Ghost (.") Ghost (S") Ghost (ABORT") 2drop drop
Ghost (C") drop
Ghost (C") Ghost c(abort") Ghost type 2drop drop
Ghost ' drop
\ user ghosts
......@@ -1732,7 +1733,9 @@ Ghost state drop
: ht-string, ( addr count -- )
dup there swap last-string 2!
dup T c, H bounds ?DO I c@ T c, H LOOP ;
dup T c, H bounds ?DO I c@ T c, H LOOP ;
: ht-mem, ( addr count )
bounds ?DO I c@ T c, H LOOP ;
>TARGET
......@@ -3167,10 +3170,21 @@ Ghost a(loop) drop
: ," [char] " parse ht-string, X align ;
X has? control-rack [IF]
Cond: ." compile (.") T ," H ;Cond
Cond: S" compile (S") T ," H ;Cond
Cond: C" compile (C") T ," H ;Cond
Cond: ABORT" compile (ABORT") T ," H ;Cond
[ELSE]
Cond: ." '" parse tuck 2>r ahead, there 2r> ht-mem, X align
>r then, r> compile ALiteral compile Literal compile type ;Cond
Cond: S" '" parse tuck 2>r ahead, there 2r> ht-mem, X align
>r then, r> compile ALiteral compile Literal ;Cond
Cond: C" ahead, there [char] " parse ht-string, X align
>r then, r> compile ALiteral ;Cond
Cond: ABORT" if, ahead, there [char] " parse ht-string, X align
>r then, r> compile ALiteral compile c(abort") then, ;Cond
[THEN]
Cond: IS T ' >body H compile ALiteral compile ! ;Cond
: IS T >address ' >body ! H ;
......
......@@ -70,8 +70,7 @@ interpret/compile: S" ( compilation 'ccc"' -- ; run-time -- c-addr u ) \ core,fi
[THEN]
:noname [char] " parse type ;
:noname postpone (.") ," align ;
\ :noname postpone s" postpone type ;
:noname [char] " parse postpone sLiteral postpone type ;
interpret/compile: ." ( compilation 'ccc"' -- ; run-time -- ) \ core dot-quote
\G Compilation: Parse a string @i{ccc} delimited by a " (double
\G quote). At run-time, display the string. Interpretation semantics
......
......@@ -50,6 +50,8 @@ true DefaultValue peephole \ enables peephole optimizer
true DefaultValue abranch \ enables absolute branches
false DefaultValue control-rack \ disable return stack use for control flow
false DefaultValue ec
false DefaultValue crlf
......
......@@ -50,6 +50,8 @@ true DefaultValue new-input \ enables object oriented input
true DefaultValue abranch \ enables absolute branches
false DefaultValue control-rack \ disable return stack use for control flow
false DefaultValue ec
false DefaultValue crlf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment