From 769df8717c594c4a24acde6034f3bcd75aaafdf4 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 8 Sep 2015 19:21:52 +0200 Subject: Fix bf.prn to work with scopes --- bf.prn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bf.prn b/bf.prn index 19d1368..59e9727 100644 --- a/bf.prn +++ b/bf.prn @@ -49,18 +49,18 @@ dup 0 > while @defun "execute" { #"start of 'execute': " print stackdump - depth 1 + "depth" store + depth 1 + "depth" gstore #"trying to execute " print dup print lf - "code" depth + store + "code" store 0 "i" store i len < while #"i = " print i print lf - "code" depth + dup swapoutvar + "code" swapoutvar i stridx "c" store - swap store #uses the dupped name before the matching swapoutvar + "code" store #"c = " c + print stackdump c "#" = if stackdump end @@ -89,14 +89,14 @@ dup 0 > while 0 "didloop" depth + store dup while 1 "didloop" depth + store - "code" depth + swapoutvar i 1 + len substr swap "code" depth + store execute + "code" swapoutvar i 1 + len substr swap "code" store execute #stackdump "i = " print i print lf "loopstart" depth + get "i" store dup end "didloop" depth + get ! if 1 "searchdepth" store i 1 + "i" store - "code" depth + dup swapoutvar + "code" dup swapoutvar i len < searchdepth 0 > * while i stridx "c" store #"Searching index " print i print " (char " print c print ")" print lf @@ -120,7 +120,7 @@ dup 0 > while i 1 + "i" store i len < end - depth 1 - "depth" store + depth 1 - "depth" gstore } 0 "depth" store -- cgit v1.2.3-70-g09d2