fix switch on value
This commit is contained in:
parent
3b8943731e
commit
05509d1181
|
@ -29,14 +29,15 @@ pub fn main() anyerror!void {
|
||||||
_ = try file.read(slice);
|
_ = try file.read(slice);
|
||||||
|
|
||||||
//switch (try run(allocator, slice)) {
|
//switch (try run(allocator, slice)) {
|
||||||
switch (run(allocator, slice)) {
|
const result = run(allocator, slice);
|
||||||
.Ok => {},
|
switch (result) {
|
||||||
|
.Ok => std.os.exit(0),
|
||||||
|
|
||||||
.TokenizeError,
|
.TokenizeError,
|
||||||
.ParseError,
|
.ParseError,
|
||||||
.CompileError,
|
.CompileError,
|
||||||
=> |res| {
|
=> {
|
||||||
std.debug.warn("error: {}\n", res);
|
std.debug.warn("error: {}\n", result);
|
||||||
std.os.exit(1);
|
std.os.exit(1);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue