The visitor created some additional semicolon between statements in
extern blocks, this lead to empty statement.
gcc/rust/ChangeLog:
* ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove
additional semicolon output.
* ast/rust-ast-tokenstream.h: Change block visitor prototype
with a default value for trailing tokens.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Rust::Token::make_string (Location (), std::move (abi)));
}
- visit_items_as_block (block.get_extern_items (),
- {Rust::Token::make (SEMICOLON, Location ())});
+ visit_items_as_block (block.get_extern_items ());
}
static std::pair<TokenId, TokenId>
* collection to print only the delimiters with no new line inside.
*/
template <typename T>
- void visit_items_as_block (T &collection, std::vector<TokenPtr> trailing,
+ void visit_items_as_block (T &collection, std::vector<TokenPtr> trailing = {},
TokenId left_brace = LEFT_CURLY,
TokenId right_brace = RIGHT_CURLY);