aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-25 15:59:35 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-25 15:59:35 -0500
commit922b5857005be0609ecc59149748947a5c8b4b10 (patch)
tree6e72a0048fbae736756f4a25727af2ada70aa534 /parse.c
parent32532836b91032f2dfe8258b3b4fcc6288609961 (diff)
Tweaks to NONE parsing and tests
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index d92df34d..275155bc 100644
--- a/parse.c
+++ b/parse.c
@@ -1535,9 +1535,12 @@ PARSER(parse_none) {
if (!match_word(&pos, "NONE"))
return NULL;
+ const char *none_end = pos;
+ spaces(&pos);
if (!match(&pos, ":"))
- return NewAST(ctx->file, start, pos, None, .type=NULL);
+ return NewAST(ctx->file, start, none_end, None, .type=NULL);
+ spaces(&pos);
type_ast_t *type = parse_type(ctx, pos);
if (!type) return NULL;
return NewAST(ctx->file, start, type->end, None, .type=type);