diff options
Diffstat (limited to '053recipe_header.cc')
-rw-r--r-- | 053recipe_header.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/053recipe_header.cc b/053recipe_header.cc index d385d41c..0bbba110 100644 --- a/053recipe_header.cc +++ b/053recipe_header.cc @@ -142,6 +142,28 @@ if (result.has_header) { trace(9999, "parse") << "recipe " << result.name << " has a header" << end(); } +//: Support type abbreviations in headers. + +:(scenario type_abbreviations_in_recipe_headers) +type string = address:array:character +def main [ + local-scope + a:string <- foo + 1:character/raw <- index *a, 0 +] +def foo -> a:string [ + local-scope + load-ingredients + a <- new [abc] +] ++mem: storing 97 in location 1 + +:(before "End Expand Type Abbreviations(caller)") +for (long int i = 0; i < SIZE(caller.ingredients); ++i) + expand_type_abbreviations(caller.ingredients.at(i).type); +for (long int i = 0; i < SIZE(caller.products); ++i) + expand_type_abbreviations(caller.products.at(i).type); + //: Rewrite 'load-ingredients' to instructions to create all reagents in the header. :(before "End Rewrite Instruction(curr, recipe result)") |