From f1aaf1353e12aa39bd6f89588852a1c70e8424b3 Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Thu, 3 Dec 2015 12:15:07 -0700 Subject: add bool literals --- src/analyze.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 614b80052c..be2a181713 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -297,6 +297,7 @@ static void preview_function_declarations(CodeGen *g, ImportTableEntry *import, case NodeTypeStringLiteral: case NodeTypeUnreachable: case NodeTypeVoid: + case NodeTypeBoolLiteral: case NodeTypeSymbol: case NodeTypeCastExpr: case NodeTypePrefixOpExpr: @@ -592,6 +593,10 @@ static TypeTableEntry * analyze_expression(CodeGen *g, ImportTableEntry *import, return_type = g->builtin_types.entry_void; break; + case NodeTypeBoolLiteral: + return_type = g->builtin_types.entry_bool; + break; + case NodeTypeSymbol: { Buf *symbol_name = &node->data.symbol; @@ -766,6 +771,7 @@ static void analyze_top_level_declaration(CodeGen *g, ImportTableEntry *import, case NodeTypeStringLiteral: case NodeTypeUnreachable: case NodeTypeVoid: + case NodeTypeBoolLiteral: case NodeTypeSymbol: case NodeTypeCastExpr: case NodeTypePrefixOpExpr: -- cgit v1.2.3