feat: parsing a decent chunk of the ink grammar
This commit is contained in:
parent
5268a53148
commit
4ebdd3c66e
3 changed files with 988 additions and 7 deletions
|
|
@ -13,7 +13,11 @@ pub const Story = struct {
|
|||
source_bytes: [:0]const u8,
|
||||
options: LoadOptions,
|
||||
) !Story {
|
||||
var ast = try Ast.parse(gpa, source_bytes, "<STDIN>", 0);
|
||||
var arena_allocator = std.heap.ArenaAllocator.init(gpa);
|
||||
defer arena_allocator.deinit();
|
||||
|
||||
const arena = arena_allocator.allocator();
|
||||
var ast = try Ast.parse(gpa, arena, source_bytes, "<STDIN>", 0);
|
||||
defer ast.deinit(gpa);
|
||||
|
||||
try ast.render(gpa, options.stream_writer, .{
|
||||
|
|
@ -27,6 +31,7 @@ pub const Story = struct {
|
|||
}
|
||||
return .{};
|
||||
}
|
||||
|
||||
pub fn deinit(_: *Story) void {}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue