aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjjasmine <tanghocle456@gmail.com>2024-05-20 23:02:59 -0700
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-17 16:35:36 +0100
commitfe6dd9ac6ae802a83cea030a2ed1f3e2aca4e64d (patch)
tree03aeed86c762f27bd502e8af1f2e1e9f0ac3cc32 /gcc
parent2ea6a697d743d8a374711cad751b931891aac1c6 (diff)
downloadgcc-fe6dd9ac6ae802a83cea030a2ed1f3e2aca4e64d.zip
gcc-fe6dd9ac6ae802a83cea030a2ed1f3e2aca4e64d.tar.gz
gcc-fe6dd9ac6ae802a83cea030a2ed1f3e2aca4e64d.tar.bz2
gccrs: Working on parse_options for a bit more
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_options): title.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/expand/rust-macro-builtins-asm.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc
index 9d904d6..d47d95c 100644
--- a/gcc/rust/expand/rust-macro-builtins-asm.cc
+++ b/gcc/rust/expand/rust-macro-builtins-asm.cc
@@ -98,7 +98,19 @@ parse_options (Parser<MacroInvocLexer> &parser, TokenId last_token_id,
{
// Parse everything commitedly
if (!p.skip_token (LEFT_PAREN))
- {}
+ {
+ // We have shifted `options` to search for the left parenthesis next, we
+ // should error out if this is not possible.
+ // TODO: report some error.
+ return -1;
+ }
+
+ auto token = parser.peek_current_token ();
+ while (token->get_id () != last_token_id && token->get_id () != RIGHT_PAREN)
+ {
+ parser.skip_token ();
+ token = parser.peek_current_token ();
+ }
}
bool
check_identifier (Parser<MacroInvocLexer> &p, std::string ident)