963
Amazing how easy that was.
This commit is contained in:
parent
198ad74126
commit
72cc3ae158
11
cpp/.traces/convert_names_handles_records
Normal file
11
cpp/.traces/convert_names_handles_records
Normal file
|
@ -0,0 +1,11 @@
|
|||
parse/0: instruction: 1
|
||||
parse/0: ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
|
||||
parse/0: product: {name: "a", value: 0, type: 4, properties: [a: point]}
|
||||
parse/0: instruction: 1
|
||||
parse/0: ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
|
||||
parse/0: product: {name: "b", value: 0, type: 1, properties: [b: integer]}
|
||||
name/0: assign a 1
|
||||
name/0: assign b 3
|
||||
after-brace/0: recipe main
|
||||
after-brace/0: copy ...
|
||||
after-brace/0: copy ...
|
12
cpp/025name
12
cpp/025name
|
@ -68,7 +68,7 @@ void transform_names(const recipe_number r) {
|
|||
if (names.find(inst.products[out].name) == names.end()) {
|
||||
trace("name") << "assign " << inst.products[out].name << " " << curr_idx;
|
||||
names[inst.products[out].name] = curr_idx;
|
||||
++curr_idx;
|
||||
curr_idx += size_of(inst.products[out]);
|
||||
}
|
||||
inst.products[out].value = names[inst.products[out].name];
|
||||
inst.products[out].initialized = true;
|
||||
|
@ -136,3 +136,13 @@ recipe main [
|
|||
]
|
||||
+name: field y of type point is at offset 1
|
||||
+name: field x of type point is at offset 0
|
||||
|
||||
//: this test is actually illegal so can't call run
|
||||
:(scenarios transform_test)
|
||||
:(scenario "convert_names_handles_records")
|
||||
recipe main [
|
||||
a:point <- copy 0:literal
|
||||
b:integer <- copy 0:literal
|
||||
]
|
||||
+name: assign a 1
|
||||
+name: assign b 3
|
||||
|
|
Loading…
Reference in New Issue
Block a user