Compare commits
1 commit
master
...
zig-bug-re
Author | SHA1 | Date | |
---|---|---|---|
f2db15b911 |
2 changed files with 12 additions and 11 deletions
14
src/lang.zig
14
src/lang.zig
|
@ -360,15 +360,15 @@ pub const Lang = struct {
|
||||||
|
|
||||||
// construct final Command based on command
|
// construct final Command based on command
|
||||||
var cmd_ptr = try self.allocator.create(Command);
|
var cmd_ptr = try self.allocator.create(Command);
|
||||||
errdefer self.allocator.destroy(cmd_ptr);
|
//errdefer self.allocator.destroy(cmd_ptr);
|
||||||
|
|
||||||
cmd_ptr.* = Command{ .command = ctype, .args = args };
|
//cmd_ptr.* = Command{ .command = ctype, .args = args };
|
||||||
self.validateCommand(cmd_ptr) catch |err| {
|
//self.validateCommand(cmd_ptr) catch |err| {
|
||||||
self.doError("Unknown command '{}' (length {})", command, command.len);
|
// self.doError("Unknown command '{}' (length {})", command, command.len);
|
||||||
continue;
|
// continue;
|
||||||
};
|
//};
|
||||||
|
|
||||||
try cmds.append(cmd_ptr);
|
//try cmds.append(cmd_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.has_error) return ParseError.ParseFail;
|
if (self.has_error) return ParseError.ParseFail;
|
||||||
|
|
|
@ -13,9 +13,6 @@ pub fn main() !void {
|
||||||
var lang = langs.Lang.init(allocator);
|
var lang = langs.Lang.init(allocator);
|
||||||
defer lang.deinit();
|
defer lang.deinit();
|
||||||
|
|
||||||
var runner = runners.Runner.init(allocator);
|
|
||||||
defer runner.deinit();
|
|
||||||
|
|
||||||
var args_it = std.process.args();
|
var args_it = std.process.args();
|
||||||
|
|
||||||
_ = try (args_it.next(allocator) orelse @panic("expected exe name"));
|
_ = try (args_it.next(allocator) orelse @panic("expected exe name"));
|
||||||
|
@ -34,5 +31,9 @@ pub fn main() !void {
|
||||||
var cmds = try lang.parse(data);
|
var cmds = try lang.parse(data);
|
||||||
defer cmds.deinit();
|
defer cmds.deinit();
|
||||||
|
|
||||||
try runner.runCommands(cmds, true);
|
// not needed for bug reproduction
|
||||||
|
//var runner = runners.Runner.init(allocator);
|
||||||
|
//defer runner.deinit();
|
||||||
|
|
||||||
|
//try runner.runCommands(cmds, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue