aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-19 11:29:15 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-19 11:29:15 +0000
commit4603d2525ebdfa57522ec60db4a86cbc99251ee5 (patch)
tree9d5e22bbe6f93d7a5ebd3e404c7588243c22addb /src/parser.c
parent2af9fb79dc528830aa2b57943d7d69074a5b399a (diff)
Closed range `...` (both inclusive); Type comparisons with == and !=
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index 53173eb4b..f083c2c8f 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -2848,10 +2848,14 @@ AstNode *parse_for_stmt(AstFile *f) {
isize prev_level = f->expr_level;
f->expr_level = -1;
AstNode *expr = parse_expr(f, false);
- if (f->curr_token.kind == Token_Interval) {
- Token op = expect_token(f, Token_Interval);
+ switch (f->curr_token.kind) {
+ case Token_HalfOpenRange:
+ case Token_Ellipsis: {
+ Token op = f->curr_token;
+ next_token(f);
AstNode *right = parse_expr(f, false);
expr = make_interval_expr(f, op, expr, right);
+ } break;
}
f->expr_level = prev_level;