feat: parsing a decent chunk of the ink grammar

This commit is contained in:
Brett Broadhurst 2026-02-26 19:11:12 -07:00
parent 5268a53148
commit 4ebdd3c66e
Failed to generate hash of commit
3 changed files with 988 additions and 7 deletions

View file

@ -251,16 +251,14 @@ pub fn createKnotDeclNode(
pub fn parse(
gpa: std.mem.Allocator,
arena: std.mem.Allocator,
source: [:0]const u8,
filename: []const u8,
_: u32,
) !Ast {
var arena_allocator = std.heap.ArenaAllocator.init(gpa);
defer arena_allocator.deinit();
var parser: Parse = .{
.gpa = gpa,
.arena = arena_allocator.allocator(),
.arena = arena,
.tokenizer = Tokenizer.init(source),
.token = .{
.tag = .invalid,