diff options
Diffstat (limited to 'src/parser.zig')
-rw-r--r-- | src/parser.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.zig b/src/parser.zig index 0db089f..d564924 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -103,7 +103,7 @@ pub const Parser = struct { return self.create_node(.{ .VARIABLE_STATEMENT = .{ .is_declaration = is_declaration, - .name = identifier.IDENTIFIER, + .name = try self.allocator.dupe(u8, identifier.IDENTIFIER), .expression = @constCast(expression), }, }); @@ -141,7 +141,7 @@ pub const Parser = struct { .IDENTIFIER => |identifier_token| self.create_node(.{ .EXPRESSION = .{ .IDENTIFIER = .{ - .name = identifier_token, + .name = try self.allocator.dupe(u8, identifier_token), }, }, }), |