]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Working on parse_options for a bit more
authorjjasmine <tanghocle456@gmail.com>
Tue, 21 May 2024 06:02:59 +0000 (23:02 -0700)
committerCohenArthur <arthur.cohen@embecosm.com>
Thu, 13 Jun 2024 15:31:07 +0000 (15:31 +0000)
gcc/rust/ChangeLog:

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

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

index 8b9b47d51aa4a4563f6b6ac39e5bde9955d94770..310131c5b311ee0d726ddcd0c954ce71fec5b26d 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)