aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorc2024-02-08 19:41:27 -0500
committerc2024-02-08 19:41:27 -0500
commit78bdd279d90ace6e53a853a898f4819327e82743 (patch)
tree0c5cf6eba0af38c297ac643bd120376af6feb23e /src
parent0085a59bbb0a47b3bb920f4be72a127788e7139c (diff)
Fixed broken test.
Calls and their arguments are now parsed correctly.
Diffstat (limited to 'src')
-rw-r--r--src/parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index ac08a16..731df78 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -100,10 +100,17 @@ tree_t* parser_parse_kwd(parser_t* parser) {
call->data.call.target = parser->token->val;
parser->token->val = NULL;
-
- if (parser_nxt_token_match(parser, TOKEN_TYPE_APPLY)) {
+
+ /* Skip over keyword, check for arguments. */
+ if (
+ parser_nxt_token(parser) &&
+ parser->token->type == TOKEN_TYPE_APPLY
+ ) {
+ /* Expect some arguments. */
+ parser_nxt_token(parser);
call->data.call.arg = parser_parse_carg(parser);
} else {
+ /* There're no arguments. */
call->data.call.arg = NULL;
}