From f2a9b40231f982b10c4d098c60b47da890396c1f Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Tue, 15 Dec 2015 04:05:43 -0700 Subject: more number literal syntax is supported. floats still need work --- src/analyze.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 5ba0ae16a7..5e6b0a3558 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -640,13 +640,7 @@ static bool num_lit_fits_in_other_type(CodeGen *g, TypeTableEntry *literal_type, case TypeTableEntryIdStruct: return false; case TypeTableEntryIdInt: - if (is_num_lit_signed(num_lit)) { - if (!other_type->data.integral.is_signed) { - return false; - } - - return lit_size_in_bits <= other_type->size_in_bits; - } else if (is_num_lit_unsigned(num_lit)) { + if (is_num_lit_unsigned(num_lit)) { return lit_size_in_bits <= other_type->size_in_bits; } else { @@ -883,12 +877,6 @@ static TypeTableEntry * resolve_number_literals(CodeGen *g, AstNode *node1, AstN codegen_num_lit_1->resolved_type = g->builtin_types.entry_f64; codegen_num_lit_2->resolved_type = g->builtin_types.entry_f64; return g->builtin_types.entry_f64; - } else if (is_num_lit_signed(type1->data.num_lit.kind) && - is_num_lit_signed(type2->data.num_lit.kind)) - { - codegen_num_lit_1->resolved_type = g->builtin_types.entry_i64; - codegen_num_lit_2->resolved_type = g->builtin_types.entry_i64; - return g->builtin_types.entry_i64; } else if (is_num_lit_unsigned(type1->data.num_lit.kind) && is_num_lit_unsigned(type2->data.num_lit.kind)) { -- cgit v1.2.3