diff options
author | Alex Elder <elder@linaro.org> | 2021-10-01 18:23:18 -0500 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-10-04 12:22:21 -0500 |
commit | dcec18722a968b662acf8cabb3a2ec87c031822e (patch) | |
tree | 0eed2d88873f76a5a906f0f10d3253ffd18766d4 | |
parent | f80136eb0873b6887527cd6104d9a0680c919306 (diff) |
parser: use token_expect() instead of token_accept()
If parse_package() finds anything other than an identifier as the
next token, it calls yyerror(). This is exactly what token_expect()
does, so use that instead.
Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-15-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r-- | parser.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -238,9 +238,7 @@ static const char *parse_package() { struct token tok; - if (!token_accept(TOK_ID, &tok)) - yyerror("expected identifier"); - + token_expect(TOK_ID, &tok); token_expect(';', NULL); return tok.str; } |