From 78d4fe9d2505636c9db207cfa0fccd000dbceab7 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Fri, 3 Jan 2025 14:27:38 +0000 Subject: 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. --- gcc/rust/ast/rust-ast-builder.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/rust/ast/rust-ast-builder.h') 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 struct_expr (std::string struct_name, std::vector> &&fields) const; + std::unique_ptr + struct_expr (PathInExpression struct_name, + std::vector> &&fields) const; /* Create a field expression for struct instantiation (`field_name: value`) */ std::unique_ptr -- cgit v1.1