From: jjasmine Date: Tue, 21 May 2024 06:02:59 +0000 (-0700) Subject: Working on parse_options for a bit more X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edd623c58ee47d0f7c42669b860bd98f22b59eef;p=thirdparty%2Fgcc.git Working on parse_options for a bit more gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_options): title. --- diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc index 8b9b47d51aa4..310131c5b311 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 &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 &p, std::string ident)