about summary refs log tree commit diff stats
path: root/055parse_tree.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-19 18:46:39 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-19 18:46:39 -0800
commitbb33c5e89993338f6e554210e87b27a5220ead98 (patch)
tree59cab2622fa19c0aa0f625c989145dfa59d2b1dc /055parse_tree.cc
parent5002169370c854b6f532b420225b80e7ef18d6ad (diff)
downloadmu-bb33c5e89993338f6e554210e87b27a5220ead98.tar.gz
2573 - check product type of 'new'
I realize that my current doesn't allow nesting a:b:c linear type syntax
inside a dilated property. So you can't currently say:

  (recipe address:number)

Need to fix that at some point. Non-trivial since linear syntax is
oblivious to dilated syntax. I should probably make the dilated syntax
more fundamental and introduce it at an earlier layer.
Diffstat (limited to '055parse_tree.cc')
-rw-r--r--055parse_tree.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/055parse_tree.cc b/055parse_tree.cc
index 33537344..947093b9 100644
--- a/055parse_tree.cc
+++ b/055parse_tree.cc
@@ -71,10 +71,13 @@ container bar [
 
 :(scenario dilated_reagent_with_new)
 recipe main [
-  x:address:number <- new {(foo bar): type}
+  x:address:address:number <- new {(address number): type}
 ]
-# type isn't defined so size is meaningless, but at least we parse the type correctly
-+new: size of <"foo" : <"bar" : <>>> is 1
++new: size of <"address" : <"number" : <>>> is 1
 
+:(before "End Post-processing(expected_product) When Checking 'new'")
+expected_product.properties.at(0).second = parse_string_tree(expected_product.properties.at(0).second);
+delete expected_product.type;
+expected_product.type = new_type_tree(expected_product.properties.at(0).second);
 :(before "End Post-processing(type_name) When Converting 'new'")
 type_name = parse_string_tree(type_name);