diff options
| -rw-r--r-- | parse.c | 5 | ||||
| -rw-r--r-- | test/nums.tm | 4 |
2 files changed, 5 insertions, 4 deletions
@@ -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); diff --git a/test/nums.tm b/test/nums.tm index 9d3e9a6e..3a66ffe3 100644 --- a/test/nums.tm +++ b/test/nums.tm @@ -22,9 +22,7 @@ func main(): >> Num.INF:isinf() = yes - >> Num.NAN - = NONE : Num? - >> nan := Num.NAN + >> nan := NONE : Num = NONE : Num? >> nan == nan = yes |
