summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-09-08 19:21:52 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-09-08 19:36:44 +0200
commit769df8717c594c4a24acde6034f3bcd75aaafdf4 (patch)
tree271f0f867529e3c7cd8f5621d269da8d6496dc62
parent03deaf70dde4181373c2c3c44e8bbb0ba6718b41 (diff)
Fix bf.prn to work with scopes
-rw-r--r--bf.prn14
1 files 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