diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-31 00:44:45 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-31 00:44:45 +0200 |
commit | 9d3aa4b96b853c82da6940c1fed3a4e5801c5d90 (patch) | |
tree | 6c9ebabda31f797bac650b90264f445b1f0fb6d9 | |
parent | 89353af46b100b97e93b88f688b0a9c77d74e9f9 (diff) | |
parent | ab77399f33b800f0a1568e512e86df71dd70f566 (diff) | |
download | sparse-9d3aa4b96b853c82da6940c1fed3a4e5801c5d90.tar.gz |
Merge branch 'attr-parsing'
-rw-r--r-- | parse.c | 22 |
1 files changed, 3 insertions, 19 deletions
@@ -1362,18 +1362,8 @@ static struct token *attribute_specifier(struct token *token, struct decl_state token = expect(token, '(', "after attribute"); token = expect(token, '(', "after attribute"); - for (;;) { - struct ident *attribute_name; - struct symbol *attr; - - if (eof_token(token)) - break; - if (match_op(token, ';')) - break; - if (token_type(token) != TOKEN_IDENT) - break; - attribute_name = token->ident; - attr = lookup_keyword(attribute_name, NS_KEYWORD); + while (token_type(token) == TOKEN_IDENT) { + struct symbol *attr = lookup_keyword(token->ident, NS_KEYWORD); if (attr && attr->op->attribute) token = attr->op->attribute(token->next, attr, ctx); else @@ -1784,13 +1774,7 @@ static struct token *skip_attributes(struct token *token) break; token = expect(token->next, '(', "after attribute"); token = expect(token, '(', "after attribute"); - for (;;) { - if (eof_token(token)) - break; - if (match_op(token, ';')) - break; - if (token_type(token) != TOKEN_IDENT) - break; + while (token_type(token) == TOKEN_IDENT) { token = skip_attribute(token); if (!match_op(token, ',')) break; |