summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 02:04:04 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 02:04:04 +0200
commit090da456910429708ef7ee202b627e3dbce17819 (patch)
tree13267372720cddd8b52f1365ed19313e08207637
parenta7b2cec4719ed5b42889aafac20a25f1820ab78b (diff)
polish: Remove unnecessary token creation when dropping token
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
-rw-r--r--src/parser.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/parser.c b/src/parser.c
index 87676d3..48a9125 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -244,9 +244,7 @@ parser_parse_variable_definition(parser_t *parser, string_view_t variable_name,
if (!parser_parse_type(&type, parser))
return false;
- token_t equal_token;
-
- if (!expected_token(&equal_token, parser, TOKEN_EQUAL))
+ if (!drop_expected_token(parser, TOKEN_EQUAL))
return false;
ast_node_t *expression = ast_node_new();