aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-builder.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2025-01-03 14:27:38 +0000
committerCohenArthur <arthur.cohen@embecosm.com>2025-01-20 12:09:26 +0000
commit78d4fe9d2505636c9db207cfa0fccd000dbceab7 (patch)
tree578a2839cfa1c1a0c9bf76b79b6c956fb3824870 /gcc/rust/ast/rust-ast-builder.h
parent43747f4062a81e3b3f0e10b8ff2573eab9acca35 (diff)
downloadgcc-78d4fe9d2505636c9db207cfa0fccd000dbceab7.zip
gcc-78d4fe9d2505636c9db207cfa0fccd000dbceab7.tar.gz
gcc-78d4fe9d2505636c9db207cfa0fccd000dbceab7.tar.bz2
ast-builder: Add new methods for building structs
gcc/rust/ChangeLog: * ast/rust-ast-builder.cc: Add new methods for constructing struct exprs. * ast/rust-ast-builder.h: Mention how to build tuple expressions.
Diffstat (limited to 'gcc/rust/ast/rust-ast-builder.h')
-rw-r--r--gcc/rust/ast/rust-ast-builder.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast-builder.h b/gcc/rust/ast/rust-ast-builder.h
index 86279b0..7e224d3 100644
--- a/gcc/rust/ast/rust-ast-builder.h
+++ b/gcc/rust/ast/rust-ast-builder.h
@@ -160,10 +160,15 @@ public:
/**
* Create an expression for struct instantiation with fields (`S { a, b: c }`)
+ * Tuple expressions are call expressions and can thus be constructed with
+ * `call`
*/
std::unique_ptr<Expr>
struct_expr (std::string struct_name,
std::vector<std::unique_ptr<StructExprField>> &&fields) const;
+ std::unique_ptr<Expr>
+ struct_expr (PathInExpression struct_name,
+ std::vector<std::unique_ptr<StructExprField>> &&fields) const;
/* Create a field expression for struct instantiation (`field_name: value`) */
std::unique_ptr<StructExprField>