diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-05-20 23:02:59 -0700 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-06-13 15:31:07 +0000 |
commit | edd623c58ee47d0f7c42669b860bd98f22b59eef (patch) | |
tree | a15ffa74b1796e151f47bd78cc70b0d614b4eb5e /gcc | |
parent | 68d60cf5388d6aa90ed6957e59b47215a31443d7 (diff) | |
download | gcc-edd623c58ee47d0f7c42669b860bd98f22b59eef.zip gcc-edd623c58ee47d0f7c42669b860bd98f22b59eef.tar.gz gcc-edd623c58ee47d0f7c42669b860bd98f22b59eef.tar.bz2 |
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.cc | 14 |
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 8b9b47d..310131c 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) |