]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Working on parse_options for a bit more
authorjjasmine <tanghocle456@gmail.com>
Tue, 21 May 2024 06:02:59 +0000 (23:02 -0700)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:36 +0000 (16:35 +0100)
gcc/rust/ChangeLog:

* expand/rust-macro-builtins-asm.cc (parse_options): title.

gcc/rust/expand/rust-macro-builtins-asm.cc

index 9d904d6223e738a4f2e0db83252e9fee1490f14d..d47d95c594fb13ed996ab72a714ce5efcea15b71 100644 (file)
@@ -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)