about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-25 18:45:11 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-25 18:45:11 -0700
commita148b23a22709a45647fd07ce95db9147217a061 (patch)
treedb95e96fbb4a1da518f25bcda5cf863b34ecb4a1 /apps
parent8a6ad45d8d26c60b62a2a7ac8d594b3c4d1dbc45 (diff)
downloadmu-a148b23a22709a45647fd07ce95db9147217a061.tar.gz
7101 - tile: remove quotes when evaluating strings
This found several bugs due to me not checking for null strings.
Diffstat (limited to 'apps')
-rwxr-xr-xapps/assortbin46532 -> 46541 bytes
-rwxr-xr-xapps/bracesbin48587 -> 48596 bytes
-rwxr-xr-xapps/callsbin53438 -> 53447 bytes
-rwxr-xr-xapps/crenshaw2-1bin45873 -> 45882 bytes
-rwxr-xr-xapps/crenshaw2-1bbin46420 -> 46429 bytes
-rwxr-xr-xapps/dquotesbin50154 -> 50163 bytes
-rwxr-xr-xapps/factorialbin44976 -> 44985 bytes
-rwxr-xr-xapps/hexbin48712 -> 48721 bytes
-rwxr-xr-xapps/mubin422010 -> 422150 bytes
-rwxr-xr-xapps/packbin59222 -> 59231 bytes
-rwxr-xr-xapps/sigilsbin60956 -> 60965 bytes
-rwxr-xr-xapps/surveybin56464 -> 56473 bytes
-rwxr-xr-xapps/testsbin45323 -> 45332 bytes
-rw-r--r--apps/tile/main.mu7
-rw-r--r--apps/tile/rpn.mu2
-rw-r--r--apps/tile/value-stack.mu2
16 files changed, 4 insertions, 7 deletions
diff --git a/apps/assort b/apps/assort
index b96e8bce..91e7ff23 100755
--- a/apps/assort
+++ b/apps/assort
Binary files differdiff --git a/apps/braces b/apps/braces
index 658a2906..0a07736c 100755
--- a/apps/braces
+++ b/apps/braces
Binary files differdiff --git a/apps/calls b/apps/calls
index ca22ce03..d5637096 100755
--- a/apps/calls
+++ b/apps/calls
Binary files differdiff --git a/apps/crenshaw2-1 b/apps/crenshaw2-1
index 0b69e083..37f7b355 100755
--- a/apps/crenshaw2-1
+++ b/apps/crenshaw2-1
Binary files differdiff --git a/apps/crenshaw2-1b b/apps/crenshaw2-1b
index 587b2655..75639828 100755
--- a/apps/crenshaw2-1b
+++ b/apps/crenshaw2-1b
Binary files differdiff --git a/apps/dquotes b/apps/dquotes
index 71aac388..30d28e67 100755
--- a/apps/dquotes
+++ b/apps/dquotes
Binary files differdiff --git a/apps/factorial b/apps/factorial
index c5676040..ebb0ba62 100755
--- a/apps/factorial
+++ b/apps/factorial
Binary files differdiff --git a/apps/hex b/apps/hex
index 501feb40..198276d7 100755
--- a/apps/hex
+++ b/apps/hex
Binary files differdiff --git a/apps/mu b/apps/mu
index d713a6eb..236b5d2a 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/pack b/apps/pack
index 79c773fb..070d0060 100755
--- a/apps/pack
+++ b/apps/pack
Binary files differdiff --git a/apps/sigils b/apps/sigils
index d464f947..b6220832 100755
--- a/apps/sigils
+++ b/apps/sigils
Binary files differdiff --git a/apps/survey b/apps/survey
index 24a7a699..893eb4f2 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/tests b/apps/tests
index f49cff1a..f43185f8 100755
--- a/apps/tests
+++ b/apps/tests
Binary files differdiff --git a/apps/tile/main.mu b/apps/tile/main.mu
index d4f53535..08e6532b 100644
--- a/apps/tile/main.mu
+++ b/apps/tile/main.mu
@@ -77,12 +77,7 @@ fn test {
   initialize-environment-with-fake-screen env, 5, 0xa
   var g/eax: grapheme <- copy 0x22  # '"'
   process env, g
-  g <- copy 0x31  # '1'
-  process env, g
-  g <- copy 0x20  # space
-  process env, g
-  g <- copy 0x33  # '3'
-  process env, g
+  render env
 }
 
 fn repl {
diff --git a/apps/tile/rpn.mu b/apps/tile/rpn.mu
index 80ab47ae..cf0766b0 100644
--- a/apps/tile/rpn.mu
+++ b/apps/tile/rpn.mu
@@ -109,7 +109,7 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         break-if-!=
         var h: (handle array byte)
         var s/eax: (addr handle array byte) <- address h
-        stream-to-string curr-stream, s  # leak
+        unquote-stream-to-string curr-stream, s  # leak
         push-string-to-value-stack out, *s
         break $evaluate:process-word
       }
diff --git a/apps/tile/value-stack.mu b/apps/tile/value-stack.mu
index aae87c3d..7050442d 100644
--- a/apps/tile/value-stack.mu
+++ b/apps/tile/value-stack.mu
@@ -130,6 +130,8 @@ fn value-stack-max-width _self: (addr value-stack) -> result/eax: int {
       break-if-!=
       var s-ah/eax: (addr handle array byte) <- get g, text-data
       var s/eax: (addr array byte) <- lookup *s-ah
+      compare s, 0
+      break-if-=
       var w/eax: int <- length s
       compare w, out
       break-if-<=