From 4ddb7d143bc30fe65b29954ff8c911f7ed38b6fb Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Thu, 11 May 2023 16:13:41 +0200 Subject: ast: Propagate type suffix Propagate back type suffix to created tokens. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Propagate coretype hint. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-collector.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc index 45a7609..a09869b 100644 --- a/gcc/rust/ast/rust-ast-collector.cc +++ b/gcc/rust/ast/rust-ast-collector.cc @@ -809,10 +809,12 @@ TokenCollector::visit (Literal &lit, Location locus) Rust::Token::make_byte_string (locus, std::move (value))); break; case Literal::LitType::INT: - tokens.push_back (Rust::Token::make_int (locus, std::move (value))); + tokens.push_back ( + Rust::Token::make_int (locus, std::move (value), lit.get_type_hint ())); break; case Literal::LitType::FLOAT: - tokens.push_back (Rust::Token::make_float (locus, std::move (value))); + tokens.push_back (Rust::Token::make_float (locus, std::move (value), + lit.get_type_hint ())); break; case Literal::LitType::BOOL: { if (value == "false") -- cgit v1.1