public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8044] gccrs: Fix path expr segment parsing with generic path
@ 2024-01-16 18:13 Arthur Cohen
0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:13 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:061c5d2e24831e520c2deaa383c7ba2041e89146
commit r14-8044-g061c5d2e24831e520c2deaa383c7ba2041e89146
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Tue Oct 10 10:04:57 2023 +0200
gccrs: Fix path expr segment parsing with generic path
When a token was identified as bit left shift it slipped through the
parser and resulted in an error.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_path_expr_segment): Accept
left shift tokens in order to let generic parsing function split the
token.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diff:
---
gcc/rust/parse/rust-parse-impl.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 8c04a1af175..dde3d63201e 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -6808,11 +6808,13 @@ Parser<ManagedTokenSource>::parse_path_expr_segment ()
/* use lookahead to determine if they actually exist (don't want to
* accidently parse over next ident segment) */
if (lexer.peek_token ()->get_id () == SCOPE_RESOLUTION
- && lexer.peek_token (1)->get_id () == LEFT_ANGLE)
+ && (lexer.peek_token (1)->get_id () == LEFT_ANGLE
+ || lexer.peek_token (1)->get_id () == LEFT_SHIFT))
{
// skip scope resolution
lexer.skip_token ();
+ // Let parse_path_generic_args split "<<" tokens
AST::GenericArgs generic_args = parse_path_generic_args ();
return AST::PathExprSegment (std::move (ident), locus,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-16 18:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:13 [gcc r14-8044] gccrs: Fix path expr segment parsing with generic path Arthur Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).