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
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue