translate-c: use .identifier tokens in .identifier AST nodes

This commit is contained in:
Stevie Hryciw 2022-11-07 16:29:09 -08:00 committed by Isaac Freund
parent be737bb5cc
commit d6d4f2481d

View File

@ -1139,7 +1139,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
.string_literal => { .string_literal => {
const payload = node.castTag(.string_literal).?.data; const payload = node.castTag(.string_literal).?.data;
return c.addNode(.{ return c.addNode(.{
.tag = .identifier, .tag = .string_literal,
.main_token = try c.addToken(.string_literal, payload), .main_token = try c.addToken(.string_literal, payload),
.data = undefined, .data = undefined,
}); });
@ -1147,7 +1147,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex {
.char_literal => { .char_literal => {
const payload = node.castTag(.char_literal).?.data; const payload = node.castTag(.char_literal).?.data;
return c.addNode(.{ return c.addNode(.{
.tag = .identifier, .tag = .char_literal,
.main_token = try c.addToken(.char_literal, payload), .main_token = try c.addToken(.char_literal, payload),
.data = undefined, .data = undefined,
}); });