Skip to content

Commit 353f1ca

Browse files
author
Paolo Tranquilli
committed
Rust: distinguish [a, b] from [a; b]
This splits the `ArrayExpr` class into `ArrayListExpr` and `ArrayRepeatExpr`. This uses the `synth.from_class` machinery to integrate seamlessly into the generated code, by hiding the extracted `ArrayExpr` behind an internal class and replacing it with a hierarchy of those two classes under a new `ArrayExpr` class.
1 parent 06b1d8e commit 353f1ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+724
-164
lines changed

rust/ast-generator/src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fn class_name(type_name: &str) -> String {
2121
"Fn" => "Function",
2222
"Literal" => "LiteralExpr",
2323
"Type" => "TypeRef",
24+
"ArrayExpr" => "ArrayExprInternal",
2425
_ => type_name,
2526
};
2627
name.to_owned()
@@ -354,6 +355,13 @@ fn get_fields(node: &AstNodeSrc) -> Vec<FieldInfo> {
354355
is_many: false,
355356
});
356357
}
358+
"ArrayExpr" => {
359+
result.push(FieldInfo {
360+
name: "is_semicolon".to_string(),
361+
tp: "predicate".to_string(),
362+
is_many: true,
363+
});
364+
}
357365
_ => {}
358366
}
359367

rust/extractor/src/generated/.generated.list

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/generated/top.rs

Lines changed: 24 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/translate/generated.rs

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)