aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorgoar5670 <mahadelr19@gmail.com>2023-03-04 22:13:18 +0300
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:21:08 +0100
commit29fed556263557d0a933d55159d2f434f43e2c8f (patch)
tree6ca0709d6737e21c27f3c62a0474e5f7b149e8e9 /gcc/rust
parente9e0f8bf8bc76bfd5369e0d3f8a74d3ffc9e1669 (diff)
downloadgcc-29fed556263557d0a933d55159d2f434f43e2c8f.zip
gcc-29fed556263557d0a933d55159d2f434f43e2c8f.tar.gz
gcc-29fed556263557d0a933d55159d2f434f43e2c8f.tar.bz2
gccrs: parser: Fix handling of multiple left angles in null denotation
gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_expr): split LEFT_SHIFT before null_denotation. gcc/testsuite/ChangeLog: * rust/compile/complex_qualified_path_in_expr.rs : New test. Signed-off-by: Mahmoud Mohamed <mahadelr19@gmail.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 53067bb..0076624 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -12650,6 +12650,13 @@ Parser<ManagedTokenSource>::parse_expr (int right_binding_power,
|| id == RIGHT_SQUARE)
return nullptr;
}
+
+ if (current_token->get_id () == LEFT_SHIFT)
+ {
+ lexer.split_current_token (LEFT_ANGLE, LEFT_ANGLE);
+ current_token = lexer.peek_token ();
+ }
+
lexer.skip_token ();
// parse null denotation (unary part of expression)