mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Remove weird bit_set shorthand; Add extra type hinting
This commit is contained in:
+2
-2
@@ -2109,7 +2109,7 @@ void check_binary_expr(CheckerContext *c, Operand *x, Ast *node, bool use_lhs_as
|
|||||||
case Token_NotEq: {
|
case Token_NotEq: {
|
||||||
// NOTE(bill): Allow comparisons between types
|
// NOTE(bill): Allow comparisons between types
|
||||||
check_expr_or_type(c, x, be->left);
|
check_expr_or_type(c, x, be->left);
|
||||||
check_expr_or_type(c, y, be->right);
|
check_expr_or_type(c, y, be->right, x->type);
|
||||||
bool xt = x->mode == Addressing_Type;
|
bool xt = x->mode == Addressing_Type;
|
||||||
bool yt = y->mode == Addressing_Type;
|
bool yt = y->mode == Addressing_Type;
|
||||||
// If only one is a type, this is an error
|
// If only one is a type, this is an error
|
||||||
@@ -6194,7 +6194,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
|||||||
|
|
||||||
|
|
||||||
case_ast_node(be, BinaryExpr, node);
|
case_ast_node(be, BinaryExpr, node);
|
||||||
check_binary_expr(c, o, node);
|
check_binary_expr(c, o, node, true);
|
||||||
if (o->mode == Addressing_Invalid) {
|
if (o->mode == Addressing_Invalid) {
|
||||||
o->expr = node;
|
o->expr = node;
|
||||||
return kind;
|
return kind;
|
||||||
|
|||||||
@@ -2078,16 +2078,6 @@ Ast *parse_operand(AstFile *f, bool lhs) {
|
|||||||
|
|
||||||
case Token_bit_set: {
|
case Token_bit_set: {
|
||||||
Token token = expect_token(f, Token_bit_set);
|
Token token = expect_token(f, Token_bit_set);
|
||||||
|
|
||||||
if (f->curr_token.kind == Token_OpenBrace) {
|
|
||||||
Token open = expect_token(f, Token_OpenBrace);
|
|
||||||
|
|
||||||
Array<Ast *> values = parse_element_list(f);
|
|
||||||
Token close = expect_token(f, Token_CloseBrace);
|
|
||||||
Ast *enum_type = ast_enum_type(f, token, nullptr, values);
|
|
||||||
|
|
||||||
return ast_bit_set_type(f, token, enum_type, nullptr);
|
|
||||||
} else {
|
|
||||||
expect_token(f, Token_OpenBracket);
|
expect_token(f, Token_OpenBracket);
|
||||||
|
|
||||||
Ast *elem = nullptr;
|
Ast *elem = nullptr;
|
||||||
@@ -2104,7 +2094,6 @@ Ast *parse_operand(AstFile *f, bool lhs) {
|
|||||||
expect_token(f, Token_CloseBracket);
|
expect_token(f, Token_CloseBracket);
|
||||||
return ast_bit_set_type(f, token, elem, underlying);
|
return ast_bit_set_type(f, token, elem, underlying);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
Reference in New Issue
Block a user