This will ensure an accurate representation of the token. Also update the
as_string function to represent accurately scope resolution tokens.
gcc/rust/ChangeLog:
* lex/rust-token.cc (Token::as_string): Update function to output scope
resolution tokens correctly.
* parse/rust-parse-impl.h (Parser::parse_generic_param): Change call to
as_string.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
return "b'" + escape_special_chars (get_str (), Context::Char) + "'";
case LIFETIME:
return "'" + get_str ();
+ case SCOPE_RESOLUTION:
+ return "::";
case INT_LITERAL:
if (get_type_hint () == CORETYPE_UNKNOWN)
return get_str ();
// FIXME: Can we clean this last call with a method call?
rust_error_at (token->get_locus (),
"unexpected token when parsing generic parameters: %qs",
- token->get_str ().c_str ());
+ token->as_string ().c_str ());
return nullptr;
}