From 3b4e14a089d3c15105c406712d355dbd8e0943d2 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 11 Jun 2022 09:59:03 +0200 Subject: [PATCH] Squashing compound bugs --- globals.kl | 4 ++++ parsing.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/globals.kl b/globals.kl index 12b86b3..52f217c 100644 --- a/globals.kl +++ b/globals.kl @@ -23,6 +23,10 @@ Boolean: Bool = true //----------------------------------------------------------------------------- array1: [4]S64 = {1,2,3,4} imp_array := [5]S64{1,2} +// imp_array := [5]S64{1,2} // @todo this works for some reason +// imp_array_a := [5]S64{1,2,3,4,5,6} +// imp_array_b: [5]S64 = {1,2,3,4,5,6} +imp_array_c: [5]S64 = {[0] = 1, [2] = 2, [1] = 0} // @todo this should be illegal //----------------------------------------------------------------------------- // Pointers diff --git a/parsing.cpp b/parsing.cpp index 8e003de..0b8b5d1 100644 --- a/parsing.cpp +++ b/parsing.cpp @@ -168,7 +168,7 @@ parse_expr_call(Ast_Expr *left, Token_Kind close_kind){ item = parse_expr(); } - if(item && index) compiler_error(token, "Both index and name are present, that is invalid"); + if(name && index) compiler_error(token, "Both index and name are present, that is invalid"); if(close_kind == TK_OpenParen && index) compiler_error(token, "Lambda calls can't have indexed arguments"); Ast_Call_Item *item_comp = ast_call_item(token, name, index, item);