aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-17 23:36:07 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-17 23:36:07 +0000
commit2af9fb79dc528830aa2b57943d7d69074a5b399a (patch)
tree79801829328d20a74f01e54b1b446d7e8b9e733d /src/parser.c
parent367d307dc48fb4ee6815141d2f22b69a0996eb66 (diff)
Change cast syntax, int(x), []byte(s), (^int)(p)
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/parser.c b/src/parser.c
index f42e3c94c..53173eb4b 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1979,11 +1979,11 @@ i32 token_precedence(Token t) {
case Token_Shl:
case Token_Shr:
return 5;
- case Token_as:
- case Token_transmute:
- case Token_down_cast:
- case Token_union_cast:
- return 6;
+ // case Token_as:
+ // case Token_transmute:
+ // case Token_down_cast:
+ // case Token_union_cast:
+ // return 6;
}
return 0;
}
@@ -2005,12 +2005,12 @@ AstNode *parse_binary_expr(AstFile *f, bool lhs, i32 prec_in) {
}
switch (op.kind) {
- case Token_as:
+ /* case Token_as:
case Token_transmute:
case Token_down_cast:
case Token_union_cast:
right = parse_type(f);
- break;
+ break; */
default:
right = parse_binary_expr(f, false, prec+1);
@@ -2429,10 +2429,10 @@ AstNode *parse_identifier_or_type(AstFile *f) {
AstNode *sel = parse_identifier(f);
e = make_selector_expr(f, token, e, sel);
}
- if (f->curr_token.kind == Token_OpenParen) {
- // HACK NOTE(bill): For type_of_val(expr)
- e = parse_call_expr(f, e);
- }
+ // if (f->curr_token.kind == Token_OpenParen) {
+ // // HACK NOTE(bill): For type_of_val(expr)
+ // e = parse_call_expr(f, e);
+ // }
return e;
}
@@ -2560,11 +2560,9 @@ AstNode *parse_identifier_or_type(AstFile *f) {
case Token_OpenParen: {
// NOTE(bill): Skip the paren expression
- AstNode *type;
- Token open, close;
- open = expect_token(f, Token_OpenParen);
- type = parse_type(f);
- close = expect_token(f, Token_CloseParen);
+ Token open = expect_token(f, Token_OpenParen);
+ AstNode *type = parse_type(f);
+ Token close = expect_token(f, Token_CloseParen);
return type;
// return make_paren_expr(f, type, open, close);
} break;