From 192baf07251cb9d999153875525be2460af4c5c3 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 5 Oct 2019 10:40:36 -0300 Subject: [PATCH] analysis: remove 'else', replace by dedicated Block It isn't possible to make Blocks at root scope. the parser does not allow such constructions, however, it is still a Node, and it should be handled accordingly. --- src/analysis.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 7363078..f1a9407 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -550,9 +550,9 @@ pub const Analyzer = struct { } }, - else => { - std.debug.warn("TODO type analysis of {}\n", node.*); - return CompileError.TypeError; + .Block => { + self.doError("Block can't be found at root"); + return CompileError.Invalid; }, } }