fix switch on value

This commit is contained in:
Luna 2019-09-18 13:44:40 -03:00
parent 3b8943731e
commit 05509d1181
1 changed files with 5 additions and 4 deletions

View File

@ -29,14 +29,15 @@ pub fn main() anyerror!void {
_ = try file.read(slice);
//switch (try run(allocator, slice)) {
switch (run(allocator, slice)) {
.Ok => {},
const result = run(allocator, slice);
switch (result) {
.Ok => std.os.exit(0),
.TokenizeError,
.ParseError,
.CompileError,
=> |res| {
std.debug.warn("error: {}\n", res);
=> {
std.debug.warn("error: {}\n", result);
std.os.exit(1);
},
}