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.
This commit is contained in:
Luna 2019-10-05 10:40:36 -03:00
parent 5348e2b5c4
commit 192baf0725

View file

@ -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;
},
}
}