diff options
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 6ec2841..ffb671d 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -773,6 +773,7 @@ public: DelimTokenTree (DelimTokenTree const &other) : delim_type (other.delim_type), locus (other.locus) { + token_trees.clear (); token_trees.reserve (other.token_trees.size ()); for (const auto &e : other.token_trees) token_trees.push_back (e->clone_token_tree ()); @@ -784,6 +785,7 @@ public: delim_type = other.delim_type; locus = other.locus; + token_trees.clear (); token_trees.reserve (other.token_trees.size ()); for (const auto &e : other.token_trees) token_trees.push_back (e->clone_token_tree ()); @@ -1523,6 +1525,9 @@ public: DelimTokenTree &get_delim_tok_tree () { return token_tree; } const DelimTokenTree &get_delim_tok_tree () const { return token_tree; } + // Set the delim token tree of a macro invocation + void set_delim_tok_tree (DelimTokenTree tree) { token_tree = tree; } + // TODO: this mutable getter seems kinda dodgy SimplePath &get_path () { return path; } const SimplePath &get_path () const { return path; } |