authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-12-14 20:40:56+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-12-14 20:40:56+02:00
log1a967db08311cd5046660e9df13a51e622f005b6
treedb6f3c9cc8d9ec76ad2118233294f21fcf7b512c
parent1f8458683658ed22a30145e5c48ea3e23785cbae
signature Commit is signed but in an unrecognized format.

add default initializers to all ast.Node base values


3 files changed, 46 insertions(+), 142 deletions(-)

lib/std/zig/ast.zig+46-46
......@@ -581,7 +581,7 @@ pub const Node = struct {
581581 }
582582
583583 pub const Root = struct {
584 base: Node,
584 base: Node = Node {.id = .Root},
585585 decls: DeclList,
586586 eof_token: TokenIndex,
587587
......@@ -604,7 +604,7 @@ pub const Node = struct {
604604 };
605605
606606 pub const VarDecl = struct {
607 base: Node,
607 base: Node = Node {.id = .VarDecl},
608608 doc_comments: ?*DocComment,
609609 visib_token: ?TokenIndex,
610610 thread_local_token: ?TokenIndex,
......@@ -661,7 +661,7 @@ pub const Node = struct {
661661 };
662662
663663 pub const Use = struct {
664 base: Node,
664 base: Node = Node {.id = .Use},
665665 doc_comments: ?*DocComment,
666666 visib_token: ?TokenIndex,
667667 use_token: TokenIndex,
......@@ -688,7 +688,7 @@ pub const Node = struct {
688688 };
689689
690690 pub const ErrorSetDecl = struct {
691 base: Node,
691 base: Node = Node {.id = .ErrorSetDecl},
692692 error_token: TokenIndex,
693693 decls: DeclList,
694694 rbrace_token: TokenIndex,
......@@ -714,7 +714,7 @@ pub const Node = struct {
714714 };
715715
716716 pub const ContainerDecl = struct {
717 base: Node,
717 base: Node = Node {.id = .ContainerDecl},
718718 layout_token: ?TokenIndex,
719719 kind_token: TokenIndex,
720720 init_arg_expr: InitArg,
......@@ -801,7 +801,7 @@ pub const Node = struct {
801801 };
802802
803803 pub const ErrorTag = struct {
804 base: Node,
804 base: Node = Node {.id = .ErrorTag},
805805 doc_comments: ?*DocComment,
806806 name_token: TokenIndex,
807807
......@@ -826,7 +826,7 @@ pub const Node = struct {
826826 };
827827
828828 pub const Identifier = struct {
829 base: Node,
829 base: Node = Node {.id = .Identifier},
830830 token: TokenIndex,
831831
832832 pub fn iterate(self: *Identifier, index: usize) ?*Node {
......@@ -843,7 +843,7 @@ pub const Node = struct {
843843 };
844844
845845 pub const FnProto = struct {
846 base: Node,
846 base: Node = Node {.id = .FnProto},
847847 doc_comments: ?*DocComment,
848848 visib_token: ?TokenIndex,
849849 fn_token: TokenIndex,
......@@ -925,7 +925,7 @@ pub const Node = struct {
925925 };
926926
927927 pub const AnyFrameType = struct {
928 base: Node,
928 base: Node = Node {.id = .AnyFrameType},
929929 anyframe_token: TokenIndex,
930930 result: ?Result,
931931
......@@ -956,7 +956,7 @@ pub const Node = struct {
956956 };
957957
958958 pub const ParamDecl = struct {
959 base: Node,
959 base: Node = Node {.id = .ParamDecl},
960960 doc_comments: ?*DocComment,
961961 comptime_token: ?TokenIndex,
962962 noalias_token: ?TokenIndex,
......@@ -989,7 +989,7 @@ pub const Node = struct {
989989 };
990990
991991 pub const Block = struct {
992 base: Node,
992 base: Node = Node {.id = .Block},
993993 label: ?TokenIndex,
994994 lbrace: TokenIndex,
995995 statements: StatementList,
......@@ -1020,7 +1020,7 @@ pub const Node = struct {
10201020 };
10211021
10221022 pub const Defer = struct {
1023 base: Node,
1023 base: Node = Node {.id = .Defer},
10241024 defer_token: TokenIndex,
10251025 expr: *Node,
10261026
......@@ -1043,7 +1043,7 @@ pub const Node = struct {
10431043 };
10441044
10451045 pub const Comptime = struct {
1046 base: Node,
1046 base: Node = Node {.id = .Comptime},
10471047 doc_comments: ?*DocComment,
10481048 comptime_token: TokenIndex,
10491049 expr: *Node,
......@@ -1067,7 +1067,7 @@ pub const Node = struct {
10671067 };
10681068
10691069 pub const Payload = struct {
1070 base: Node,
1070 base: Node = Node {.id = .Payload},
10711071 lpipe: TokenIndex,
10721072 error_symbol: *Node,
10731073 rpipe: TokenIndex,
......@@ -1091,7 +1091,7 @@ pub const Node = struct {
10911091 };
10921092
10931093 pub const PointerPayload = struct {
1094 base: Node,
1094 base: Node = Node {.id = .PointerPayload},
10951095 lpipe: TokenIndex,
10961096 ptr_token: ?TokenIndex,
10971097 value_symbol: *Node,
......@@ -1116,7 +1116,7 @@ pub const Node = struct {
11161116 };
11171117
11181118 pub const PointerIndexPayload = struct {
1119 base: Node,
1119 base: Node = Node {.id = .PointerIndexPayload},
11201120 lpipe: TokenIndex,
11211121 ptr_token: ?TokenIndex,
11221122 value_symbol: *Node,
......@@ -1147,7 +1147,7 @@ pub const Node = struct {
11471147 };
11481148
11491149 pub const Else = struct {
1150 base: Node,
1150 base: Node = Node {.id = .Else},
11511151 else_token: TokenIndex,
11521152 payload: ?*Node,
11531153 body: *Node,
......@@ -1176,7 +1176,7 @@ pub const Node = struct {
11761176 };
11771177
11781178 pub const Switch = struct {
1179 base: Node,
1179 base: Node = Node {.id = .Switch},
11801180 switch_token: TokenIndex,
11811181 expr: *Node,
11821182
......@@ -1208,7 +1208,7 @@ pub const Node = struct {
12081208 };
12091209
12101210 pub const SwitchCase = struct {
1211 base: Node,
1211 base: Node = Node {.id = .SwitchCase},
12121212 items: ItemList,
12131213 arrow_token: TokenIndex,
12141214 payload: ?*Node,
......@@ -1243,7 +1243,7 @@ pub const Node = struct {
12431243 };
12441244
12451245 pub const SwitchElse = struct {
1246 base: Node,
1246 base: Node = Node {.id = .SwitchElse},
12471247 token: TokenIndex,
12481248
12491249 pub fn iterate(self: *SwitchElse, index: usize) ?*Node {
......@@ -1260,7 +1260,7 @@ pub const Node = struct {
12601260 };
12611261
12621262 pub const While = struct {
1263 base: Node,
1263 base: Node = Node {.id = .While},
12641264 label: ?TokenIndex,
12651265 inline_token: ?TokenIndex,
12661266 while_token: TokenIndex,
......@@ -1319,7 +1319,7 @@ pub const Node = struct {
13191319 };
13201320
13211321 pub const For = struct {
1322 base: Node,
1322 base: Node = Node {.id = .For},
13231323 label: ?TokenIndex,
13241324 inline_token: ?TokenIndex,
13251325 for_token: TokenIndex,
......@@ -1370,7 +1370,7 @@ pub const Node = struct {
13701370 };
13711371
13721372 pub const If = struct {
1373 base: Node,
1373 base: Node = Node {.id = .If},
13741374 if_token: TokenIndex,
13751375 condition: *Node,
13761376 payload: ?*Node,
......@@ -1413,7 +1413,7 @@ pub const Node = struct {
14131413 };
14141414
14151415 pub const InfixOp = struct {
1416 base: Node,
1416 base: Node = Node {.id = .InfixOp},
14171417 op_token: TokenIndex,
14181418 lhs: *Node,
14191419 op: Op,
......@@ -1646,7 +1646,7 @@ pub const Node = struct {
16461646 };
16471647
16481648 pub const FieldInitializer = struct {
1649 base: Node,
1649 base: Node = Node {.id = .FieldInitializer},
16501650 period_token: TokenIndex,
16511651 name_token: TokenIndex,
16521652 expr: *Node,
......@@ -1670,7 +1670,7 @@ pub const Node = struct {
16701670 };
16711671
16721672 pub const SuffixOp = struct {
1673 base: Node,
1673 base: Node = Node {.id = .SuffixOp},
16741674 lhs: Lhs,
16751675 op: Op,
16761676 rtoken: TokenIndex,
......@@ -1766,7 +1766,7 @@ pub const Node = struct {
17661766 };
17671767
17681768 pub const GroupedExpression = struct {
1769 base: Node,
1769 base: Node = Node {.id = .GroupedExpression},
17701770 lparen: TokenIndex,
17711771 expr: *Node,
17721772 rparen: TokenIndex,
......@@ -1790,7 +1790,7 @@ pub const Node = struct {
17901790 };
17911791
17921792 pub const ControlFlowExpression = struct {
1793 base: Node,
1793 base: Node = Node {.id = .ControlFlowExpression},
17941794 ltoken: TokenIndex,
17951795 kind: Kind,
17961796 rhs: ?*Node,
......@@ -1856,7 +1856,7 @@ pub const Node = struct {
18561856 };
18571857
18581858 pub const Suspend = struct {
1859 base: Node,
1859 base: Node = Node {.id = .Suspend},
18601860 suspend_token: TokenIndex,
18611861 body: ?*Node,
18621862
......@@ -1885,7 +1885,7 @@ pub const Node = struct {
18851885 };
18861886
18871887 pub const IntegerLiteral = struct {
1888 base: Node,
1888 base: Node = Node {.id = .IntegerLiteral},
18891889 token: TokenIndex,
18901890
18911891 pub fn iterate(self: *IntegerLiteral, index: usize) ?*Node {
......@@ -1902,7 +1902,7 @@ pub const Node = struct {
19021902 };
19031903
19041904 pub const EnumLiteral = struct {
1905 base: Node,
1905 base: Node = Node {.id = .EnumLiteral},
19061906 dot: TokenIndex,
19071907 name: TokenIndex,
19081908
......@@ -1920,7 +1920,7 @@ pub const Node = struct {
19201920 };
19211921
19221922 pub const FloatLiteral = struct {
1923 base: Node,
1923 base: Node = Node {.id = .FloatLiteral},
19241924 token: TokenIndex,
19251925
19261926 pub fn iterate(self: *FloatLiteral, index: usize) ?*Node {
......@@ -1937,7 +1937,7 @@ pub const Node = struct {
19371937 };
19381938
19391939 pub const BuiltinCall = struct {
1940 base: Node,
1940 base: Node = Node {.id = .BuiltinCall},
19411941 builtin_token: TokenIndex,
19421942 params: ParamList,
19431943 rparen_token: TokenIndex,
......@@ -1963,7 +1963,7 @@ pub const Node = struct {
19631963 };
19641964
19651965 pub const StringLiteral = struct {
1966 base: Node,
1966 base: Node = Node {.id = .StringLiteral},
19671967 token: TokenIndex,
19681968
19691969 pub fn iterate(self: *StringLiteral, index: usize) ?*Node {
......@@ -1980,7 +1980,7 @@ pub const Node = struct {
19801980 };
19811981
19821982 pub const MultilineStringLiteral = struct {
1983 base: Node,
1983 base: Node = Node {.id = .MultilineStringLiteral},
19841984 lines: LineList,
19851985
19861986 pub const LineList = SegmentedList(TokenIndex, 4);
......@@ -1999,7 +1999,7 @@ pub const Node = struct {
19991999 };
20002000
20012001 pub const CharLiteral = struct {
2002 base: Node,
2002 base: Node = Node {.id = .CharLiteral},
20032003 token: TokenIndex,
20042004
20052005 pub fn iterate(self: *CharLiteral, index: usize) ?*Node {
......@@ -2016,7 +2016,7 @@ pub const Node = struct {
20162016 };
20172017
20182018 pub const BoolLiteral = struct {
2019 base: Node,
2019 base: Node = Node {.id = .BoolLiteral},
20202020 token: TokenIndex,
20212021
20222022 pub fn iterate(self: *BoolLiteral, index: usize) ?*Node {
......@@ -2033,7 +2033,7 @@ pub const Node = struct {
20332033 };
20342034
20352035 pub const NullLiteral = struct {
2036 base: Node,
2036 base: Node = Node {.id = .NullLiteral},
20372037 token: TokenIndex,
20382038
20392039 pub fn iterate(self: *NullLiteral, index: usize) ?*Node {
......@@ -2050,7 +2050,7 @@ pub const Node = struct {
20502050 };
20512051
20522052 pub const UndefinedLiteral = struct {
2053 base: Node,
2053 base: Node = Node {.id = .UndefinedLiteral},
20542054 token: TokenIndex,
20552055
20562056 pub fn iterate(self: *UndefinedLiteral, index: usize) ?*Node {
......@@ -2067,7 +2067,7 @@ pub const Node = struct {
20672067 };
20682068
20692069 pub const AsmOutput = struct {
2070 base: Node,
2070 base: Node = Node {.id = .AsmOutput},
20712071 lbracket: TokenIndex,
20722072 symbolic_name: *Node,
20732073 constraint: *Node,
......@@ -2112,7 +2112,7 @@ pub const Node = struct {
21122112 };
21132113
21142114 pub const AsmInput = struct {
2115 base: Node,
2115 base: Node = Node {.id = .AsmInput},
21162116 lbracket: TokenIndex,
21172117 symbolic_name: *Node,
21182118 constraint: *Node,
......@@ -2144,7 +2144,7 @@ pub const Node = struct {
21442144 };
21452145
21462146 pub const Asm = struct {
2147 base: Node,
2147 base: Node = Node {.id = .Asm},
21482148 asm_token: TokenIndex,
21492149 volatile_token: ?TokenIndex,
21502150 template: *Node,
......@@ -2179,7 +2179,7 @@ pub const Node = struct {
21792179 };
21802180
21812181 pub const Unreachable = struct {
2182 base: Node,
2182 base: Node = Node {.id = .Unreachable},
21832183 token: TokenIndex,
21842184
21852185 pub fn iterate(self: *Unreachable, index: usize) ?*Node {
......@@ -2196,7 +2196,7 @@ pub const Node = struct {
21962196 };
21972197
21982198 pub const ErrorType = struct {
2199 base: Node,
2199 base: Node = Node {.id = .ErrorType},
22002200 token: TokenIndex,
22012201
22022202 pub fn iterate(self: *ErrorType, index: usize) ?*Node {
......@@ -2230,7 +2230,7 @@ pub const Node = struct {
22302230 };
22312231
22322232 pub const DocComment = struct {
2233 base: Node,
2233 base: Node = Node {.id = .DocComment},
22342234 lines: LineList,
22352235
22362236 pub const LineList = SegmentedList(TokenIndex, 4);
......@@ -2249,7 +2249,7 @@ pub const Node = struct {
22492249 };
22502250
22512251 pub const TestDecl = struct {
2252 base: Node,
2252 base: Node = Node {.id = .TestDecl},
22532253 doc_comments: ?*DocComment,
22542254 test_token: TokenIndex,
22552255 name: *Node,
lib/std/zig/parse.zig-72
......@@ -56,7 +56,6 @@ pub fn parse(allocator: *Allocator, source: []const u8) !*Tree {
5656fn parseRoot(arena: *Allocator, it: *TokenIterator, tree: *Tree) Allocator.Error!*Node.Root {
5757 const node = try arena.create(Node.Root);
5858 node.* = Node.Root{
59 .base = Node{ .id = .Root },
6059 .decls = undefined,
6160 .eof_token = undefined,
6261 };
......@@ -176,7 +175,6 @@ fn parseContainerDocComments(arena: *Allocator, it: *TokenIterator, tree: *Tree)
176175
177176 const node = try arena.create(Node.DocComment);
178177 node.* = Node.DocComment{
179 .base = Node{ .id = .DocComment },
180178 .lines = lines,
181179 };
182180 return &node.base;
......@@ -194,7 +192,6 @@ fn parseTestDecl(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
194192
195193 const test_node = try arena.create(Node.TestDecl);
196194 test_node.* = Node.TestDecl{
197 .base = Node{ .id = .TestDecl },
198195 .doc_comments = null,
199196 .test_token = test_token,
200197 .name = name_node,
......@@ -217,7 +214,6 @@ fn parseTopLevelComptime(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*
217214
218215 const comptime_node = try arena.create(Node.Comptime);
219216 comptime_node.* = Node.Comptime{
220 .base = Node{ .id = .Comptime },
221217 .doc_comments = null,
222218 .comptime_token = tok,
223219 .expr = block_node,
......@@ -338,7 +334,6 @@ fn parseFnProto(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
338334
339335 const fn_proto_node = try arena.create(Node.FnProto);
340336 fn_proto_node.* = Node.FnProto{
341 .base = Node{ .id = .FnProto },
342337 .doc_comments = null,
343338 .visib_token = null,
344339 .fn_token = fn_token,
......@@ -389,7 +384,6 @@ fn parseVarDecl(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
389384
390385 const node = try arena.create(Node.VarDecl);
391386 node.* = Node.VarDecl{
392 .base = Node{ .id = .VarDecl },
393387 .doc_comments = null,
394388 .visib_token = null,
395389 .thread_local_token = null,
......@@ -477,7 +471,6 @@ fn parseStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) Error!?*No
477471
478472 const node = try arena.create(Node.Comptime);
479473 node.* = Node.Comptime{
480 .base = Node{ .id = .Comptime },
481474 .doc_comments = null,
482475 .comptime_token = token,
483476 .expr = block_expr,
......@@ -496,7 +489,6 @@ fn parseStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) Error!?*No
496489
497490 const node = try arena.create(Node.Suspend);
498491 node.* = Node.Suspend{
499 .base = Node{ .id = .Suspend },
500492 .suspend_token = suspend_token,
501493 .body = body_node,
502494 };
......@@ -510,7 +502,6 @@ fn parseStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) Error!?*No
510502 });
511503 const node = try arena.create(Node.Defer);
512504 node.* = Node.Defer{
513 .base = Node{ .id = .Defer },
514505 .defer_token = token,
515506 .expr = expr_node,
516507 };
......@@ -558,7 +549,6 @@ fn parseIfStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
558549
559550 const node = try arena.create(Node.Else);
560551 node.* = Node.Else{
561 .base = Node{ .id = .Else },
562552 .else_token = else_token,
563553 .payload = payload,
564554 .body = else_body,
......@@ -652,7 +642,6 @@ fn parseForStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
652642
653643 const else_node = try arena.create(Node.Else);
654644 else_node.* = Node.Else{
655 .base = Node{ .id = .Else },
656645 .else_token = else_token,
657646 .payload = null,
658647 .body = statement_node,
......@@ -677,7 +666,6 @@ fn parseForStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
677666
678667 const else_node = try arena.create(Node.Else);
679668 else_node.* = Node.Else{
680 .base = Node{ .id = .Else },
681669 .else_token = else_token,
682670 .payload = null,
683671 .body = statement_node,
......@@ -714,7 +702,6 @@ fn parseWhileStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*No
714702
715703 const else_node = try arena.create(Node.Else);
716704 else_node.* = Node.Else{
717 .base = Node{ .id = .Else },
718705 .else_token = else_token,
719706 .payload = payload,
720707 .body = statement_node,
......@@ -741,7 +728,6 @@ fn parseWhileStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*No
741728
742729 const else_node = try arena.create(Node.Else);
743730 else_node.* = Node.Else{
744 .base = Node{ .id = .Else },
745731 .else_token = else_token,
746732 .payload = payload,
747733 .body = statement_node,
......@@ -870,7 +856,6 @@ fn parsePrimaryExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
870856 const expr_node = try parseExpr(arena, it, tree);
871857 const node = try arena.create(Node.ControlFlowExpression);
872858 node.* = Node.ControlFlowExpression{
873 .base = Node{ .id = .ControlFlowExpression },
874859 .ltoken = token,
875860 .kind = Node.ControlFlowExpression.Kind{ .Break = label },
876861 .rhs = expr_node,
......@@ -884,7 +869,6 @@ fn parsePrimaryExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
884869 });
885870 const node = try arena.create(Node.Comptime);
886871 node.* = Node.Comptime{
887 .base = Node{ .id = .Comptime },
888872 .doc_comments = null,
889873 .comptime_token = token,
890874 .expr = expr_node,
......@@ -896,7 +880,6 @@ fn parsePrimaryExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
896880 const label = try parseBreakLabel(arena, it, tree);
897881 const node = try arena.create(Node.ControlFlowExpression);
898882 node.* = Node.ControlFlowExpression{
899 .base = Node{ .id = .ControlFlowExpression },
900883 .ltoken = token,
901884 .kind = Node.ControlFlowExpression.Kind{ .Continue = label },
902885 .rhs = null,
......@@ -910,7 +893,6 @@ fn parsePrimaryExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
910893 });
911894 const node = try arena.create(Node.PrefixOp);
912895 node.* = Node.PrefixOp{
913 .base = Node{ .id = .PrefixOp },
914896 .op_token = token,
915897 .op = Node.PrefixOp.Op.Resume,
916898 .rhs = expr_node,
......@@ -922,7 +904,6 @@ fn parsePrimaryExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
922904 const expr_node = try parseExpr(arena, it, tree);
923905 const node = try arena.create(Node.ControlFlowExpression);
924906 node.* = Node.ControlFlowExpression{
925 .base = Node{ .id = .ControlFlowExpression },
926907 .ltoken = token,
927908 .kind = Node.ControlFlowExpression.Kind.Return,
928909 .rhs = expr_node,
......@@ -970,7 +951,6 @@ fn parseBlock(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
970951
971952 const block_node = try arena.create(Node.Block);
972953 block_node.* = Node.Block{
973 .base = Node{ .id = .Block },
974954 .label = null,
975955 .lbrace = lbrace,
976956 .statements = statements,
......@@ -1020,7 +1000,6 @@ fn parseForExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
10201000
10211001 const else_node = try arena.create(Node.Else);
10221002 else_node.* = Node.Else{
1023 .base = Node{ .id = .Else },
10241003 .else_token = else_token,
10251004 .payload = null,
10261005 .body = body,
......@@ -1050,7 +1029,6 @@ fn parseWhileExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
10501029
10511030 const else_node = try arena.create(Node.Else);
10521031 else_node.* = Node.Else{
1053 .base = Node{ .id = .Else },
10541032 .else_token = else_token,
10551033 .payload = payload,
10561034 .body = body,
......@@ -1102,7 +1080,6 @@ fn parseInitList(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node.Suf
11021080
11031081 const node = try arena.create(Node.SuffixOp);
11041082 node.* = Node.SuffixOp{
1105 .base = Node{ .id = .SuffixOp },
11061083 .lhs = .{ .node = undefined }, // set by caller
11071084 .op = op,
11081085 .rtoken = try expectToken(it, tree, .RBrace),
......@@ -1171,7 +1148,6 @@ fn parseSuffixExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
11711148 };
11721149 const node = try arena.create(Node.SuffixOp);
11731150 node.* = Node.SuffixOp{
1174 .base = Node{ .id = .SuffixOp },
11751151 .lhs = .{ .node = res },
11761152 .op = Node.SuffixOp.Op{
11771153 .Call = Node.SuffixOp.Op.Call{
......@@ -1199,7 +1175,6 @@ fn parseSuffixExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
11991175 if (try parseFnCallArguments(arena, it, tree)) |params| {
12001176 const call = try arena.create(Node.SuffixOp);
12011177 call.* = Node.SuffixOp{
1202 .base = Node{ .id = .SuffixOp },
12031178 .lhs = .{ .node = res },
12041179 .op = Node.SuffixOp.Op{
12051180 .Call = Node.SuffixOp.Op.Call{
......@@ -1248,7 +1223,6 @@ fn parsePrimaryTypeExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*N
12481223 if (eatToken(it, .CharLiteral)) |token| {
12491224 const node = try arena.create(Node.CharLiteral);
12501225 node.* = Node.CharLiteral{
1251 .base = Node{ .id = .CharLiteral },
12521226 .token = token,
12531227 };
12541228 return &node.base;
......@@ -1267,7 +1241,6 @@ fn parsePrimaryTypeExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*N
12671241 const expr = (try parseTypeExpr(arena, it, tree)) orelse return null;
12681242 const node = try arena.create(Node.Comptime);
12691243 node.* = Node.Comptime{
1270 .base = Node{ .id = .Comptime },
12711244 .doc_comments = null,
12721245 .comptime_token = token,
12731246 .expr = expr,
......@@ -1282,7 +1255,6 @@ fn parsePrimaryTypeExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*N
12821255 const global_error_set = try createLiteral(arena, Node.ErrorType, token);
12831256 const node = try arena.create(Node.InfixOp);
12841257 node.* = Node.InfixOp{
1285 .base = Node{ .id = .InfixOp },
12861258 .op_token = period,
12871259 .lhs = global_error_set,
12881260 .op = Node.InfixOp.Op.Period,
......@@ -1295,7 +1267,6 @@ fn parsePrimaryTypeExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*N
12951267 if (eatToken(it, .Keyword_anyframe)) |token| {
12961268 const node = try arena.create(Node.AnyFrameType);
12971269 node.* = Node.AnyFrameType{
1298 .base = Node{ .id = .AnyFrameType },
12991270 .anyframe_token = token,
13001271 .result = null,
13011272 };
......@@ -1337,7 +1308,6 @@ fn parseErrorSetDecl(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
13371308
13381309 const node = try arena.create(Node.ErrorSetDecl);
13391310 node.* = Node.ErrorSetDecl{
1340 .base = Node{ .id = .ErrorSetDecl },
13411311 .error_token = error_token,
13421312 .decls = decls,
13431313 .rbrace_token = rbrace,
......@@ -1355,7 +1325,6 @@ fn parseGroupedExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
13551325
13561326 const node = try arena.create(Node.GroupedExpression);
13571327 node.* = Node.GroupedExpression{
1358 .base = Node{ .id = .GroupedExpression },
13591328 .lparen = lparen,
13601329 .expr = expr,
13611330 .rparen = rparen,
......@@ -1438,7 +1407,6 @@ fn parseForTypeExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
14381407
14391408 const else_node = try arena.create(Node.Else);
14401409 else_node.* = Node.Else{
1441 .base = Node{ .id = .Else },
14421410 .else_token = else_token,
14431411 .payload = null,
14441412 .body = else_expr,
......@@ -1469,7 +1437,6 @@ fn parseWhileTypeExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Nod
14691437
14701438 const else_node = try arena.create(Node.Else);
14711439 else_node.* = Node.Else{
1472 .base = Node{ .id = .Else },
14731440 .else_token = else_token,
14741441 .payload = null,
14751442 .body = else_expr,
......@@ -1495,7 +1462,6 @@ fn parseSwitchExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
14951462
14961463 const node = try arena.create(Node.Switch);
14971464 node.* = Node.Switch{
1498 .base = Node{ .id = .Switch },
14991465 .switch_token = switch_token,
15001466 .expr = expr_node,
15011467 .cases = cases,
......@@ -1515,7 +1481,6 @@ fn parseAsmExpr(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
15151481
15161482 const node = try arena.create(Node.Asm);
15171483 node.* = Node.Asm{
1518 .base = Node{ .id = .Asm },
15191484 .asm_token = asm_token,
15201485 .volatile_token = volatile_token,
15211486 .template = template,
......@@ -1538,7 +1503,6 @@ fn parseAnonLiteral(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
15381503 if (eatToken(it, .Identifier)) |name| {
15391504 const node = try arena.create(Node.EnumLiteral);
15401505 node.* = Node.EnumLiteral{
1541 .base = Node{ .id = .EnumLiteral },
15421506 .dot = dot,
15431507 .name = name,
15441508 };
......@@ -1591,7 +1555,6 @@ fn parseAsmOutputItem(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Nod
15911555
15921556 const node = try arena.create(Node.AsmOutput);
15931557 node.* = Node.AsmOutput{
1594 .base = Node{ .id = .AsmOutput },
15951558 .lbracket = lbracket,
15961559 .symbolic_name = name,
15971560 .constraint = constraint,
......@@ -1628,7 +1591,6 @@ fn parseAsmInputItem(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
16281591
16291592 const node = try arena.create(Node.AsmInput);
16301593 node.* = Node.AsmInput{
1631 .base = Node{ .id = .AsmInput },
16321594 .lbracket = lbracket,
16331595 .symbolic_name = name,
16341596 .constraint = constraint,
......@@ -1687,7 +1649,6 @@ fn parseFieldInit(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
16871649
16881650 const node = try arena.create(Node.FieldInitializer);
16891651 node.* = Node.FieldInitializer{
1690 .base = Node{ .id = .FieldInitializer },
16911652 .period_token = period_token,
16921653 .name_token = name_token,
16931654 .expr = expr_node,
......@@ -1760,7 +1721,6 @@ fn parseParamDecl(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
17601721
17611722 const param_decl = try arena.create(Node.ParamDecl);
17621723 param_decl.* = Node.ParamDecl{
1763 .base = Node{ .id = .ParamDecl },
17641724 .doc_comments = doc_comments,
17651725 .comptime_token = comptime_token,
17661726 .noalias_token = noalias_token,
......@@ -1807,7 +1767,6 @@ fn parseIfPrefix(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
18071767
18081768 const node = try arena.create(Node.If);
18091769 node.* = Node.If{
1810 .base = Node{ .id = .If },
18111770 .if_token = if_token,
18121771 .condition = condition,
18131772 .payload = payload,
......@@ -1832,7 +1791,6 @@ fn parseWhilePrefix(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
18321791
18331792 const node = try arena.create(Node.While);
18341793 node.* = Node.While{
1835 .base = Node{ .id = .While },
18361794 .label = null,
18371795 .inline_token = null,
18381796 .while_token = while_token,
......@@ -1861,7 +1819,6 @@ fn parseForPrefix(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
18611819
18621820 const node = try arena.create(Node.For);
18631821 node.* = Node.For{
1864 .base = Node{ .id = .For },
18651822 .label = null,
18661823 .inline_token = null,
18671824 .for_token = for_token,
......@@ -1883,7 +1840,6 @@ fn parsePayload(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
18831840
18841841 const node = try arena.create(Node.Payload);
18851842 node.* = Node.Payload{
1886 .base = Node{ .id = .Payload },
18871843 .lpipe = lpipe,
18881844 .error_symbol = identifier,
18891845 .rpipe = rpipe,
......@@ -1902,7 +1858,6 @@ fn parsePtrPayload(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
19021858
19031859 const node = try arena.create(Node.PointerPayload);
19041860 node.* = Node.PointerPayload{
1905 .base = Node{ .id = .PointerPayload },
19061861 .lpipe = lpipe,
19071862 .ptr_token = asterisk,
19081863 .value_symbol = identifier,
......@@ -1930,7 +1885,6 @@ fn parsePtrIndexPayload(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*N
19301885
19311886 const node = try arena.create(Node.PointerIndexPayload);
19321887 node.* = Node.PointerIndexPayload{
1933 .base = Node{ .id = .PointerIndexPayload },
19341888 .lpipe = lpipe,
19351889 .ptr_token = asterisk,
19361890 .value_symbol = identifier,
......@@ -1972,7 +1926,6 @@ fn parseSwitchCase(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
19721926 } else if (eatToken(it, .Keyword_else)) |else_token| {
19731927 const else_node = try arena.create(Node.SwitchElse);
19741928 else_node.* = Node.SwitchElse{
1975 .base = Node{ .id = .SwitchElse },
19761929 .token = else_token,
19771930 };
19781931 try list.push(&else_node.base);
......@@ -1980,7 +1933,6 @@ fn parseSwitchCase(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
19801933
19811934 const node = try arena.create(Node.SwitchCase);
19821935 node.* = Node.SwitchCase{
1983 .base = Node{ .id = .SwitchCase },
19841936 .items = list,
19851937 .arrow_token = undefined, // set by caller
19861938 .payload = null,
......@@ -1999,7 +1951,6 @@ fn parseSwitchItem(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
19991951
20001952 const node = try arena.create(Node.InfixOp);
20011953 node.* = Node.InfixOp{
2002 .base = Node{ .id = .InfixOp },
20031954 .op_token = token,
20041955 .lhs = expr,
20051956 .op = Node.InfixOp.Op{ .Range = {} },
......@@ -2052,7 +2003,6 @@ fn parseAssignOp(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
20522003
20532004 const node = try arena.create(Node.InfixOp);
20542005 node.* = Node.InfixOp{
2055 .base = Node{ .id = .InfixOp },
20562006 .op_token = token.index,
20572007 .lhs = undefined, // set by caller
20582008 .op = op,
......@@ -2212,7 +2162,6 @@ fn parsePrefixOp(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
22122162
22132163 const node = try arena.create(Node.PrefixOp);
22142164 node.* = Node.PrefixOp{
2215 .base = Node{ .id = .PrefixOp },
22162165 .op_token = token.index,
22172166 .op = op,
22182167 .rhs = undefined,
......@@ -2236,7 +2185,6 @@ fn parsePrefixTypeOp(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
22362185 if (eatToken(it, .QuestionMark)) |token| {
22372186 const node = try arena.create(Node.PrefixOp);
22382187 node.* = Node.PrefixOp{
2239 .base = Node{ .id = .PrefixOp },
22402188 .op_token = token,
22412189 .op = Node.PrefixOp.Op.OptionalType,
22422190 .rhs = undefined, // set by caller
......@@ -2255,7 +2203,6 @@ fn parsePrefixTypeOp(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
22552203 };
22562204 const node = try arena.create(Node.AnyFrameType);
22572205 node.* = Node.AnyFrameType{
2258 .base = Node{ .id = .AnyFrameType },
22592206 .anyframe_token = token,
22602207 .result = Node.AnyFrameType.Result{
22612208 .arrow_token = arrow,
......@@ -2430,7 +2377,6 @@ fn parseSuffixOp(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
24302377 // this grammar rule be altered?
24312378 const node = try arena.create(Node.InfixOp);
24322379 node.* = Node.InfixOp{
2433 .base = Node{ .id = .InfixOp },
24342380 .op_token = period,
24352381 .lhs = undefined, // set by caller
24362382 .op = Node.InfixOp.Op.Period,
......@@ -2452,7 +2398,6 @@ fn parseSuffixOp(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
24522398
24532399 const node = try arena.create(Node.SuffixOp);
24542400 node.* = Node.SuffixOp{
2455 .base = Node{ .id = .SuffixOp },
24562401 .lhs = undefined, // set by caller
24572402 .op = op_and_token.op,
24582403 .rtoken = op_and_token.token,
......@@ -2506,7 +2451,6 @@ fn parseArrayTypeStart(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*No
25062451
25072452 const node = try arena.create(Node.PrefixOp);
25082453 node.* = Node.PrefixOp{
2509 .base = Node{ .id = .PrefixOp },
25102454 .op_token = lbracket,
25112455 .op = op,
25122456 .rhs = undefined, // set by caller
......@@ -2656,7 +2600,6 @@ fn parseContainerDeclType(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?
26562600
26572601 const node = try arena.create(Node.ContainerDecl);
26582602 node.* = Node.ContainerDecl{
2659 .base = Node{ .id = .ContainerDecl },
26602603 .layout_token = null,
26612604 .kind_token = kind_token.index,
26622605 .init_arg_expr = init_arg_expr,
......@@ -2729,7 +2672,6 @@ fn SimpleBinOpParseFn(comptime token: Token.Id, comptime op: Node.InfixOp.Op) No
27292672 const op_token = eatToken(it, token) orelse return null;
27302673 const node = try arena.create(Node.InfixOp);
27312674 node.* = Node.InfixOp{
2732 .base = Node{ .id = .InfixOp },
27332675 .op_token = op_token,
27342676 .lhs = undefined, // set by caller
27352677 .op = op,
......@@ -2752,7 +2694,6 @@ fn parseBuiltinCall(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
27522694 };
27532695 const node = try arena.create(Node.BuiltinCall);
27542696 node.* = Node.BuiltinCall{
2755 .base = Node{ .id = .BuiltinCall },
27562697 .builtin_token = token,
27572698 .params = params.list,
27582699 .rparen_token = params.rparen,
......@@ -2766,7 +2707,6 @@ fn parseErrorTag(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
27662707
27672708 const node = try arena.create(Node.ErrorTag);
27682709 node.* = Node.ErrorTag{
2769 .base = Node{ .id = .ErrorTag },
27702710 .doc_comments = doc_comments,
27712711 .name_token = token,
27722712 };
......@@ -2777,7 +2717,6 @@ fn parseIdentifier(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
27772717 const token = eatToken(it, .Identifier) orelse return null;
27782718 const node = try arena.create(Node.Identifier);
27792719 node.* = Node.Identifier{
2780 .base = Node{ .id = .Identifier },
27812720 .token = token,
27822721 };
27832722 return &node.base;
......@@ -2787,7 +2726,6 @@ fn parseVarType(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
27872726 const token = eatToken(it, .Keyword_var) orelse return null;
27882727 const node = try arena.create(Node.VarType);
27892728 node.* = Node.VarType{
2790 .base = Node{ .id = .VarType },
27912729 .token = token,
27922730 };
27932731 return &node.base;
......@@ -2807,7 +2745,6 @@ fn parseStringLiteral(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Nod
28072745 if (eatToken(it, .StringLiteral)) |token| {
28082746 const node = try arena.create(Node.StringLiteral);
28092747 node.* = Node.StringLiteral{
2810 .base = Node{ .id = .StringLiteral },
28112748 .token = token,
28122749 };
28132750 return &node.base;
......@@ -2816,7 +2753,6 @@ fn parseStringLiteral(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Nod
28162753 if (eatToken(it, .MultilineStringLiteralLine)) |first_line| {
28172754 const node = try arena.create(Node.MultilineStringLiteral);
28182755 node.* = Node.MultilineStringLiteral{
2819 .base = Node{ .id = .MultilineStringLiteral },
28202756 .lines = Node.MultilineStringLiteral.LineList.init(arena),
28212757 };
28222758 try node.lines.push(first_line);
......@@ -2833,7 +2769,6 @@ fn parseIntegerLiteral(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*No
28332769 const token = eatToken(it, .IntegerLiteral) orelse return null;
28342770 const node = try arena.create(Node.IntegerLiteral);
28352771 node.* = Node.IntegerLiteral{
2836 .base = Node{ .id = .IntegerLiteral },
28372772 .token = token,
28382773 };
28392774 return &node.base;
......@@ -2843,7 +2778,6 @@ fn parseFloatLiteral(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node
28432778 const token = eatToken(it, .FloatLiteral) orelse return null;
28442779 const node = try arena.create(Node.FloatLiteral);
28452780 node.* = Node.FloatLiteral{
2846 .base = Node{ .id = .FloatLiteral },
28472781 .token = token,
28482782 };
28492783 return &node.base;
......@@ -2853,7 +2787,6 @@ fn parseTry(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
28532787 const token = eatToken(it, .Keyword_try) orelse return null;
28542788 const node = try arena.create(Node.PrefixOp);
28552789 node.* = Node.PrefixOp{
2856 .base = Node{ .id = .PrefixOp },
28572790 .op_token = token,
28582791 .op = Node.PrefixOp.Op.Try,
28592792 .rhs = undefined, // set by caller
......@@ -2865,7 +2798,6 @@ fn parseUse(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
28652798 const token = eatToken(it, .Keyword_usingnamespace) orelse return null;
28662799 const node = try arena.create(Node.Use);
28672800 node.* = Node.Use{
2868 .base = Node{ .id = .Use },
28692801 .doc_comments = null,
28702802 .visib_token = null,
28712803 .use_token = token,
......@@ -2891,7 +2823,6 @@ fn parseIf(arena: *Allocator, it: *TokenIterator, tree: *Tree, bodyParseFn: Node
28912823 });
28922824 const else_node = try arena.create(Node.Else);
28932825 else_node.* = Node.Else{
2894 .base = Node{ .id = .Else },
28952826 .else_token = else_token,
28962827 .payload = payload,
28972828 .body = else_expr,
......@@ -2912,7 +2843,6 @@ fn parseDocComment(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node.D
29122843
29132844 const node = try arena.create(Node.DocComment);
29142845 node.* = Node.DocComment{
2915 .base = Node{ .id = .DocComment },
29162846 .lines = lines,
29172847 };
29182848 return node;
......@@ -2924,7 +2854,6 @@ fn parseAppendedDocComment(arena: *Allocator, it: *TokenIterator, tree: *Tree, a
29242854 if (tree.tokensOnSameLine(after_token, comment_token)) {
29252855 const node = try arena.create(Node.DocComment);
29262856 node.* = Node.DocComment{
2927 .base = Node{ .id = .DocComment },
29282857 .lines = Node.DocComment.LineList.init(arena),
29292858 };
29302859 try node.lines.push(comment_token);
......@@ -3031,7 +2960,6 @@ fn parseBinOpExpr(
30312960fn createInfixOp(arena: *Allocator, index: TokenIndex, op: Node.InfixOp.Op) !*Node {
30322961 const node = try arena.create(Node.InfixOp);
30332962 node.* = Node.InfixOp{
3034 .base = Node{ .id = .InfixOp },
30352963 .op_token = index,
30362964 .lhs = undefined,
30372965 .op = op,
src-self-hosted/translate_c.zig-24
......@@ -381,7 +381,6 @@ fn visitVarDecl(c: *Context, var_decl: *const ZigClangVarDecl) Error!void {
381381
382382 const node = try c.a().create(ast.Node.VarDecl);
383383 node.* = ast.Node.VarDecl{
384 .base = ast.Node{ .id = .VarDecl },
385384 .doc_comments = null,
386385 .visib_token = visib_tok,
387386 .thread_local_token = thread_local_token,
......@@ -421,7 +420,6 @@ fn resolveTypeDef(c: *Context, typedef_decl: *const ZigClangTypedefNameDecl) Err
421420
422421 const node = try c.a().create(ast.Node.VarDecl);
423422 node.* = ast.Node.VarDecl{
424 .base = ast.Node{ .id = .VarDecl },
425423 .doc_comments = null,
426424 .visib_token = visib_tok,
427425 .thread_local_token = null,
......@@ -473,7 +471,6 @@ fn resolveRecordDecl(c: *Context, record_decl: *const ZigClangRecordDecl) Error!
473471
474472 const node = try c.a().create(ast.Node.VarDecl);
475473 node.* = ast.Node.VarDecl{
476 .base = ast.Node{ .id = .VarDecl },
477474 .doc_comments = null,
478475 .visib_token = visib_tok,
479476 .thread_local_token = null,
......@@ -504,7 +501,6 @@ fn createAlias(c: *Context, alias: var) !void {
504501
505502 const node = try c.a().create(ast.Node.VarDecl);
506503 node.* = ast.Node.VarDecl{
507 .base = ast.Node{ .id = .VarDecl },
508504 .doc_comments = null,
509505 .visib_token = visib_tok,
510506 .thread_local_token = null,
......@@ -810,7 +806,6 @@ fn transDeclStmt(rp: RestorePoint, parent_scope: *Scope, stmt: *const ZigClangDe
810806
811807 const node = try c.a().create(ast.Node.VarDecl);
812808 node.* = ast.Node.VarDecl{
813 .base = ast.Node{ .id = .VarDecl },
814809 .doc_comments = null,
815810 .visib_token = null,
816811 .thread_local_token = thread_local_token,
......@@ -978,7 +973,6 @@ fn transStringLiteral(
978973 const token = try appendToken(rp.c, .StringLiteral, buf);
979974 const node = try rp.c.a().create(ast.Node.StringLiteral);
980975 node.* = ast.Node.StringLiteral{
981 .base = ast.Node{ .id = .StringLiteral },
982976 .token = token,
983977 };
984978 const res = TransResult{
......@@ -1145,7 +1139,6 @@ fn transInitListExpr(
11451139 const mul_tok = try appendToken(rp.c, .AsteriskAsterisk, "**");
11461140 const mul_node = try rp.c.a().create(ast.Node.InfixOp);
11471141 mul_node.* = .{
1148 .base = .{ .id = .InfixOp },
11491142 .op_token = mul_tok,
11501143 .lhs = &filler_init_node.base,
11511144 .op = .ArrayMult,
......@@ -1164,7 +1157,6 @@ fn transInitListExpr(
11641157
11651158 const cat_node = try rp.c.a().create(ast.Node.InfixOp);
11661159 cat_node.* = .{
1167 .base = .{ .id = .InfixOp },
11681160 .op_token = cat_tok,
11691161 .lhs = &init_node.base,
11701162 .op = .ArrayCat,
......@@ -1296,7 +1288,6 @@ fn maybeSuppressResult(
12961288 const op_token = try appendToken(rp.c, .Equal, "=");
12971289 const op_node = try rp.c.a().create(ast.Node.InfixOp);
12981290 op_node.* = ast.Node.InfixOp{
1299 .base = ast.Node{ .id = .InfixOp },
13001291 .op_token = op_token,
13011292 .lhs = lhs,
13021293 .op = .Assign,
......@@ -1352,7 +1343,6 @@ fn transRecordDecl(c: *Context, record_decl: *const ZigClangRecordDecl) TypeErro
13521343
13531344 const container_node = try c.a().create(ast.Node.ContainerDecl);
13541345 container_node.* = .{
1355 .base = ast.Node{ .id = .ContainerDecl },
13561346 .layout_token = extern_tok,
13571347 .kind_token = container_tok,
13581348 .init_arg_expr = .None,
......@@ -1523,7 +1513,6 @@ fn transCreateNodeAssign(
15231513
15241514 const node = try rp.c.a().create(ast.Node.InfixOp);
15251515 node.* = ast.Node.InfixOp{
1526 .base = ast.Node{ .id = .InfixOp },
15271516 .op_token = eq_token,
15281517 .lhs = lhs_node.node,
15291518 .op = .Assign,
......@@ -1553,7 +1542,6 @@ fn transCreateNodeBuiltinFnCall(c: *Context, name: []const u8) !*ast.Node.Builti
15531542 _ = try appendToken(c, .LParen, "(");
15541543 const node = try c.a().create(ast.Node.BuiltinCall);
15551544 node.* = ast.Node.BuiltinCall{
1556 .base = ast.Node{ .id = .BuiltinCall },
15571545 .builtin_token = builtin_token,
15581546 .params = ast.Node.BuiltinCall.ParamList.init(c.a()),
15591547 .rparen_token = undefined, // set after appending args
......@@ -1565,7 +1553,6 @@ fn transCreateNodeFnCall(c: *Context, fn_expr: *ast.Node) !*ast.Node.SuffixOp {
15651553 _ = try appendToken(c, .LParen, "(");
15661554 const node = try c.a().create(ast.Node.SuffixOp);
15671555 node.* = ast.Node.SuffixOp{
1568 .base = ast.Node{ .id = .SuffixOp },
15691556 .lhs = fn_expr,
15701557 .op = ast.Node.SuffixOp.Op{
15711558 .Call = ast.Node.SuffixOp.Op.Call{
......@@ -1586,7 +1573,6 @@ fn transCreateNodePrefixOp(
15861573) !*ast.Node.PrefixOp {
15871574 const node = try c.a().create(ast.Node.PrefixOp);
15881575 node.* = ast.Node.PrefixOp{
1589 .base = ast.Node{ .id = .PrefixOp },
15901576 .op_token = try appendToken(c, op_tok_id, bytes),
15911577 .op = op,
15921578 .rhs = undefined, // translate and set afterward
......@@ -1609,7 +1595,6 @@ fn transCreateNodeInfixOp(
16091595 const rhs = try transExpr(rp, scope, ZigClangBinaryOperator_getRHS(stmt), .used, .r_value);
16101596 const node = try rp.c.a().create(ast.Node.InfixOp);
16111597 node.* = ast.Node.InfixOp{
1612 .base = ast.Node{ .id = .InfixOp },
16131598 .op_token = op_token,
16141599 .lhs = lhs.node,
16151600 .op = op,
......@@ -1619,7 +1604,6 @@ fn transCreateNodeInfixOp(
16191604 const rparen = try appendToken(rp.c, .RParen, ")");
16201605 const grouped_expr = try rp.c.a().create(ast.Node.GroupedExpression);
16211606 grouped_expr.* = ast.Node.GroupedExpression{
1622 .base = ast.Node{ .id = .GroupedExpression },
16231607 .lparen = lparen,
16241608 .expr = &node.base,
16251609 .rparen = rparen,
......@@ -1652,7 +1636,6 @@ fn transCreateNodePtrType(
16521636 else => unreachable,
16531637 };
16541638 node.* = ast.Node.PrefixOp{
1655 .base = ast.Node{ .id = .PrefixOp },
16561639 .op_token = op_token,
16571640 .op = ast.Node.PrefixOp.Op{
16581641 .PtrType = .{
......@@ -1679,7 +1662,6 @@ fn transCreateNodeAPInt(c: *Context, int: ?*const ZigClangAPSInt) !*ast.Node {
16791662 const token = try appendToken(c, .IntegerLiteral, str);
16801663 const node = try c.a().create(ast.Node.IntegerLiteral);
16811664 node.* = ast.Node.IntegerLiteral{
1682 .base = ast.Node{ .id = .IntegerLiteral },
16831665 .token = token,
16841666 };
16851667 return &node.base;
......@@ -1689,7 +1671,6 @@ fn transCreateNodeReturnExpr(c: *Context) !*ast.Node {
16891671 const ltoken = try appendToken(c, .Keyword_return, "return");
16901672 const node = try c.a().create(ast.Node.ControlFlowExpression);
16911673 node.* = ast.Node.ControlFlowExpression{
1692 .base = ast.Node{ .id = .ControlFlowExpression },
16931674 .ltoken = ltoken,
16941675 .kind = .Return,
16951676 .rhs = null,
......@@ -1701,7 +1682,6 @@ fn transCreateNodeUndefinedLiteral(c: *Context) !*ast.Node {
17011682 const token = try appendToken(c, .Keyword_undefined, "undefined");
17021683 const node = try c.a().create(ast.Node.UndefinedLiteral);
17031684 node.* = ast.Node.UndefinedLiteral{
1704 .base = ast.Node{ .id = .UndefinedLiteral },
17051685 .token = token,
17061686 };
17071687 return &node.base;
......@@ -1711,7 +1691,6 @@ fn transCreateNodeNullLiteral(c: *Context) !*ast.Node {
17111691 const token = try appendToken(c, .Keyword_null, "null");
17121692 const node = try c.a().create(ast.Node.NullLiteral);
17131693 node.* = ast.Node.NullLiteral{
1714 .base = ast.Node{ .id = .NullLiteral },
17151694 .token = token,
17161695 };
17171696 return &node.base;
......@@ -1724,7 +1703,6 @@ fn transCreateNodeBoolLiteral(c: *Context, value: bool) !*ast.Node {
17241703 try appendToken(c, .Keyword_false, "false");
17251704 const node = try c.a().create(ast.Node.BoolLiteral);
17261705 node.* = ast.Node.BoolLiteral{
1727 .base = ast.Node{ .id = .BoolLiteral },
17281706 .token = token,
17291707 };
17301708 return &node.base;
......@@ -1734,7 +1712,6 @@ fn transCreateNodeArrayInitializer(c: *Context, dot_tok: ast.TokenIndex) !*ast.N
17341712 _ = try appendToken(c, .LBrace, "{");
17351713 const node = try c.a().create(ast.Node.SuffixOp);
17361714 node.* = ast.Node.SuffixOp{
1737 .base = ast.Node{ .id = .SuffixOp },
17381715 .lhs = .{ .dot = dot_tok },
17391716 .op = .{
17401717 .ArrayInitializer = ast.Node.SuffixOp.Op.InitList.init(c.a()),
......@@ -1748,7 +1725,6 @@ fn transCreateNodeInt(c: *Context, int: var) !*ast.Node {
17481725 const token = try appendTokenFmt(c, .IntegerLiteral, "{}", .{int});
17491726 const node = try c.a().create(ast.Node.IntegerLiteral);
17501727 node.* = ast.Node.IntegerLiteral{
1751 .base = ast.Node{ .id = .IntegerLiteral },
17521728 .token = token,
17531729 };
17541730 return &node.base;