fix switch on value
This commit is contained in:
parent
3b8943731e
commit
05509d1181
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue