about summary refs log tree commit diff stats
path: root/045closure_name.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-17 00:43:13 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-17 00:43:20 -0700
commit192d59d3bb9ee0baa1afd82cb5d0f352bdc6e403 (patch)
tree56ade9284cbd296ade90601a3a047c5cbdf3428c /045closure_name.cc
parent08f4628e8b858120fe3547d8e5431d9abfe46bf8 (diff)
downloadmu-192d59d3bb9ee0baa1afd82cb5d0f352bdc6e403.tar.gz
3380
One more place we were missing expanding type abbreviations: inside
container definitions.
Diffstat (limited to '045closure_name.cc')
-rw-r--r--045closure_name.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/045closure_name.cc b/045closure_name.cc
index b14030a9..c8658e85 100644
--- a/045closure_name.cc
+++ b/045closure_name.cc
@@ -7,21 +7,21 @@
 def main [
   default-space:address:array:location <- new location:type, 30
   1:address:array:location/names:new-counter <- new-counter
-  2:number/raw <- increment-counter 1:address:array:location/names:new-counter
-  3:number/raw <- increment-counter 1:address:array:location/names:new-counter
+  2:num/raw <- increment-counter 1:address:array:location/names:new-counter
+  3:num/raw <- increment-counter 1:address:array:location/names:new-counter
 ]
 def new-counter [
   default-space:address:array:location <- new location:type, 30
-  x:number <- copy 23
-  y:number <- copy 3  # variable that will be incremented
+  x:num <- copy 23
+  y:num <- copy 3  # variable that will be incremented
   return default-space:address:array:location
 ]
 def increment-counter [
   default-space:address:array:location <- new location:type, 30
   0:address:array:location/names:new-counter <- next-ingredient  # outer space must be created by 'new-counter' above
-  y:number/space:1 <- add y:number/space:1, 1  # increment
-  y:number <- copy 234  # dummy
-  return y:number/space:1
+  y:num/space:1 <- add y:num/space:1, 1  # increment
+  y:num <- copy 234  # dummy
+  return y:num/space:1
 ]
 +name: lexically surrounding space for recipe increment-counter comes from new-counter
 +mem: storing 5 in location 3
@@ -142,7 +142,7 @@ bool already_transformed(const reagent& r, const map<string, int>& names) {
 % Hide_errors = true;
 def f [
   local-scope
-  x:number/space:1 <- copy 34
+  x:num/space:1 <- copy 34
 ]
 +error: don't know surrounding recipe of 'f'
 +error: f: can't find a place to store 'x'
@@ -151,18 +151,18 @@ def f [
 :(scenario local_scope_ignores_nonlocal_spaces)
 def new-scope [
   new-default-space
-  x:address:number <- new number:type
-  *x:address:number <- copy 34
+  x:address:num <- new number:type
+  *x:address:num <- copy 34
   return default-space:address:array:location
 ]
 def use-scope [
   local-scope
   outer:address:array:location <- next-ingredient
   0:address:array:location/names:new-scope <- copy outer:address:array:location
-  return *x:address:number/space:1
+  return *x:address:num/space:1
 ]
 def main [
   1:address:array:location/raw <- new-scope
-  2:number/raw <- use-scope 1:address:array:location/raw
+  2:num/raw <- use-scope 1:address:array:location/raw
 ]
 +mem: storing 34 in location 2