authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-02-12 01:38:10+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-02-12 02:12:43+02:00
logbb22490fcc8ed7c96d665242cd18934f9d547555
tree5703427c6d2830c87b001fdd8b57fbb63a22a46b
parente2289961c6b53451e5bdcdfb6eec27e27f6553ca
signaturelock-open Commit is signed but in an unrecognized format.

snake_case Node.Tag


3 files changed, 1003 insertions(+), 1003 deletions(-)

lib/std/zig/ast.zig+576-576
...@@ -199,148 +199,148 @@ pub const Tree = struct {...@@ -199,148 +199,148 @@ pub const Tree = struct {
199 var end_offset: TokenIndex = 0;199 var end_offset: TokenIndex = 0;
200 var n = node;200 var n = node;
201 while (true) switch (tags[n]) {201 while (true) switch (tags[n]) {
202 .Root => return 0,202 .root => return 0,
203203
204 .UsingNamespace,204 .@"usingnamespace",
205 .TestDecl,205 .test_decl,
206 .ErrDefer,206 .@"errdefer",
207 .Defer,207 .@"defer",
208 .BoolNot,208 .bool_not,
209 .Negation,209 .negation,
210 .BitNot,210 .bit_not,
211 .NegationWrap,211 .negation_wrap,
212 .AddressOf,212 .address_of,
213 .Try,213 .@"try",
214 .Await,214 .@"await",
215 .OptionalType,215 .optional_type,
216 .Switch,216 .@"switch",
217 .SwitchComma,217 .switch_comma,
218 .IfSimple,218 .if_simple,
219 .If,219 .@"if",
220 .Suspend,220 .@"suspend",
221 .Resume,221 .@"resume",
222 .Continue,222 .@"continue",
223 .Break,223 .@"break",
224 .Return,224 .@"return",
225 .AnyFrameType,225 .anyframe_type,
226 .Identifier,226 .identifier,
227 .AnyFrameLiteral,227 .anyframe_literal,
228 .CharLiteral,228 .char_literal,
229 .IntegerLiteral,229 .integer_literal,
230 .FloatLiteral,230 .float_literal,
231 .FalseLiteral,231 .false_literal,
232 .TrueLiteral,232 .true_literal,
233 .NullLiteral,233 .null_literal,
234 .UndefinedLiteral,234 .undefined_literal,
235 .UnreachableLiteral,235 .unreachable_literal,
236 .StringLiteral,236 .string_literal,
237 .GroupedExpression,237 .grouped_expression,
238 .BuiltinCallTwo,238 .builtin_call_two,
239 .BuiltinCallTwoComma,239 .builtin_call_two_comma,
240 .BuiltinCall,240 .builtin_call,
241 .BuiltinCallComma,241 .builtin_call_comma,
242 .ErrorSetDecl,242 .error_set_decl,
243 .AnyType,243 .@"anytype",
244 .Comptime,244 .@"comptime",
245 .Nosuspend,245 .@"nosuspend",
246 .AsmSimple,246 .asm_simple,
247 .Asm,247 .@"asm",
248 .FnProtoSimple,248 .fn_proto_simple,
249 .FnProtoMulti,249 .fn_proto_multi,
250 .FnProtoOne,250 .fn_proto_one,
251 .FnProto,251 .fn_proto,
252 .ArrayType,252 .array_type,
253 .ArrayTypeSentinel,253 .array_type_sentinel,
254 .ErrorValue,254 .error_value,
255 => return main_tokens[n] - end_offset,255 => return main_tokens[n] - end_offset,
256256
257 .ArrayInitDot,257 .array_init_dot,
258 .ArrayInitDotComma,258 .array_init_dot_comma,
259 .ArrayInitDotTwo,259 .array_init_dot_two,
260 .ArrayInitDotTwoComma,260 .array_init_dot_two_comma,
261 .StructInitDot,261 .struct_init_dot,
262 .StructInitDotComma,262 .struct_init_dot_comma,
263 .StructInitDotTwo,263 .struct_init_dot_two,
264 .StructInitDotTwoComma,264 .struct_init_dot_two_comma,
265 .EnumLiteral,265 .enum_literal,
266 => return main_tokens[n] - 1 - end_offset,266 => return main_tokens[n] - 1 - end_offset,
267267
268 .Catch,268 .@"catch",
269 .FieldAccess,269 .field_access,
270 .UnwrapOptional,270 .unwrap_optional,
271 .EqualEqual,271 .equal_equal,
272 .BangEqual,272 .bang_equal,
273 .LessThan,273 .less_than,
274 .GreaterThan,274 .greater_than,
275 .LessOrEqual,275 .less_or_equal,
276 .GreaterOrEqual,276 .greater_or_equal,
277 .AssignMul,277 .assign_mul,
278 .AssignDiv,278 .assign_div,
279 .AssignMod,279 .assign_mod,
280 .AssignAdd,280 .assign_add,
281 .AssignSub,281 .assign_sub,
282 .AssignBitShiftLeft,282 .assign_bit_shift_left,
283 .AssignBitShiftRight,283 .assign_bit_shift_right,
284 .AssignBitAnd,284 .assign_bit_and,
285 .AssignBitXor,285 .assign_bit_xor,
286 .AssignBitOr,286 .assign_bit_or,
287 .AssignMulWrap,287 .assign_mul_wrap,
288 .AssignAddWrap,288 .assign_add_wrap,
289 .AssignSubWrap,289 .assign_sub_wrap,
290 .Assign,290 .assign,
291 .MergeErrorSets,291 .merge_error_sets,
292 .Mul,292 .mul,
293 .Div,293 .div,
294 .Mod,294 .mod,
295 .ArrayMult,295 .array_mult,
296 .MulWrap,296 .mul_wrap,
297 .Add,297 .add,
298 .Sub,298 .sub,
299 .ArrayCat,299 .array_cat,
300 .AddWrap,300 .add_wrap,
301 .SubWrap,301 .sub_wrap,
302 .BitShiftLeft,302 .bit_shift_left,
303 .BitShiftRight,303 .bit_shift_right,
304 .BitAnd,304 .bit_and,
305 .BitXor,305 .bit_xor,
306 .BitOr,306 .bit_or,
307 .OrElse,307 .@"orelse",
308 .BoolAnd,308 .bool_and,
309 .BoolOr,309 .bool_or,
310 .SliceOpen,310 .slice_open,
311 .Slice,311 .slice,
312 .SliceSentinel,312 .slice_sentinel,
313 .Deref,313 .deref,
314 .ArrayAccess,314 .array_access,
315 .ArrayInitOne,315 .array_init_one,
316 .ArrayInitOneComma,316 .array_init_one_comma,
317 .ArrayInit,317 .array_init,
318 .ArrayInitComma,318 .array_init_comma,
319 .StructInitOne,319 .struct_init_one,
320 .StructInitOneComma,320 .struct_init_one_comma,
321 .StructInit,321 .struct_init,
322 .StructInitComma,322 .struct_init_comma,
323 .CallOne,323 .call_one,
324 .CallOneComma,324 .call_one_comma,
325 .Call,325 .call,
326 .CallComma,326 .call_comma,
327 .SwitchRange,327 .switch_range,
328 .FnDecl,328 .fn_decl,
329 .ErrorUnion,329 .error_union,
330 => n = datas[n].lhs,330 => n = datas[n].lhs,
331331
332 .AsyncCallOne,332 .async_call_one,
333 .AsyncCallOneComma,333 .async_call_one_comma,
334 .AsyncCall,334 .async_call,
335 .AsyncCallComma,335 .async_call_comma,
336 => {336 => {
337 end_offset += 1; // async token337 end_offset += 1; // async token
338 n = datas[n].lhs;338 n = datas[n].lhs;
339 },339 },
340340
341 .ContainerFieldInit,341 .container_field_init,
342 .ContainerFieldAlign,342 .container_field_align,
343 .ContainerField,343 .container_field,
344 => {344 => {
345 const name_token = main_tokens[n];345 const name_token = main_tokens[n];
346 if (name_token > 0 and token_tags[name_token - 1] == .keyword_comptime) {346 if (name_token > 0 and token_tags[name_token - 1] == .keyword_comptime) {
...@@ -349,10 +349,10 @@ pub const Tree = struct {...@@ -349,10 +349,10 @@ pub const Tree = struct {
349 return name_token - end_offset;349 return name_token - end_offset;
350 },350 },
351351
352 .GlobalVarDecl,352 .global_var_decl,
353 .LocalVarDecl,353 .local_var_decl,
354 .SimpleVarDecl,354 .simple_var_decl,
355 .AlignedVarDecl,355 .aligned_var_decl,
356 => {356 => {
357 var i = main_tokens[n]; // mut token357 var i = main_tokens[n]; // mut token
358 while (i > 0) {358 while (i > 0) {
...@@ -372,10 +372,10 @@ pub const Tree = struct {...@@ -372,10 +372,10 @@ pub const Tree = struct {
372 return i - end_offset;372 return i - end_offset;
373 },373 },
374374
375 .Block,375 .block,
376 .BlockSemicolon,376 .block_semicolon,
377 .BlockTwo,377 .block_two,
378 .BlockTwoSemicolon,378 .block_two_semicolon,
379 => {379 => {
380 // Look for a label.380 // Look for a label.
381 const lbrace = main_tokens[n];381 const lbrace = main_tokens[n];
...@@ -385,18 +385,18 @@ pub const Tree = struct {...@@ -385,18 +385,18 @@ pub const Tree = struct {
385 return lbrace - end_offset;385 return lbrace - end_offset;
386 },386 },
387387
388 .ContainerDecl,388 .container_decl,
389 .ContainerDeclComma,389 .container_decl_comma,
390 .ContainerDeclTwo,390 .container_decl_two,
391 .ContainerDeclTwoComma,391 .container_decl_two_comma,
392 .ContainerDeclArg,392 .container_decl_arg,
393 .ContainerDeclArgComma,393 .container_decl_arg_comma,
394 .TaggedUnion,394 .tagged_union,
395 .TaggedUnionComma,395 .tagged_union_comma,
396 .TaggedUnionTwo,396 .tagged_union_two,
397 .TaggedUnionTwoComma,397 .tagged_union_two_comma,
398 .TaggedUnionEnumTag,398 .tagged_union_enum_tag,
399 .TaggedUnionEnumTagComma,399 .tagged_union_enum_tag_comma,
400 => {400 => {
401 const main_token = main_tokens[n];401 const main_token = main_tokens[n];
402 switch (token_tags[main_token - 1]) {402 switch (token_tags[main_token - 1]) {
...@@ -406,10 +406,10 @@ pub const Tree = struct {...@@ -406,10 +406,10 @@ pub const Tree = struct {
406 return main_token - end_offset;406 return main_token - end_offset;
407 },407 },
408408
409 .PtrTypeAligned,409 .ptr_type_aligned,
410 .PtrTypeSentinel,410 .ptr_type_sentinel,
411 .PtrType,411 .ptr_type,
412 .PtrTypeBitRange,412 .ptr_type_bit_range,
413 => {413 => {
414 const main_token = main_tokens[n];414 const main_token = main_tokens[n];
415 return switch (token_tags[main_token]) {415 return switch (token_tags[main_token]) {
...@@ -424,29 +424,29 @@ pub const Tree = struct {...@@ -424,29 +424,29 @@ pub const Tree = struct {
424 } - end_offset;424 } - end_offset;
425 },425 },
426426
427 .SwitchCaseOne => {427 .switch_case_one => {
428 if (datas[n].lhs == 0) {428 if (datas[n].lhs == 0) {
429 return main_tokens[n] - 1 - end_offset; // else token429 return main_tokens[n] - 1 - end_offset; // else token
430 } else {430 } else {
431 n = datas[n].lhs;431 n = datas[n].lhs;
432 }432 }
433 },433 },
434 .SwitchCase => {434 .switch_case => {
435 const extra = tree.extraData(datas[n].lhs, Node.SubRange);435 const extra = tree.extraData(datas[n].lhs, Node.SubRange);
436 assert(extra.end - extra.start > 0);436 assert(extra.end - extra.start > 0);
437 n = extra.start;437 n = extra.start;
438 },438 },
439439
440 .AsmOutput, .AsmInput => {440 .asm_output, .asm_input => {
441 assert(token_tags[main_tokens[n] - 1] == .l_bracket);441 assert(token_tags[main_tokens[n] - 1] == .l_bracket);
442 return main_tokens[n] - 1 - end_offset;442 return main_tokens[n] - 1 - end_offset;
443 },443 },
444444
445 .WhileSimple,445 .while_simple,
446 .WhileCont,446 .while_cont,
447 .While,447 .@"while",
448 .ForSimple,448 .for_simple,
449 .For,449 .@"for",
450 => {450 => {
451 const main_token = main_tokens[n];451 const main_token = main_tokens[n];
452 return switch (token_tags[main_token - 1]) {452 return switch (token_tags[main_token - 1]) {
...@@ -465,115 +465,115 @@ pub const Tree = struct {...@@ -465,115 +465,115 @@ pub const Tree = struct {
465 var n = node;465 var n = node;
466 var end_offset: TokenIndex = 0;466 var end_offset: TokenIndex = 0;
467 while (true) switch (tags[n]) {467 while (true) switch (tags[n]) {
468 .Root => return @intCast(TokenIndex, tree.tokens.len - 1),468 .root => return @intCast(TokenIndex, tree.tokens.len - 1),
469469
470 .UsingNamespace,470 .@"usingnamespace",
471 .BoolNot,471 .bool_not,
472 .Negation,472 .negation,
473 .BitNot,473 .bit_not,
474 .NegationWrap,474 .negation_wrap,
475 .AddressOf,475 .address_of,
476 .Try,476 .@"try",
477 .Await,477 .@"await",
478 .OptionalType,478 .optional_type,
479 .Resume,479 .@"resume",
480 .Nosuspend,480 .@"nosuspend",
481 .Comptime,481 .@"comptime",
482 => n = datas[n].lhs,482 => n = datas[n].lhs,
483483
484 .TestDecl,484 .test_decl,
485 .ErrDefer,485 .@"errdefer",
486 .Defer,486 .@"defer",
487 .Catch,487 .@"catch",
488 .EqualEqual,488 .equal_equal,
489 .BangEqual,489 .bang_equal,
490 .LessThan,490 .less_than,
491 .GreaterThan,491 .greater_than,
492 .LessOrEqual,492 .less_or_equal,
493 .GreaterOrEqual,493 .greater_or_equal,
494 .AssignMul,494 .assign_mul,
495 .AssignDiv,495 .assign_div,
496 .AssignMod,496 .assign_mod,
497 .AssignAdd,497 .assign_add,
498 .AssignSub,498 .assign_sub,
499 .AssignBitShiftLeft,499 .assign_bit_shift_left,
500 .AssignBitShiftRight,500 .assign_bit_shift_right,
501 .AssignBitAnd,501 .assign_bit_and,
502 .AssignBitXor,502 .assign_bit_xor,
503 .AssignBitOr,503 .assign_bit_or,
504 .AssignMulWrap,504 .assign_mul_wrap,
505 .AssignAddWrap,505 .assign_add_wrap,
506 .AssignSubWrap,506 .assign_sub_wrap,
507 .Assign,507 .assign,
508 .MergeErrorSets,508 .merge_error_sets,
509 .Mul,509 .mul,
510 .Div,510 .div,
511 .Mod,511 .mod,
512 .ArrayMult,512 .array_mult,
513 .MulWrap,513 .mul_wrap,
514 .Add,514 .add,
515 .Sub,515 .sub,
516 .ArrayCat,516 .array_cat,
517 .AddWrap,517 .add_wrap,
518 .SubWrap,518 .sub_wrap,
519 .BitShiftLeft,519 .bit_shift_left,
520 .BitShiftRight,520 .bit_shift_right,
521 .BitAnd,521 .bit_and,
522 .BitXor,522 .bit_xor,
523 .BitOr,523 .bit_or,
524 .OrElse,524 .@"orelse",
525 .BoolAnd,525 .bool_and,
526 .BoolOr,526 .bool_or,
527 .AnyFrameType,527 .anyframe_type,
528 .ErrorUnion,528 .error_union,
529 .IfSimple,529 .if_simple,
530 .WhileSimple,530 .while_simple,
531 .ForSimple,531 .for_simple,
532 .FnProtoSimple,532 .fn_proto_simple,
533 .FnProtoMulti,533 .fn_proto_multi,
534 .PtrTypeAligned,534 .ptr_type_aligned,
535 .PtrTypeSentinel,535 .ptr_type_sentinel,
536 .PtrType,536 .ptr_type,
537 .PtrTypeBitRange,537 .ptr_type_bit_range,
538 .ArrayType,538 .array_type,
539 .SwitchCaseOne,539 .switch_case_one,
540 .SwitchCase,540 .switch_case,
541 .SwitchRange,541 .switch_range,
542 => n = datas[n].rhs,542 => n = datas[n].rhs,
543543
544 .FieldAccess,544 .field_access,
545 .UnwrapOptional,545 .unwrap_optional,
546 .GroupedExpression,546 .grouped_expression,
547 .StringLiteral,547 .string_literal,
548 .ErrorSetDecl,548 .error_set_decl,
549 .AsmSimple,549 .asm_simple,
550 .AsmOutput,550 .asm_output,
551 .AsmInput,551 .asm_input,
552 .ErrorValue,552 .error_value,
553 => return datas[n].rhs + end_offset,553 => return datas[n].rhs + end_offset,
554554
555 .AnyType,555 .@"anytype",
556 .AnyFrameLiteral,556 .anyframe_literal,
557 .CharLiteral,557 .char_literal,
558 .IntegerLiteral,558 .integer_literal,
559 .FloatLiteral,559 .float_literal,
560 .FalseLiteral,560 .false_literal,
561 .TrueLiteral,561 .true_literal,
562 .NullLiteral,562 .null_literal,
563 .UndefinedLiteral,563 .undefined_literal,
564 .UnreachableLiteral,564 .unreachable_literal,
565 .Identifier,565 .identifier,
566 .Deref,566 .deref,
567 .EnumLiteral,567 .enum_literal,
568 => return main_tokens[n] + end_offset,568 => return main_tokens[n] + end_offset,
569569
570 .Return => if (datas[n].lhs != 0) {570 .@"return" => if (datas[n].lhs != 0) {
571 n = datas[n].lhs;571 n = datas[n].lhs;
572 } else {572 } else {
573 return main_tokens[n] + end_offset;573 return main_tokens[n] + end_offset;
574 },574 },
575575
576 .Call, .AsyncCall => {576 .call, .async_call => {
577 end_offset += 1; // for the rparen577 end_offset += 1; // for the rparen
578 const params = tree.extraData(datas[n].rhs, Node.SubRange);578 const params = tree.extraData(datas[n].rhs, Node.SubRange);
579 if (params.end - params.start == 0) {579 if (params.end - params.start == 0) {
...@@ -581,7 +581,7 @@ pub const Tree = struct {...@@ -581,7 +581,7 @@ pub const Tree = struct {
581 }581 }
582 n = tree.extra_data[params.end - 1]; // last parameter582 n = tree.extra_data[params.end - 1]; // last parameter
583 },583 },
584 .TaggedUnionEnumTag => {584 .tagged_union_enum_tag => {
585 const members = tree.extraData(datas[n].rhs, Node.SubRange);585 const members = tree.extraData(datas[n].rhs, Node.SubRange);
586 if (members.end - members.start == 0) {586 if (members.end - members.start == 0) {
587 end_offset += 4; // for the rparen + rparen + lbrace + rbrace587 end_offset += 4; // for the rparen + rparen + lbrace + rbrace
...@@ -591,16 +591,16 @@ pub const Tree = struct {...@@ -591,16 +591,16 @@ pub const Tree = struct {
591 n = tree.extra_data[members.end - 1]; // last parameter591 n = tree.extra_data[members.end - 1]; // last parameter
592 }592 }
593 },593 },
594 .CallComma,594 .call_comma,
595 .AsyncCallComma,595 .async_call_comma,
596 .TaggedUnionEnumTagComma,596 .tagged_union_enum_tag_comma,
597 => {597 => {
598 end_offset += 2; // for the comma + rparen/rbrace598 end_offset += 2; // for the comma + rparen/rbrace
599 const params = tree.extraData(datas[n].rhs, Node.SubRange);599 const params = tree.extraData(datas[n].rhs, Node.SubRange);
600 assert(params.end > params.start);600 assert(params.end > params.start);
601 n = tree.extra_data[params.end - 1]; // last parameter601 n = tree.extra_data[params.end - 1]; // last parameter
602 },602 },
603 .Switch => {603 .@"switch" => {
604 const cases = tree.extraData(datas[n].rhs, Node.SubRange);604 const cases = tree.extraData(datas[n].rhs, Node.SubRange);
605 if (cases.end - cases.start == 0) {605 if (cases.end - cases.start == 0) {
606 end_offset += 3; // rparen, lbrace, rbrace606 end_offset += 3; // rparen, lbrace, rbrace
...@@ -610,7 +610,7 @@ pub const Tree = struct {...@@ -610,7 +610,7 @@ pub const Tree = struct {
610 n = tree.extra_data[cases.end - 1]; // last case610 n = tree.extra_data[cases.end - 1]; // last case
611 }611 }
612 },612 },
613 .ContainerDeclArg => {613 .container_decl_arg => {
614 const members = tree.extraData(datas[n].rhs, Node.SubRange);614 const members = tree.extraData(datas[n].rhs, Node.SubRange);
615 if (members.end - members.start == 0) {615 if (members.end - members.start == 0) {
616 end_offset += 1; // for the rparen616 end_offset += 1; // for the rparen
...@@ -620,53 +620,53 @@ pub const Tree = struct {...@@ -620,53 +620,53 @@ pub const Tree = struct {
620 n = tree.extra_data[members.end - 1]; // last parameter620 n = tree.extra_data[members.end - 1]; // last parameter
621 }621 }
622 },622 },
623 .Asm => {623 .@"asm" => {
624 const extra = tree.extraData(datas[n].rhs, Node.Asm);624 const extra = tree.extraData(datas[n].rhs, Node.Asm);
625 return extra.rparen + end_offset;625 return extra.rparen + end_offset;
626 },626 },
627 .ArrayInit,627 .array_init,
628 .StructInit,628 .struct_init,
629 => {629 => {
630 const elements = tree.extraData(datas[n].rhs, Node.SubRange);630 const elements = tree.extraData(datas[n].rhs, Node.SubRange);
631 assert(elements.end - elements.start > 0);631 assert(elements.end - elements.start > 0);
632 end_offset += 1; // for the rbrace632 end_offset += 1; // for the rbrace
633 n = tree.extra_data[elements.end - 1]; // last element633 n = tree.extra_data[elements.end - 1]; // last element
634 },634 },
635 .ArrayInitComma,635 .array_init_comma,
636 .StructInitComma,636 .struct_init_comma,
637 .ContainerDeclArgComma,637 .container_decl_arg_comma,
638 .SwitchComma,638 .switch_comma,
639 => {639 => {
640 const members = tree.extraData(datas[n].rhs, Node.SubRange);640 const members = tree.extraData(datas[n].rhs, Node.SubRange);
641 assert(members.end - members.start > 0);641 assert(members.end - members.start > 0);
642 end_offset += 2; // for the comma + rbrace642 end_offset += 2; // for the comma + rbrace
643 n = tree.extra_data[members.end - 1]; // last parameter643 n = tree.extra_data[members.end - 1]; // last parameter
644 },644 },
645 .ArrayInitDot,645 .array_init_dot,
646 .StructInitDot,646 .struct_init_dot,
647 .Block,647 .block,
648 .ContainerDecl,648 .container_decl,
649 .TaggedUnion,649 .tagged_union,
650 .BuiltinCall,650 .builtin_call,
651 => {651 => {
652 assert(datas[n].rhs - datas[n].lhs > 0);652 assert(datas[n].rhs - datas[n].lhs > 0);
653 end_offset += 1; // for the rbrace653 end_offset += 1; // for the rbrace
654 n = tree.extra_data[datas[n].rhs - 1]; // last statement654 n = tree.extra_data[datas[n].rhs - 1]; // last statement
655 },655 },
656 .ArrayInitDotComma,656 .array_init_dot_comma,
657 .StructInitDotComma,657 .struct_init_dot_comma,
658 .BlockSemicolon,658 .block_semicolon,
659 .ContainerDeclComma,659 .container_decl_comma,
660 .TaggedUnionComma,660 .tagged_union_comma,
661 .BuiltinCallComma,661 .builtin_call_comma,
662 => {662 => {
663 assert(datas[n].rhs - datas[n].lhs > 0);663 assert(datas[n].rhs - datas[n].lhs > 0);
664 end_offset += 2; // for the comma/semicolon + rbrace/rparen664 end_offset += 2; // for the comma/semicolon + rbrace/rparen
665 n = tree.extra_data[datas[n].rhs - 1]; // last member665 n = tree.extra_data[datas[n].rhs - 1]; // last member
666 },666 },
667 .CallOne,667 .call_one,
668 .AsyncCallOne,668 .async_call_one,
669 .ArrayAccess,669 .array_access,
670 => {670 => {
671 end_offset += 1; // for the rparen/rbracket671 end_offset += 1; // for the rparen/rbracket
672 if (datas[n].rhs == 0) {672 if (datas[n].rhs == 0) {
...@@ -674,12 +674,12 @@ pub const Tree = struct {...@@ -674,12 +674,12 @@ pub const Tree = struct {
674 }674 }
675 n = datas[n].rhs;675 n = datas[n].rhs;
676 },676 },
677 .ArrayInitDotTwo,677 .array_init_dot_two,
678 .BlockTwo,678 .block_two,
679 .BuiltinCallTwo,679 .builtin_call_two,
680 .StructInitDotTwo,680 .struct_init_dot_two,
681 .ContainerDeclTwo,681 .container_decl_two,
682 .TaggedUnionTwo,682 .tagged_union_two,
683 => {683 => {
684 if (datas[n].rhs != 0) {684 if (datas[n].rhs != 0) {
685 end_offset += 1; // for the rparen/rbrace685 end_offset += 1; // for the rparen/rbrace
...@@ -689,25 +689,25 @@ pub const Tree = struct {...@@ -689,25 +689,25 @@ pub const Tree = struct {
689 n = datas[n].lhs;689 n = datas[n].lhs;
690 } else {690 } else {
691 switch (tags[n]) {691 switch (tags[n]) {
692 .ArrayInitDotTwo,692 .array_init_dot_two,
693 .BlockTwo,693 .block_two,
694 .StructInitDotTwo,694 .struct_init_dot_two,
695 => end_offset += 1, // rbrace695 => end_offset += 1, // rbrace
696 .BuiltinCallTwo,696 .builtin_call_two,
697 .ContainerDeclTwo,697 .container_decl_two,
698 => end_offset += 2, // lparen/lbrace + rparen/rbrace698 => end_offset += 2, // lparen/lbrace + rparen/rbrace
699 .TaggedUnionTwo => end_offset += 5, // (enum) {}699 .tagged_union_two => end_offset += 5, // (enum) {}
700 else => unreachable,700 else => unreachable,
701 }701 }
702 return main_tokens[n] + end_offset;702 return main_tokens[n] + end_offset;
703 }703 }
704 },704 },
705 .ArrayInitDotTwoComma,705 .array_init_dot_two_comma,
706 .BuiltinCallTwoComma,706 .builtin_call_two_comma,
707 .BlockTwoSemicolon,707 .block_two_semicolon,
708 .StructInitDotTwoComma,708 .struct_init_dot_two_comma,
709 .ContainerDeclTwoComma,709 .container_decl_two_comma,
710 .TaggedUnionTwoComma,710 .tagged_union_two_comma,
711 => {711 => {
712 end_offset += 2; // for the comma/semicolon + rbrace/rparen712 end_offset += 2; // for the comma/semicolon + rbrace/rparen
713 if (datas[n].rhs != 0) {713 if (datas[n].rhs != 0) {
...@@ -718,7 +718,7 @@ pub const Tree = struct {...@@ -718,7 +718,7 @@ pub const Tree = struct {
718 unreachable;718 unreachable;
719 }719 }
720 },720 },
721 .SimpleVarDecl => {721 .simple_var_decl => {
722 if (datas[n].rhs != 0) {722 if (datas[n].rhs != 0) {
723 n = datas[n].rhs;723 n = datas[n].rhs;
724 } else if (datas[n].lhs != 0) {724 } else if (datas[n].lhs != 0) {
...@@ -728,7 +728,7 @@ pub const Tree = struct {...@@ -728,7 +728,7 @@ pub const Tree = struct {
728 return main_tokens[n] + end_offset;728 return main_tokens[n] + end_offset;
729 }729 }
730 },730 },
731 .AlignedVarDecl => {731 .aligned_var_decl => {
732 if (datas[n].rhs != 0) {732 if (datas[n].rhs != 0) {
733 n = datas[n].rhs;733 n = datas[n].rhs;
734 } else if (datas[n].lhs != 0) {734 } else if (datas[n].lhs != 0) {
...@@ -739,7 +739,7 @@ pub const Tree = struct {...@@ -739,7 +739,7 @@ pub const Tree = struct {
739 return main_tokens[n] + end_offset;739 return main_tokens[n] + end_offset;
740 }740 }
741 },741 },
742 .GlobalVarDecl => {742 .global_var_decl => {
743 if (datas[n].rhs != 0) {743 if (datas[n].rhs != 0) {
744 n = datas[n].rhs;744 n = datas[n].rhs;
745 } else {745 } else {
...@@ -758,7 +758,7 @@ pub const Tree = struct {...@@ -758,7 +758,7 @@ pub const Tree = struct {
758 }758 }
759 }759 }
760 },760 },
761 .LocalVarDecl => {761 .local_var_decl => {
762 if (datas[n].rhs != 0) {762 if (datas[n].rhs != 0) {
763 n = datas[n].rhs;763 n = datas[n].rhs;
764 } else {764 } else {
...@@ -774,7 +774,7 @@ pub const Tree = struct {...@@ -774,7 +774,7 @@ pub const Tree = struct {
774 }774 }
775 }775 }
776 },776 },
777 .ContainerFieldInit => {777 .container_field_init => {
778 if (datas[n].rhs != 0) {778 if (datas[n].rhs != 0) {
779 n = datas[n].rhs;779 n = datas[n].rhs;
780 } else if (datas[n].lhs != 0) {780 } else if (datas[n].lhs != 0) {
...@@ -783,7 +783,7 @@ pub const Tree = struct {...@@ -783,7 +783,7 @@ pub const Tree = struct {
783 return main_tokens[n] + end_offset;783 return main_tokens[n] + end_offset;
784 }784 }
785 },785 },
786 .ContainerFieldAlign => {786 .container_field_align => {
787 if (datas[n].rhs != 0) {787 if (datas[n].rhs != 0) {
788 end_offset += 1; // for the rparen788 end_offset += 1; // for the rparen
789 n = datas[n].rhs;789 n = datas[n].rhs;
...@@ -793,7 +793,7 @@ pub const Tree = struct {...@@ -793,7 +793,7 @@ pub const Tree = struct {
793 return main_tokens[n] + end_offset;793 return main_tokens[n] + end_offset;
794 }794 }
795 },795 },
796 .ContainerField => {796 .container_field => {
797 const extra = tree.extraData(datas[n].rhs, Node.ContainerField);797 const extra = tree.extraData(datas[n].rhs, Node.ContainerField);
798 if (extra.value_expr != 0) {798 if (extra.value_expr != 0) {
799 n = extra.value_expr;799 n = extra.value_expr;
...@@ -807,8 +807,8 @@ pub const Tree = struct {...@@ -807,8 +807,8 @@ pub const Tree = struct {
807 }807 }
808 },808 },
809809
810 .ArrayInitOne,810 .array_init_one,
811 .StructInitOne,811 .struct_init_one,
812 => {812 => {
813 end_offset += 1; // rbrace813 end_offset += 1; // rbrace
814 if (datas[n].rhs == 0) {814 if (datas[n].rhs == 0) {
...@@ -817,37 +817,37 @@ pub const Tree = struct {...@@ -817,37 +817,37 @@ pub const Tree = struct {
817 n = datas[n].rhs;817 n = datas[n].rhs;
818 }818 }
819 },819 },
820 .SliceOpen,820 .slice_open,
821 .CallOneComma,821 .call_one_comma,
822 .AsyncCallOneComma,822 .async_call_one_comma,
823 .ArrayInitOneComma,823 .array_init_one_comma,
824 .StructInitOneComma,824 .struct_init_one_comma,
825 => {825 => {
826 end_offset += 2; // ellipsis2 + rbracket, or comma + rparen826 end_offset += 2; // ellipsis2 + rbracket, or comma + rparen
827 n = datas[n].rhs;827 n = datas[n].rhs;
828 assert(n != 0);828 assert(n != 0);
829 },829 },
830 .Slice => {830 .slice => {
831 const extra = tree.extraData(datas[n].rhs, Node.Slice);831 const extra = tree.extraData(datas[n].rhs, Node.Slice);
832 assert(extra.end != 0); // should have used SliceOpen832 assert(extra.end != 0); // should have used SliceOpen
833 end_offset += 1; // rbracket833 end_offset += 1; // rbracket
834 n = extra.end;834 n = extra.end;
835 },835 },
836 .SliceSentinel => {836 .slice_sentinel => {
837 const extra = tree.extraData(datas[n].rhs, Node.SliceSentinel);837 const extra = tree.extraData(datas[n].rhs, Node.SliceSentinel);
838 assert(extra.sentinel != 0); // should have used Slice838 assert(extra.sentinel != 0); // should have used Slice
839 end_offset += 1; // rbracket839 end_offset += 1; // rbracket
840 n = extra.sentinel;840 n = extra.sentinel;
841 },841 },
842842
843 .Continue => {843 .@"continue" => {
844 if (datas[n].lhs != 0) {844 if (datas[n].lhs != 0) {
845 return datas[n].lhs + end_offset;845 return datas[n].lhs + end_offset;
846 } else {846 } else {
847 return main_tokens[n] + end_offset;847 return main_tokens[n] + end_offset;
848 }848 }
849 },849 },
850 .Break => {850 .@"break" => {
851 if (datas[n].rhs != 0) {851 if (datas[n].rhs != 0) {
852 n = datas[n].rhs;852 n = datas[n].rhs;
853 } else if (datas[n].lhs != 0) {853 } else if (datas[n].lhs != 0) {
...@@ -856,14 +856,14 @@ pub const Tree = struct {...@@ -856,14 +856,14 @@ pub const Tree = struct {
856 return main_tokens[n] + end_offset;856 return main_tokens[n] + end_offset;
857 }857 }
858 },858 },
859 .FnDecl => {859 .fn_decl => {
860 if (datas[n].rhs != 0) {860 if (datas[n].rhs != 0) {
861 n = datas[n].rhs;861 n = datas[n].rhs;
862 } else {862 } else {
863 n = datas[n].lhs;863 n = datas[n].lhs;
864 }864 }
865 },865 },
866 .FnProtoOne => {866 .fn_proto_one => {
867 const extra = tree.extraData(datas[n].lhs, Node.FnProtoOne);867 const extra = tree.extraData(datas[n].lhs, Node.FnProtoOne);
868 // linksection, callconv, align can appear in any order, so we868 // linksection, callconv, align can appear in any order, so we
869 // find the last one here.869 // find the last one here.
...@@ -897,7 +897,7 @@ pub const Tree = struct {...@@ -897,7 +897,7 @@ pub const Tree = struct {
897 n = max_node;897 n = max_node;
898 end_offset += max_offset;898 end_offset += max_offset;
899 },899 },
900 .FnProto => {900 .fn_proto => {
901 const extra = tree.extraData(datas[n].lhs, Node.FnProto);901 const extra = tree.extraData(datas[n].lhs, Node.FnProto);
902 // linksection, callconv, align can appear in any order, so we902 // linksection, callconv, align can appear in any order, so we
903 // find the last one here.903 // find the last one here.
...@@ -931,29 +931,29 @@ pub const Tree = struct {...@@ -931,29 +931,29 @@ pub const Tree = struct {
931 n = max_node;931 n = max_node;
932 end_offset += max_offset;932 end_offset += max_offset;
933 },933 },
934 .WhileCont => {934 .while_cont => {
935 const extra = tree.extraData(datas[n].rhs, Node.WhileCont);935 const extra = tree.extraData(datas[n].rhs, Node.WhileCont);
936 assert(extra.then_expr != 0);936 assert(extra.then_expr != 0);
937 n = extra.then_expr;937 n = extra.then_expr;
938 },938 },
939 .While => {939 .@"while" => {
940 const extra = tree.extraData(datas[n].rhs, Node.While);940 const extra = tree.extraData(datas[n].rhs, Node.While);
941 assert(extra.else_expr != 0);941 assert(extra.else_expr != 0);
942 n = extra.else_expr;942 n = extra.else_expr;
943 },943 },
944 .If, .For => {944 .@"if", .@"for" => {
945 const extra = tree.extraData(datas[n].rhs, Node.If);945 const extra = tree.extraData(datas[n].rhs, Node.If);
946 assert(extra.else_expr != 0);946 assert(extra.else_expr != 0);
947 n = extra.else_expr;947 n = extra.else_expr;
948 },948 },
949 .Suspend => {949 .@"suspend" => {
950 if (datas[n].lhs != 0) {950 if (datas[n].lhs != 0) {
951 n = datas[n].lhs;951 n = datas[n].lhs;
952 } else {952 } else {
953 return main_tokens[n] + end_offset;953 return main_tokens[n] + end_offset;
954 }954 }
955 },955 },
956 .ArrayTypeSentinel => {956 .array_type_sentinel => {
957 const extra = tree.extraData(datas[n].rhs, Node.ArrayTypeSentinel);957 const extra = tree.extraData(datas[n].rhs, Node.ArrayTypeSentinel);
958 n = extra.elem_type;958 n = extra.elem_type;
959 },959 },
...@@ -967,7 +967,7 @@ pub const Tree = struct {...@@ -967,7 +967,7 @@ pub const Tree = struct {
967 }967 }
968968
969 pub fn globalVarDecl(tree: Tree, node: Node.Index) full.VarDecl {969 pub fn globalVarDecl(tree: Tree, node: Node.Index) full.VarDecl {
970 assert(tree.nodes.items(.tag)[node] == .GlobalVarDecl);970 assert(tree.nodes.items(.tag)[node] == .global_var_decl);
971 const data = tree.nodes.items(.data)[node];971 const data = tree.nodes.items(.data)[node];
972 const extra = tree.extraData(data.lhs, Node.GlobalVarDecl);972 const extra = tree.extraData(data.lhs, Node.GlobalVarDecl);
973 return tree.fullVarDecl(.{973 return tree.fullVarDecl(.{
...@@ -980,7 +980,7 @@ pub const Tree = struct {...@@ -980,7 +980,7 @@ pub const Tree = struct {
980 }980 }
981981
982 pub fn localVarDecl(tree: Tree, node: Node.Index) full.VarDecl {982 pub fn localVarDecl(tree: Tree, node: Node.Index) full.VarDecl {
983 assert(tree.nodes.items(.tag)[node] == .LocalVarDecl);983 assert(tree.nodes.items(.tag)[node] == .local_var_decl);
984 const data = tree.nodes.items(.data)[node];984 const data = tree.nodes.items(.data)[node];
985 const extra = tree.extraData(data.lhs, Node.LocalVarDecl);985 const extra = tree.extraData(data.lhs, Node.LocalVarDecl);
986 return tree.fullVarDecl(.{986 return tree.fullVarDecl(.{
...@@ -993,7 +993,7 @@ pub const Tree = struct {...@@ -993,7 +993,7 @@ pub const Tree = struct {
993 }993 }
994994
995 pub fn simpleVarDecl(tree: Tree, node: Node.Index) full.VarDecl {995 pub fn simpleVarDecl(tree: Tree, node: Node.Index) full.VarDecl {
996 assert(tree.nodes.items(.tag)[node] == .SimpleVarDecl);996 assert(tree.nodes.items(.tag)[node] == .simple_var_decl);
997 const data = tree.nodes.items(.data)[node];997 const data = tree.nodes.items(.data)[node];
998 return tree.fullVarDecl(.{998 return tree.fullVarDecl(.{
999 .type_node = data.lhs,999 .type_node = data.lhs,
...@@ -1005,7 +1005,7 @@ pub const Tree = struct {...@@ -1005,7 +1005,7 @@ pub const Tree = struct {
1005 }1005 }
10061006
1007 pub fn alignedVarDecl(tree: Tree, node: Node.Index) full.VarDecl {1007 pub fn alignedVarDecl(tree: Tree, node: Node.Index) full.VarDecl {
1008 assert(tree.nodes.items(.tag)[node] == .AlignedVarDecl);1008 assert(tree.nodes.items(.tag)[node] == .aligned_var_decl);
1009 const data = tree.nodes.items(.data)[node];1009 const data = tree.nodes.items(.data)[node];
1010 return tree.fullVarDecl(.{1010 return tree.fullVarDecl(.{
1011 .type_node = 0,1011 .type_node = 0,
...@@ -1017,7 +1017,7 @@ pub const Tree = struct {...@@ -1017,7 +1017,7 @@ pub const Tree = struct {
1017 }1017 }
10181018
1019 pub fn ifSimple(tree: Tree, node: Node.Index) full.If {1019 pub fn ifSimple(tree: Tree, node: Node.Index) full.If {
1020 assert(tree.nodes.items(.tag)[node] == .IfSimple);1020 assert(tree.nodes.items(.tag)[node] == .if_simple);
1021 const data = tree.nodes.items(.data)[node];1021 const data = tree.nodes.items(.data)[node];
1022 return tree.fullIf(.{1022 return tree.fullIf(.{
1023 .cond_expr = data.lhs,1023 .cond_expr = data.lhs,
...@@ -1028,7 +1028,7 @@ pub const Tree = struct {...@@ -1028,7 +1028,7 @@ pub const Tree = struct {
1028 }1028 }
10291029
1030 pub fn ifFull(tree: Tree, node: Node.Index) full.If {1030 pub fn ifFull(tree: Tree, node: Node.Index) full.If {
1031 assert(tree.nodes.items(.tag)[node] == .If);1031 assert(tree.nodes.items(.tag)[node] == .@"if");
1032 const data = tree.nodes.items(.data)[node];1032 const data = tree.nodes.items(.data)[node];
1033 const extra = tree.extraData(data.rhs, Node.If);1033 const extra = tree.extraData(data.rhs, Node.If);
1034 return tree.fullIf(.{1034 return tree.fullIf(.{
...@@ -1040,7 +1040,7 @@ pub const Tree = struct {...@@ -1040,7 +1040,7 @@ pub const Tree = struct {
1040 }1040 }
10411041
1042 pub fn containerField(tree: Tree, node: Node.Index) full.ContainerField {1042 pub fn containerField(tree: Tree, node: Node.Index) full.ContainerField {
1043 assert(tree.nodes.items(.tag)[node] == .ContainerField);1043 assert(tree.nodes.items(.tag)[node] == .container_field);
1044 const data = tree.nodes.items(.data)[node];1044 const data = tree.nodes.items(.data)[node];
1045 const extra = tree.extraData(data.rhs, Node.ContainerField);1045 const extra = tree.extraData(data.rhs, Node.ContainerField);
1046 return tree.fullContainerField(.{1046 return tree.fullContainerField(.{
...@@ -1052,7 +1052,7 @@ pub const Tree = struct {...@@ -1052,7 +1052,7 @@ pub const Tree = struct {
1052 }1052 }
10531053
1054 pub fn containerFieldInit(tree: Tree, node: Node.Index) full.ContainerField {1054 pub fn containerFieldInit(tree: Tree, node: Node.Index) full.ContainerField {
1055 assert(tree.nodes.items(.tag)[node] == .ContainerFieldInit);1055 assert(tree.nodes.items(.tag)[node] == .container_field_init);
1056 const data = tree.nodes.items(.data)[node];1056 const data = tree.nodes.items(.data)[node];
1057 return tree.fullContainerField(.{1057 return tree.fullContainerField(.{
1058 .name_token = tree.nodes.items(.main_token)[node],1058 .name_token = tree.nodes.items(.main_token)[node],
...@@ -1063,7 +1063,7 @@ pub const Tree = struct {...@@ -1063,7 +1063,7 @@ pub const Tree = struct {
1063 }1063 }
10641064
1065 pub fn containerFieldAlign(tree: Tree, node: Node.Index) full.ContainerField {1065 pub fn containerFieldAlign(tree: Tree, node: Node.Index) full.ContainerField {
1066 assert(tree.nodes.items(.tag)[node] == .ContainerFieldAlign);1066 assert(tree.nodes.items(.tag)[node] == .container_field_align);
1067 const data = tree.nodes.items(.data)[node];1067 const data = tree.nodes.items(.data)[node];
1068 return tree.fullContainerField(.{1068 return tree.fullContainerField(.{
1069 .name_token = tree.nodes.items(.main_token)[node],1069 .name_token = tree.nodes.items(.main_token)[node],
...@@ -1074,7 +1074,7 @@ pub const Tree = struct {...@@ -1074,7 +1074,7 @@ pub const Tree = struct {
1074 }1074 }
10751075
1076 pub fn fnProtoSimple(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.FnProto {1076 pub fn fnProtoSimple(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.FnProto {
1077 assert(tree.nodes.items(.tag)[node] == .FnProtoSimple);1077 assert(tree.nodes.items(.tag)[node] == .fn_proto_simple);
1078 const data = tree.nodes.items(.data)[node];1078 const data = tree.nodes.items(.data)[node];
1079 buffer[0] = data.lhs;1079 buffer[0] = data.lhs;
1080 const params = if (data.lhs == 0) buffer[0..0] else buffer[0..1];1080 const params = if (data.lhs == 0) buffer[0..0] else buffer[0..1];
...@@ -1089,7 +1089,7 @@ pub const Tree = struct {...@@ -1089,7 +1089,7 @@ pub const Tree = struct {
1089 }1089 }
10901090
1091 pub fn fnProtoMulti(tree: Tree, node: Node.Index) full.FnProto {1091 pub fn fnProtoMulti(tree: Tree, node: Node.Index) full.FnProto {
1092 assert(tree.nodes.items(.tag)[node] == .FnProtoMulti);1092 assert(tree.nodes.items(.tag)[node] == .fn_proto_multi);
1093 const data = tree.nodes.items(.data)[node];1093 const data = tree.nodes.items(.data)[node];
1094 const params_range = tree.extraData(data.lhs, Node.SubRange);1094 const params_range = tree.extraData(data.lhs, Node.SubRange);
1095 const params = tree.extra_data[params_range.start..params_range.end];1095 const params = tree.extra_data[params_range.start..params_range.end];
...@@ -1104,7 +1104,7 @@ pub const Tree = struct {...@@ -1104,7 +1104,7 @@ pub const Tree = struct {
1104 }1104 }
11051105
1106 pub fn fnProtoOne(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.FnProto {1106 pub fn fnProtoOne(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.FnProto {
1107 assert(tree.nodes.items(.tag)[node] == .FnProtoOne);1107 assert(tree.nodes.items(.tag)[node] == .fn_proto_one);
1108 const data = tree.nodes.items(.data)[node];1108 const data = tree.nodes.items(.data)[node];
1109 const extra = tree.extraData(data.lhs, Node.FnProtoOne);1109 const extra = tree.extraData(data.lhs, Node.FnProtoOne);
1110 buffer[0] = extra.param;1110 buffer[0] = extra.param;
...@@ -1120,7 +1120,7 @@ pub const Tree = struct {...@@ -1120,7 +1120,7 @@ pub const Tree = struct {
1120 }1120 }
11211121
1122 pub fn fnProto(tree: Tree, node: Node.Index) full.FnProto {1122 pub fn fnProto(tree: Tree, node: Node.Index) full.FnProto {
1123 assert(tree.nodes.items(.tag)[node] == .FnProto);1123 assert(tree.nodes.items(.tag)[node] == .fn_proto);
1124 const data = tree.nodes.items(.data)[node];1124 const data = tree.nodes.items(.data)[node];
1125 const extra = tree.extraData(data.lhs, Node.FnProto);1125 const extra = tree.extraData(data.lhs, Node.FnProto);
1126 const params = tree.extra_data[extra.params_start..extra.params_end];1126 const params = tree.extra_data[extra.params_start..extra.params_end];
...@@ -1135,8 +1135,8 @@ pub const Tree = struct {...@@ -1135,8 +1135,8 @@ pub const Tree = struct {
1135 }1135 }
11361136
1137 pub fn structInitOne(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.StructInit {1137 pub fn structInitOne(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.StructInit {
1138 assert(tree.nodes.items(.tag)[node] == .StructInitOne or1138 assert(tree.nodes.items(.tag)[node] == .struct_init_one or
1139 tree.nodes.items(.tag)[node] == .StructInitOneComma);1139 tree.nodes.items(.tag)[node] == .struct_init_one_comma);
1140 const data = tree.nodes.items(.data)[node];1140 const data = tree.nodes.items(.data)[node];
1141 buffer[0] = data.rhs;1141 buffer[0] = data.rhs;
1142 const fields = if (data.rhs == 0) buffer[0..0] else buffer[0..1];1142 const fields = if (data.rhs == 0) buffer[0..0] else buffer[0..1];
...@@ -1148,8 +1148,8 @@ pub const Tree = struct {...@@ -1148,8 +1148,8 @@ pub const Tree = struct {
1148 }1148 }
11491149
1150 pub fn structInitDotTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.StructInit {1150 pub fn structInitDotTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.StructInit {
1151 assert(tree.nodes.items(.tag)[node] == .StructInitDotTwo or1151 assert(tree.nodes.items(.tag)[node] == .struct_init_dot_two or
1152 tree.nodes.items(.tag)[node] == .StructInitDotTwoComma);1152 tree.nodes.items(.tag)[node] == .struct_init_dot_two_comma);
1153 const data = tree.nodes.items(.data)[node];1153 const data = tree.nodes.items(.data)[node];
1154 buffer.* = .{ data.lhs, data.rhs };1154 buffer.* = .{ data.lhs, data.rhs };
1155 const fields = if (data.rhs != 0)1155 const fields = if (data.rhs != 0)
...@@ -1166,8 +1166,8 @@ pub const Tree = struct {...@@ -1166,8 +1166,8 @@ pub const Tree = struct {
1166 }1166 }
11671167
1168 pub fn structInitDot(tree: Tree, node: Node.Index) full.StructInit {1168 pub fn structInitDot(tree: Tree, node: Node.Index) full.StructInit {
1169 assert(tree.nodes.items(.tag)[node] == .StructInitDot or1169 assert(tree.nodes.items(.tag)[node] == .struct_init_dot or
1170 tree.nodes.items(.tag)[node] == .StructInitDotComma);1170 tree.nodes.items(.tag)[node] == .struct_init_dot_comma);
1171 const data = tree.nodes.items(.data)[node];1171 const data = tree.nodes.items(.data)[node];
1172 return tree.fullStructInit(.{1172 return tree.fullStructInit(.{
1173 .lbrace = tree.nodes.items(.main_token)[node],1173 .lbrace = tree.nodes.items(.main_token)[node],
...@@ -1177,8 +1177,8 @@ pub const Tree = struct {...@@ -1177,8 +1177,8 @@ pub const Tree = struct {
1177 }1177 }
11781178
1179 pub fn structInit(tree: Tree, node: Node.Index) full.StructInit {1179 pub fn structInit(tree: Tree, node: Node.Index) full.StructInit {
1180 assert(tree.nodes.items(.tag)[node] == .StructInit or1180 assert(tree.nodes.items(.tag)[node] == .struct_init or
1181 tree.nodes.items(.tag)[node] == .StructInitComma);1181 tree.nodes.items(.tag)[node] == .struct_init_comma);
1182 const data = tree.nodes.items(.data)[node];1182 const data = tree.nodes.items(.data)[node];
1183 const fields_range = tree.extraData(data.rhs, Node.SubRange);1183 const fields_range = tree.extraData(data.rhs, Node.SubRange);
1184 return tree.fullStructInit(.{1184 return tree.fullStructInit(.{
...@@ -1189,8 +1189,8 @@ pub const Tree = struct {...@@ -1189,8 +1189,8 @@ pub const Tree = struct {
1189 }1189 }
11901190
1191 pub fn arrayInitOne(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.ArrayInit {1191 pub fn arrayInitOne(tree: Tree, buffer: *[1]Node.Index, node: Node.Index) full.ArrayInit {
1192 assert(tree.nodes.items(.tag)[node] == .ArrayInitOne or1192 assert(tree.nodes.items(.tag)[node] == .array_init_one or
1193 tree.nodes.items(.tag)[node] == .ArrayInitOneComma);1193 tree.nodes.items(.tag)[node] == .array_init_one_comma);
1194 const data = tree.nodes.items(.data)[node];1194 const data = tree.nodes.items(.data)[node];
1195 buffer[0] = data.rhs;1195 buffer[0] = data.rhs;
1196 const elements = if (data.rhs == 0) buffer[0..0] else buffer[0..1];1196 const elements = if (data.rhs == 0) buffer[0..0] else buffer[0..1];
...@@ -1204,8 +1204,8 @@ pub const Tree = struct {...@@ -1204,8 +1204,8 @@ pub const Tree = struct {
1204 }1204 }
12051205
1206 pub fn arrayInitDotTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.ArrayInit {1206 pub fn arrayInitDotTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.ArrayInit {
1207 assert(tree.nodes.items(.tag)[node] == .ArrayInitDotTwo or1207 assert(tree.nodes.items(.tag)[node] == .array_init_dot_two or
1208 tree.nodes.items(.tag)[node] == .ArrayInitDotTwoComma);1208 tree.nodes.items(.tag)[node] == .array_init_dot_two_comma);
1209 const data = tree.nodes.items(.data)[node];1209 const data = tree.nodes.items(.data)[node];
1210 buffer.* = .{ data.lhs, data.rhs };1210 buffer.* = .{ data.lhs, data.rhs };
1211 const elements = if (data.rhs != 0)1211 const elements = if (data.rhs != 0)
...@@ -1224,8 +1224,8 @@ pub const Tree = struct {...@@ -1224,8 +1224,8 @@ pub const Tree = struct {
1224 }1224 }
12251225
1226 pub fn arrayInitDot(tree: Tree, node: Node.Index) full.ArrayInit {1226 pub fn arrayInitDot(tree: Tree, node: Node.Index) full.ArrayInit {
1227 assert(tree.nodes.items(.tag)[node] == .ArrayInitDot or1227 assert(tree.nodes.items(.tag)[node] == .array_init_dot or
1228 tree.nodes.items(.tag)[node] == .ArrayInitDotComma);1228 tree.nodes.items(.tag)[node] == .array_init_dot_comma);
1229 const data = tree.nodes.items(.data)[node];1229 const data = tree.nodes.items(.data)[node];
1230 return .{1230 return .{
1231 .ast = .{1231 .ast = .{
...@@ -1237,8 +1237,8 @@ pub const Tree = struct {...@@ -1237,8 +1237,8 @@ pub const Tree = struct {
1237 }1237 }
12381238
1239 pub fn arrayInit(tree: Tree, node: Node.Index) full.ArrayInit {1239 pub fn arrayInit(tree: Tree, node: Node.Index) full.ArrayInit {
1240 assert(tree.nodes.items(.tag)[node] == .ArrayInit or1240 assert(tree.nodes.items(.tag)[node] == .array_init or
1241 tree.nodes.items(.tag)[node] == .ArrayInitComma);1241 tree.nodes.items(.tag)[node] == .array_init_comma);
1242 const data = tree.nodes.items(.data)[node];1242 const data = tree.nodes.items(.data)[node];
1243 const elem_range = tree.extraData(data.rhs, Node.SubRange);1243 const elem_range = tree.extraData(data.rhs, Node.SubRange);
1244 return .{1244 return .{
...@@ -1251,7 +1251,7 @@ pub const Tree = struct {...@@ -1251,7 +1251,7 @@ pub const Tree = struct {
1251 }1251 }
12521252
1253 pub fn arrayType(tree: Tree, node: Node.Index) full.ArrayType {1253 pub fn arrayType(tree: Tree, node: Node.Index) full.ArrayType {
1254 assert(tree.nodes.items(.tag)[node] == .ArrayType);1254 assert(tree.nodes.items(.tag)[node] == .array_type);
1255 const data = tree.nodes.items(.data)[node];1255 const data = tree.nodes.items(.data)[node];
1256 return .{1256 return .{
1257 .ast = .{1257 .ast = .{
...@@ -1264,7 +1264,7 @@ pub const Tree = struct {...@@ -1264,7 +1264,7 @@ pub const Tree = struct {
1264 }1264 }
12651265
1266 pub fn arrayTypeSentinel(tree: Tree, node: Node.Index) full.ArrayType {1266 pub fn arrayTypeSentinel(tree: Tree, node: Node.Index) full.ArrayType {
1267 assert(tree.nodes.items(.tag)[node] == .ArrayTypeSentinel);1267 assert(tree.nodes.items(.tag)[node] == .array_type_sentinel);
1268 const data = tree.nodes.items(.data)[node];1268 const data = tree.nodes.items(.data)[node];
1269 const extra = tree.extraData(data.rhs, Node.ArrayTypeSentinel);1269 const extra = tree.extraData(data.rhs, Node.ArrayTypeSentinel);
1270 return .{1270 return .{
...@@ -1278,7 +1278,7 @@ pub const Tree = struct {...@@ -1278,7 +1278,7 @@ pub const Tree = struct {
1278 }1278 }
12791279
1280 pub fn ptrTypeAligned(tree: Tree, node: Node.Index) full.PtrType {1280 pub fn ptrTypeAligned(tree: Tree, node: Node.Index) full.PtrType {
1281 assert(tree.nodes.items(.tag)[node] == .PtrTypeAligned);1281 assert(tree.nodes.items(.tag)[node] == .ptr_type_aligned);
1282 const data = tree.nodes.items(.data)[node];1282 const data = tree.nodes.items(.data)[node];
1283 return tree.fullPtrType(.{1283 return tree.fullPtrType(.{
1284 .main_token = tree.nodes.items(.main_token)[node],1284 .main_token = tree.nodes.items(.main_token)[node],
...@@ -1291,7 +1291,7 @@ pub const Tree = struct {...@@ -1291,7 +1291,7 @@ pub const Tree = struct {
1291 }1291 }
12921292
1293 pub fn ptrTypeSentinel(tree: Tree, node: Node.Index) full.PtrType {1293 pub fn ptrTypeSentinel(tree: Tree, node: Node.Index) full.PtrType {
1294 assert(tree.nodes.items(.tag)[node] == .PtrTypeSentinel);1294 assert(tree.nodes.items(.tag)[node] == .ptr_type_sentinel);
1295 const data = tree.nodes.items(.data)[node];1295 const data = tree.nodes.items(.data)[node];
1296 return tree.fullPtrType(.{1296 return tree.fullPtrType(.{
1297 .main_token = tree.nodes.items(.main_token)[node],1297 .main_token = tree.nodes.items(.main_token)[node],
...@@ -1304,7 +1304,7 @@ pub const Tree = struct {...@@ -1304,7 +1304,7 @@ pub const Tree = struct {
1304 }1304 }
13051305
1306 pub fn ptrType(tree: Tree, node: Node.Index) full.PtrType {1306 pub fn ptrType(tree: Tree, node: Node.Index) full.PtrType {
1307 assert(tree.nodes.items(.tag)[node] == .PtrType);1307 assert(tree.nodes.items(.tag)[node] == .ptr_type);
1308 const data = tree.nodes.items(.data)[node];1308 const data = tree.nodes.items(.data)[node];
1309 const extra = tree.extraData(data.lhs, Node.PtrType);1309 const extra = tree.extraData(data.lhs, Node.PtrType);
1310 return tree.fullPtrType(.{1310 return tree.fullPtrType(.{
...@@ -1318,7 +1318,7 @@ pub const Tree = struct {...@@ -1318,7 +1318,7 @@ pub const Tree = struct {
1318 }1318 }
13191319
1320 pub fn ptrTypeBitRange(tree: Tree, node: Node.Index) full.PtrType {1320 pub fn ptrTypeBitRange(tree: Tree, node: Node.Index) full.PtrType {
1321 assert(tree.nodes.items(.tag)[node] == .PtrTypeBitRange);1321 assert(tree.nodes.items(.tag)[node] == .ptr_type_bit_range);
1322 const data = tree.nodes.items(.data)[node];1322 const data = tree.nodes.items(.data)[node];
1323 const extra = tree.extraData(data.lhs, Node.PtrTypeBitRange);1323 const extra = tree.extraData(data.lhs, Node.PtrTypeBitRange);
1324 return tree.fullPtrType(.{1324 return tree.fullPtrType(.{
...@@ -1332,7 +1332,7 @@ pub const Tree = struct {...@@ -1332,7 +1332,7 @@ pub const Tree = struct {
1332 }1332 }
13331333
1334 pub fn sliceOpen(tree: Tree, node: Node.Index) full.Slice {1334 pub fn sliceOpen(tree: Tree, node: Node.Index) full.Slice {
1335 assert(tree.nodes.items(.tag)[node] == .SliceOpen);1335 assert(tree.nodes.items(.tag)[node] == .slice_open);
1336 const data = tree.nodes.items(.data)[node];1336 const data = tree.nodes.items(.data)[node];
1337 return .{1337 return .{
1338 .ast = .{1338 .ast = .{
...@@ -1346,7 +1346,7 @@ pub const Tree = struct {...@@ -1346,7 +1346,7 @@ pub const Tree = struct {
1346 }1346 }
13471347
1348 pub fn slice(tree: Tree, node: Node.Index) full.Slice {1348 pub fn slice(tree: Tree, node: Node.Index) full.Slice {
1349 assert(tree.nodes.items(.tag)[node] == .Slice);1349 assert(tree.nodes.items(.tag)[node] == .slice);
1350 const data = tree.nodes.items(.data)[node];1350 const data = tree.nodes.items(.data)[node];
1351 const extra = tree.extraData(data.rhs, Node.Slice);1351 const extra = tree.extraData(data.rhs, Node.Slice);
1352 return .{1352 return .{
...@@ -1361,7 +1361,7 @@ pub const Tree = struct {...@@ -1361,7 +1361,7 @@ pub const Tree = struct {
1361 }1361 }
13621362
1363 pub fn sliceSentinel(tree: Tree, node: Node.Index) full.Slice {1363 pub fn sliceSentinel(tree: Tree, node: Node.Index) full.Slice {
1364 assert(tree.nodes.items(.tag)[node] == .SliceSentinel);1364 assert(tree.nodes.items(.tag)[node] == .slice_sentinel);
1365 const data = tree.nodes.items(.data)[node];1365 const data = tree.nodes.items(.data)[node];
1366 const extra = tree.extraData(data.rhs, Node.SliceSentinel);1366 const extra = tree.extraData(data.rhs, Node.SliceSentinel);
1367 return .{1367 return .{
...@@ -1376,8 +1376,8 @@ pub const Tree = struct {...@@ -1376,8 +1376,8 @@ pub const Tree = struct {
1376 }1376 }
13771377
1378 pub fn containerDeclTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.ContainerDecl {1378 pub fn containerDeclTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.ContainerDecl {
1379 assert(tree.nodes.items(.tag)[node] == .ContainerDeclTwo or1379 assert(tree.nodes.items(.tag)[node] == .container_decl_two or
1380 tree.nodes.items(.tag)[node] == .ContainerDeclTwoComma);1380 tree.nodes.items(.tag)[node] == .container_decl_two_comma);
1381 const data = tree.nodes.items(.data)[node];1381 const data = tree.nodes.items(.data)[node];
1382 buffer.* = .{ data.lhs, data.rhs };1382 buffer.* = .{ data.lhs, data.rhs };
1383 const members = if (data.rhs != 0)1383 const members = if (data.rhs != 0)
...@@ -1395,8 +1395,8 @@ pub const Tree = struct {...@@ -1395,8 +1395,8 @@ pub const Tree = struct {
1395 }1395 }
13961396
1397 pub fn containerDecl(tree: Tree, node: Node.Index) full.ContainerDecl {1397 pub fn containerDecl(tree: Tree, node: Node.Index) full.ContainerDecl {
1398 assert(tree.nodes.items(.tag)[node] == .ContainerDecl or1398 assert(tree.nodes.items(.tag)[node] == .container_decl or
1399 tree.nodes.items(.tag)[node] == .ContainerDeclComma);1399 tree.nodes.items(.tag)[node] == .container_decl_comma);
1400 const data = tree.nodes.items(.data)[node];1400 const data = tree.nodes.items(.data)[node];
1401 return tree.fullContainerDecl(.{1401 return tree.fullContainerDecl(.{
1402 .main_token = tree.nodes.items(.main_token)[node],1402 .main_token = tree.nodes.items(.main_token)[node],
...@@ -1407,8 +1407,8 @@ pub const Tree = struct {...@@ -1407,8 +1407,8 @@ pub const Tree = struct {
1407 }1407 }
14081408
1409 pub fn containerDeclArg(tree: Tree, node: Node.Index) full.ContainerDecl {1409 pub fn containerDeclArg(tree: Tree, node: Node.Index) full.ContainerDecl {
1410 assert(tree.nodes.items(.tag)[node] == .ContainerDeclArg or1410 assert(tree.nodes.items(.tag)[node] == .container_decl_arg or
1411 tree.nodes.items(.tag)[node] == .ContainerDeclArgComma);1411 tree.nodes.items(.tag)[node] == .container_decl_arg_comma);
1412 const data = tree.nodes.items(.data)[node];1412 const data = tree.nodes.items(.data)[node];
1413 const members_range = tree.extraData(data.rhs, Node.SubRange);1413 const members_range = tree.extraData(data.rhs, Node.SubRange);
1414 return tree.fullContainerDecl(.{1414 return tree.fullContainerDecl(.{
...@@ -1420,8 +1420,8 @@ pub const Tree = struct {...@@ -1420,8 +1420,8 @@ pub const Tree = struct {
1420 }1420 }
14211421
1422 pub fn taggedUnionTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.ContainerDecl {1422 pub fn taggedUnionTwo(tree: Tree, buffer: *[2]Node.Index, node: Node.Index) full.ContainerDecl {
1423 assert(tree.nodes.items(.tag)[node] == .TaggedUnionTwo or1423 assert(tree.nodes.items(.tag)[node] == .tagged_union_two or
1424 tree.nodes.items(.tag)[node] == .TaggedUnionTwoComma);1424 tree.nodes.items(.tag)[node] == .tagged_union_two_comma);
1425 const data = tree.nodes.items(.data)[node];1425 const data = tree.nodes.items(.data)[node];
1426 buffer.* = .{ data.lhs, data.rhs };1426 buffer.* = .{ data.lhs, data.rhs };
1427 const members = if (data.rhs != 0)1427 const members = if (data.rhs != 0)
...@@ -1440,8 +1440,8 @@ pub const Tree = struct {...@@ -1440,8 +1440,8 @@ pub const Tree = struct {
1440 }1440 }
14411441
1442 pub fn taggedUnion(tree: Tree, node: Node.Index) full.ContainerDecl {1442 pub fn taggedUnion(tree: Tree, node: Node.Index) full.ContainerDecl {
1443 assert(tree.nodes.items(.tag)[node] == .TaggedUnion or1443 assert(tree.nodes.items(.tag)[node] == .tagged_union or
1444 tree.nodes.items(.tag)[node] == .TaggedUnionComma);1444 tree.nodes.items(.tag)[node] == .tagged_union_comma);
1445 const data = tree.nodes.items(.data)[node];1445 const data = tree.nodes.items(.data)[node];
1446 const main_token = tree.nodes.items(.main_token)[node];1446 const main_token = tree.nodes.items(.main_token)[node];
1447 return tree.fullContainerDecl(.{1447 return tree.fullContainerDecl(.{
...@@ -1453,8 +1453,8 @@ pub const Tree = struct {...@@ -1453,8 +1453,8 @@ pub const Tree = struct {
1453 }1453 }
14541454
1455 pub fn taggedUnionEnumTag(tree: Tree, node: Node.Index) full.ContainerDecl {1455 pub fn taggedUnionEnumTag(tree: Tree, node: Node.Index) full.ContainerDecl {
1456 assert(tree.nodes.items(.tag)[node] == .TaggedUnionEnumTag or1456 assert(tree.nodes.items(.tag)[node] == .tagged_union_enum_tag or
1457 tree.nodes.items(.tag)[node] == .TaggedUnionEnumTagComma);1457 tree.nodes.items(.tag)[node] == .tagged_union_enum_tag_comma);
1458 const data = tree.nodes.items(.data)[node];1458 const data = tree.nodes.items(.data)[node];
1459 const members_range = tree.extraData(data.rhs, Node.SubRange);1459 const members_range = tree.extraData(data.rhs, Node.SubRange);
1460 const main_token = tree.nodes.items(.main_token)[node];1460 const main_token = tree.nodes.items(.main_token)[node];
...@@ -1765,7 +1765,7 @@ pub const Tree = struct {...@@ -1765,7 +1765,7 @@ pub const Tree = struct {
1765 }1765 }
1766 const outputs_end: usize = for (info.items) |item, i| {1766 const outputs_end: usize = for (info.items) |item, i| {
1767 switch (node_tags[item]) {1767 switch (node_tags[item]) {
1768 .AsmOutput => continue,1768 .asm_output => continue,
1769 else => break i,1769 else => break i,
1770 }1770 }
1771 } else info.items.len;1771 } else info.items.len;
...@@ -2162,7 +2162,7 @@ pub const Error = union(enum) {...@@ -2162,7 +2162,7 @@ pub const Error = union(enum) {
21622162
2163 pub fn render(self: ExpectedCall, tree: Tree, stream: anytype) !void {2163 pub fn render(self: ExpectedCall, tree: Tree, stream: anytype) !void {
2164 const node_tag = tree.nodes.items(.tag)[self.node];2164 const node_tag = tree.nodes.items(.tag)[self.node];
2165 return stream.print("expected " ++ @tagName(Node.Tag.Call) ++ ", found {s}", .{2165 return stream.print("expected " ++ @tagName(Node.Tag.call) ++ ", found {s}", .{
2166 @tagName(node_tag),2166 @tagName(node_tag),
2167 });2167 });
2168 }2168 }
...@@ -2173,8 +2173,8 @@ pub const Error = union(enum) {...@@ -2173,8 +2173,8 @@ pub const Error = union(enum) {
21732173
2174 pub fn render(self: ExpectedCallOrFnProto, tree: Tree, stream: anytype) !void {2174 pub fn render(self: ExpectedCallOrFnProto, tree: Tree, stream: anytype) !void {
2175 const node_tag = tree.nodes.items(.tag)[self.node];2175 const node_tag = tree.nodes.items(.tag)[self.node];
2176 return stream.print("expected " ++ @tagName(Node.Tag.Call) ++ " or " ++2176 return stream.print("expected " ++ @tagName(Node.Tag.call) ++ " or " ++
2177 @tagName(Node.Tag.FnProto) ++ ", found {s}", .{@tagName(node_tag)});2177 @tagName(Node.Tag.fn_proto) ++ ", found {s}", .{@tagName(node_tag)});
2178 }2178 }
2179 };2179 };
21802180
...@@ -2305,433 +2305,433 @@ pub const Node = struct {...@@ -2305,433 +2305,433 @@ pub const Node = struct {
2305 /// Tree.lastToken()2305 /// Tree.lastToken()
2306 pub const Tag = enum {2306 pub const Tag = enum {
2307 /// sub_list[lhs...rhs]2307 /// sub_list[lhs...rhs]
2308 Root,2308 root,
2309 /// `usingnamespace lhs;`. rhs unused. main_token is `usingnamespace`.2309 /// `usingnamespace lhs;`. rhs unused. main_token is `usingnamespace`.
2310 UsingNamespace,2310 @"usingnamespace",
2311 /// lhs is test name token (must be string literal), if any.2311 /// lhs is test name token (must be string literal), if any.
2312 /// rhs is the body node.2312 /// rhs is the body node.
2313 TestDecl,2313 test_decl,
2314 /// lhs is the index into extra_data.2314 /// lhs is the index into extra_data.
2315 /// rhs is the initialization expression, if any.2315 /// rhs is the initialization expression, if any.
2316 /// main_token is `var` or `const`.2316 /// main_token is `var` or `const`.
2317 GlobalVarDecl,2317 global_var_decl,
2318 /// `var a: x align(y) = rhs`2318 /// `var a: x align(y) = rhs`
2319 /// lhs is the index into extra_data.2319 /// lhs is the index into extra_data.
2320 /// main_token is `var` or `const`.2320 /// main_token is `var` or `const`.
2321 LocalVarDecl,2321 local_var_decl,
2322 /// `var a: lhs = rhs`. lhs and rhs may be unused.2322 /// `var a: lhs = rhs`. lhs and rhs may be unused.
2323 /// Can be local or global.2323 /// Can be local or global.
2324 /// main_token is `var` or `const`.2324 /// main_token is `var` or `const`.
2325 SimpleVarDecl,2325 simple_var_decl,
2326 /// `var a align(lhs) = rhs`. lhs and rhs may be unused.2326 /// `var a align(lhs) = rhs`. lhs and rhs may be unused.
2327 /// Can be local or global.2327 /// Can be local or global.
2328 /// main_token is `var` or `const`.2328 /// main_token is `var` or `const`.
2329 AlignedVarDecl,2329 aligned_var_decl,
2330 /// lhs is the identifier token payload if any,2330 /// lhs is the identifier token payload if any,
2331 /// rhs is the deferred expression.2331 /// rhs is the deferred expression.
2332 ErrDefer,2332 @"errdefer",
2333 /// lhs is unused.2333 /// lhs is unused.
2334 /// rhs is the deferred expression.2334 /// rhs is the deferred expression.
2335 Defer,2335 @"defer",
2336 /// lhs catch rhs2336 /// lhs catch rhs
2337 /// lhs catch |err| rhs2337 /// lhs catch |err| rhs
2338 /// main_token is the catch2338 /// main_token is the catch
2339 /// payload is determined by looking at the prev tokens before rhs.2339 /// payload is determined by looking at the prev tokens before rhs.
2340 Catch,2340 @"catch",
2341 /// `lhs.a`. main_token is the dot. rhs is the identifier token index.2341 /// `lhs.a`. main_token is the dot. rhs is the identifier token index.
2342 FieldAccess,2342 field_access,
2343 /// `lhs.?`. main_token is the dot. rhs is the `?` token index.2343 /// `lhs.?`. main_token is the dot. rhs is the `?` token index.
2344 UnwrapOptional,2344 unwrap_optional,
2345 /// `lhs == rhs`. main_token is op.2345 /// `lhs == rhs`. main_token is op.
2346 EqualEqual,2346 equal_equal,
2347 /// `lhs != rhs`. main_token is op.2347 /// `lhs != rhs`. main_token is op.
2348 BangEqual,2348 bang_equal,
2349 /// `lhs < rhs`. main_token is op.2349 /// `lhs < rhs`. main_token is op.
2350 LessThan,2350 less_than,
2351 /// `lhs > rhs`. main_token is op.2351 /// `lhs > rhs`. main_token is op.
2352 GreaterThan,2352 greater_than,
2353 /// `lhs <= rhs`. main_token is op.2353 /// `lhs <= rhs`. main_token is op.
2354 LessOrEqual,2354 less_or_equal,
2355 /// `lhs >= rhs`. main_token is op.2355 /// `lhs >= rhs`. main_token is op.
2356 GreaterOrEqual,2356 greater_or_equal,
2357 /// `lhs *= rhs`. main_token is op.2357 /// `lhs *= rhs`. main_token is op.
2358 AssignMul,2358 assign_mul,
2359 /// `lhs /= rhs`. main_token is op.2359 /// `lhs /= rhs`. main_token is op.
2360 AssignDiv,2360 assign_div,
2361 /// `lhs *= rhs`. main_token is op.2361 /// `lhs *= rhs`. main_token is op.
2362 AssignMod,2362 assign_mod,
2363 /// `lhs += rhs`. main_token is op.2363 /// `lhs += rhs`. main_token is op.
2364 AssignAdd,2364 assign_add,
2365 /// `lhs -= rhs`. main_token is op.2365 /// `lhs -= rhs`. main_token is op.
2366 AssignSub,2366 assign_sub,
2367 /// `lhs <<= rhs`. main_token is op.2367 /// `lhs <<= rhs`. main_token is op.
2368 AssignBitShiftLeft,2368 assign_bit_shift_left,
2369 /// `lhs >>= rhs`. main_token is op.2369 /// `lhs >>= rhs`. main_token is op.
2370 AssignBitShiftRight,2370 assign_bit_shift_right,
2371 /// `lhs &= rhs`. main_token is op.2371 /// `lhs &= rhs`. main_token is op.
2372 AssignBitAnd,2372 assign_bit_and,
2373 /// `lhs ^= rhs`. main_token is op.2373 /// `lhs ^= rhs`. main_token is op.
2374 AssignBitXor,2374 assign_bit_xor,
2375 /// `lhs |= rhs`. main_token is op.2375 /// `lhs |= rhs`. main_token is op.
2376 AssignBitOr,2376 assign_bit_or,
2377 /// `lhs *%= rhs`. main_token is op.2377 /// `lhs *%= rhs`. main_token is op.
2378 AssignMulWrap,2378 assign_mul_wrap,
2379 /// `lhs +%= rhs`. main_token is op.2379 /// `lhs +%= rhs`. main_token is op.
2380 AssignAddWrap,2380 assign_add_wrap,
2381 /// `lhs -%= rhs`. main_token is op.2381 /// `lhs -%= rhs`. main_token is op.
2382 AssignSubWrap,2382 assign_sub_wrap,
2383 /// `lhs = rhs`. main_token is op.2383 /// `lhs = rhs`. main_token is op.
2384 Assign,2384 assign,
2385 /// `lhs || rhs`. main_token is the `||`.2385 /// `lhs || rhs`. main_token is the `||`.
2386 MergeErrorSets,2386 merge_error_sets,
2387 /// `lhs * rhs`. main_token is the `*`.2387 /// `lhs * rhs`. main_token is the `*`.
2388 Mul,2388 mul,
2389 /// `lhs / rhs`. main_token is the `/`.2389 /// `lhs / rhs`. main_token is the `/`.
2390 Div,2390 div,
2391 /// `lhs % rhs`. main_token is the `%`.2391 /// `lhs % rhs`. main_token is the `%`.
2392 Mod,2392 mod,
2393 /// `lhs ** rhs`. main_token is the `**`.2393 /// `lhs ** rhs`. main_token is the `**`.
2394 ArrayMult,2394 array_mult,
2395 /// `lhs *% rhs`. main_token is the `*%`.2395 /// `lhs *% rhs`. main_token is the `*%`.
2396 MulWrap,2396 mul_wrap,
2397 /// `lhs + rhs`. main_token is the `+`.2397 /// `lhs + rhs`. main_token is the `+`.
2398 Add,2398 add,
2399 /// `lhs - rhs`. main_token is the `-`.2399 /// `lhs - rhs`. main_token is the `-`.
2400 Sub,2400 sub,
2401 /// `lhs ++ rhs`. main_token is the `++`.2401 /// `lhs ++ rhs`. main_token is the `++`.
2402 ArrayCat,2402 array_cat,
2403 /// `lhs +% rhs`. main_token is the `+%`.2403 /// `lhs +% rhs`. main_token is the `+%`.
2404 AddWrap,2404 add_wrap,
2405 /// `lhs -% rhs`. main_token is the `-%`.2405 /// `lhs -% rhs`. main_token is the `-%`.
2406 SubWrap,2406 sub_wrap,
2407 /// `lhs << rhs`. main_token is the `<<`.2407 /// `lhs << rhs`. main_token is the `<<`.
2408 BitShiftLeft,2408 bit_shift_left,
2409 /// `lhs >> rhs`. main_token is the `>>`.2409 /// `lhs >> rhs`. main_token is the `>>`.
2410 BitShiftRight,2410 bit_shift_right,
2411 /// `lhs & rhs`. main_token is the `&`.2411 /// `lhs & rhs`. main_token is the `&`.
2412 BitAnd,2412 bit_and,
2413 /// `lhs ^ rhs`. main_token is the `^`.2413 /// `lhs ^ rhs`. main_token is the `^`.
2414 BitXor,2414 bit_xor,
2415 /// `lhs | rhs`. main_token is the `|`.2415 /// `lhs | rhs`. main_token is the `|`.
2416 BitOr,2416 bit_or,
2417 /// `lhs orelse rhs`. main_token is the `orelse`.2417 /// `lhs orelse rhs`. main_token is the `orelse`.
2418 OrElse,2418 @"orelse",
2419 /// `lhs and rhs`. main_token is the `and`.2419 /// `lhs and rhs`. main_token is the `and`.
2420 BoolAnd,2420 bool_and,
2421 /// `lhs or rhs`. main_token is the `or`.2421 /// `lhs or rhs`. main_token is the `or`.
2422 BoolOr,2422 bool_or,
2423 /// `op lhs`. rhs unused. main_token is op.2423 /// `op lhs`. rhs unused. main_token is op.
2424 BoolNot,2424 bool_not,
2425 /// `op lhs`. rhs unused. main_token is op.2425 /// `op lhs`. rhs unused. main_token is op.
2426 Negation,2426 negation,
2427 /// `op lhs`. rhs unused. main_token is op.2427 /// `op lhs`. rhs unused. main_token is op.
2428 BitNot,2428 bit_not,
2429 /// `op lhs`. rhs unused. main_token is op.2429 /// `op lhs`. rhs unused. main_token is op.
2430 NegationWrap,2430 negation_wrap,
2431 /// `op lhs`. rhs unused. main_token is op.2431 /// `op lhs`. rhs unused. main_token is op.
2432 AddressOf,2432 address_of,
2433 /// `op lhs`. rhs unused. main_token is op.2433 /// `op lhs`. rhs unused. main_token is op.
2434 Try,2434 @"try",
2435 /// `op lhs`. rhs unused. main_token is op.2435 /// `op lhs`. rhs unused. main_token is op.
2436 Await,2436 @"await",
2437 /// `?lhs`. rhs unused. main_token is the `?`.2437 /// `?lhs`. rhs unused. main_token is the `?`.
2438 OptionalType,2438 optional_type,
2439 /// `[lhs]rhs`. lhs can be omitted to make it a slice.2439 /// `[lhs]rhs`. lhs can be omitted to make it a slice.
2440 ArrayType,2440 array_type,
2441 /// `[lhs:a]b`. `ArrayTypeSentinel[rhs]`.2441 /// `[lhs:a]b`. `array_type_sentinel[rhs]`.
2442 ArrayTypeSentinel,2442 array_type_sentinel,
2443 /// `[*]align(lhs) rhs`. lhs can be omitted.2443 /// `[*]align(lhs) rhs`. lhs can be omitted.
2444 /// `*align(lhs) rhs`. lhs can be omitted.2444 /// `*align(lhs) rhs`. lhs can be omitted.
2445 /// `[]rhs`.2445 /// `[]rhs`.
2446 /// main_token is the asterisk if a pointer or the lbracket if a slice2446 /// main_token is the asterisk if a pointer or the lbracket if a slice
2447 /// main_token might be a ** token, which is shared with a parent/child2447 /// main_token might be a ** token, which is shared with a parent/child
2448 /// pointer type and may require special handling.2448 /// pointer type and may require special handling.
2449 PtrTypeAligned,2449 ptr_type_aligned,
2450 /// `[*:lhs]rhs`. lhs can be omitted.2450 /// `[*:lhs]rhs`. lhs can be omitted.
2451 /// `*rhs`.2451 /// `*rhs`.
2452 /// `[:lhs]rhs`.2452 /// `[:lhs]rhs`.
2453 /// main_token is the asterisk if a pointer or the lbracket if a slice2453 /// main_token is the asterisk if a pointer or the lbracket if a slice
2454 /// main_token might be a ** token, which is shared with a parent/child2454 /// main_token might be a ** token, which is shared with a parent/child
2455 /// pointer type and may require special handling.2455 /// pointer type and may require special handling.
2456 PtrTypeSentinel,2456 ptr_type_sentinel,
2457 /// lhs is index into PtrType. rhs is the element type expression.2457 /// lhs is index into ptr_type. rhs is the element type expression.
2458 /// main_token is the asterisk if a pointer or the lbracket if a slice2458 /// main_token is the asterisk if a pointer or the lbracket if a slice
2459 /// main_token might be a ** token, which is shared with a parent/child2459 /// main_token might be a ** token, which is shared with a parent/child
2460 /// pointer type and may require special handling.2460 /// pointer type and may require special handling.
2461 PtrType,2461 ptr_type,
2462 /// lhs is index into PtrTypeBitRange. rhs is the element type expression.2462 /// lhs is index into ptr_type_bit_range. rhs is the element type expression.
2463 /// main_token is the asterisk if a pointer or the lbracket if a slice2463 /// main_token is the asterisk if a pointer or the lbracket if a slice
2464 /// main_token might be a ** token, which is shared with a parent/child2464 /// main_token might be a ** token, which is shared with a parent/child
2465 /// pointer type and may require special handling.2465 /// pointer type and may require special handling.
2466 PtrTypeBitRange,2466 ptr_type_bit_range,
2467 /// `lhs[rhs..]`2467 /// `lhs[rhs..]`
2468 /// main_token is the lbracket.2468 /// main_token is the lbracket.
2469 SliceOpen,2469 slice_open,
2470 /// `lhs[b..c]`. rhs is index into Slice2470 /// `lhs[b..c]`. rhs is index into Slice
2471 /// main_token is the lbracket.2471 /// main_token is the lbracket.
2472 Slice,2472 slice,
2473 /// `lhs[b..c :d]`. rhs is index into SliceSentinel2473 /// `lhs[b..c :d]`. rhs is index into SliceSentinel
2474 /// main_token is the lbracket.2474 /// main_token is the lbracket.
2475 SliceSentinel,2475 slice_sentinel,
2476 /// `lhs.*`. rhs is unused.2476 /// `lhs.*`. rhs is unused.
2477 Deref,2477 deref,
2478 /// `lhs[rhs]`.2478 /// `lhs[rhs]`.
2479 ArrayAccess,2479 array_access,
2480 /// `lhs{rhs}`. rhs can be omitted.2480 /// `lhs{rhs}`. rhs can be omitted.
2481 ArrayInitOne,2481 array_init_one,
2482 /// `lhs{rhs,}`. rhs can *not* be omitted2482 /// `lhs{rhs,}`. rhs can *not* be omitted
2483 ArrayInitOneComma,2483 array_init_one_comma,
2484 /// `.{lhs, rhs}`. lhs and rhs can be omitted.2484 /// `.{lhs, rhs}`. lhs and rhs can be omitted.
2485 ArrayInitDotTwo,2485 array_init_dot_two,
2486 /// Same as `ArrayInitDotTwo` except there is known to be a trailing comma2486 /// Same as `array_init_dot_two` except there is known to be a trailing comma
2487 /// before the final rbrace.2487 /// before the final rbrace.
2488 ArrayInitDotTwoComma,2488 array_init_dot_two_comma,
2489 /// `.{a, b}`. `sub_list[lhs..rhs]`.2489 /// `.{a, b}`. `sub_list[lhs..rhs]`.
2490 ArrayInitDot,2490 array_init_dot,
2491 /// Same as `ArrayInitDot` except there is known to be a trailing comma2491 /// Same as `array_init_dot` except there is known to be a trailing comma
2492 /// before the final rbrace.2492 /// before the final rbrace.
2493 ArrayInitDotComma,2493 array_init_dot_comma,
2494 /// `lhs{a, b}`. `sub_range_list[rhs]`. lhs can be omitted which means `.{a, b}`.2494 /// `lhs{a, b}`. `sub_range_list[rhs]`. lhs can be omitted which means `.{a, b}`.
2495 ArrayInit,2495 array_init,
2496 /// Same as `ArrayInit` except there is known to be a trailing comma2496 /// Same as `array_init` except there is known to be a trailing comma
2497 /// before the final rbrace.2497 /// before the final rbrace.
2498 ArrayInitComma,2498 array_init_comma,
2499 /// `lhs{.a = rhs}`. rhs can be omitted making it empty.2499 /// `lhs{.a = rhs}`. rhs can be omitted making it empty.
2500 /// main_token is the lbrace.2500 /// main_token is the lbrace.
2501 StructInitOne,2501 struct_init_one,
2502 /// `lhs{.a = rhs,}`. rhs can *not* be omitted.2502 /// `lhs{.a = rhs,}`. rhs can *not* be omitted.
2503 /// main_token is the lbrace.2503 /// main_token is the lbrace.
2504 StructInitOneComma,2504 struct_init_one_comma,
2505 /// `.{.a = lhs, .b = rhs}`. lhs and rhs can be omitted.2505 /// `.{.a = lhs, .b = rhs}`. lhs and rhs can be omitted.
2506 /// main_token is the lbrace.2506 /// main_token is the lbrace.
2507 /// No trailing comma before the rbrace.2507 /// No trailing comma before the rbrace.
2508 StructInitDotTwo,2508 struct_init_dot_two,
2509 /// Same as `StructInitDotTwo` except there is known to be a trailing comma2509 /// Same as `struct_init_dot_two` except there is known to be a trailing comma
2510 /// before the final rbrace.2510 /// before the final rbrace.
2511 StructInitDotTwoComma,2511 struct_init_dot_two_comma,
2512 /// `.{.a = b, .c = d}`. `sub_list[lhs..rhs]`.2512 /// `.{.a = b, .c = d}`. `sub_list[lhs..rhs]`.
2513 /// main_token is the lbrace.2513 /// main_token is the lbrace.
2514 StructInitDot,2514 struct_init_dot,
2515 /// Same as `StructInitDot` except there is known to be a trailing comma2515 /// Same as `struct_init_dot` except there is known to be a trailing comma
2516 /// before the final rbrace.2516 /// before the final rbrace.
2517 StructInitDotComma,2517 struct_init_dot_comma,
2518 /// `lhs{.a = b, .c = d}`. `sub_range_list[rhs]`.2518 /// `lhs{.a = b, .c = d}`. `sub_range_list[rhs]`.
2519 /// lhs can be omitted which means `.{.a = b, .c = d}`.2519 /// lhs can be omitted which means `.{.a = b, .c = d}`.
2520 /// main_token is the lbrace.2520 /// main_token is the lbrace.
2521 StructInit,2521 struct_init,
2522 /// Same as `StructInit` except there is known to be a trailing comma2522 /// Same as `struct_init` except there is known to be a trailing comma
2523 /// before the final rbrace.2523 /// before the final rbrace.
2524 StructInitComma,2524 struct_init_comma,
2525 /// `lhs(rhs)`. rhs can be omitted.2525 /// `lhs(rhs)`. rhs can be omitted.
2526 CallOne,2526 call_one,
2527 /// `lhs(rhs,)`. rhs can be omitted.2527 /// `lhs(rhs,)`. rhs can be omitted.
2528 CallOneComma,2528 call_one_comma,
2529 /// `async lhs(rhs)`. rhs can be omitted.2529 /// `async lhs(rhs)`. rhs can be omitted.
2530 AsyncCallOne,2530 async_call_one,
2531 /// `async lhs(rhs,)`.2531 /// `async lhs(rhs,)`.
2532 AsyncCallOneComma,2532 async_call_one_comma,
2533 /// `lhs(a, b, c)`. `SubRange[rhs]`.2533 /// `lhs(a, b, c)`. `SubRange[rhs]`.
2534 /// main_token is the `(`.2534 /// main_token is the `(`.
2535 Call,2535 call,
2536 /// `lhs(a, b, c,)`. `SubRange[rhs]`.2536 /// `lhs(a, b, c,)`. `SubRange[rhs]`.
2537 /// main_token is the `(`.2537 /// main_token is the `(`.
2538 CallComma,2538 call_comma,
2539 /// `async lhs(a, b, c)`. `SubRange[rhs]`.2539 /// `async lhs(a, b, c)`. `SubRange[rhs]`.
2540 /// main_token is the `(`.2540 /// main_token is the `(`.
2541 AsyncCall,2541 async_call,
2542 /// `async lhs(a, b, c,)`. `SubRange[rhs]`.2542 /// `async lhs(a, b, c,)`. `SubRange[rhs]`.
2543 /// main_token is the `(`.2543 /// main_token is the `(`.
2544 AsyncCallComma,2544 async_call_comma,
2545 /// `switch(lhs) {}`. `SubRange[rhs]`.2545 /// `switch(lhs) {}`. `SubRange[rhs]`.
2546 Switch,2546 @"switch",
2547 /// Same as Switch except there is known to be a trailing comma2547 /// Same as switch except there is known to be a trailing comma
2548 /// before the final rbrace2548 /// before the final rbrace
2549 SwitchComma,2549 switch_comma,
2550 /// `lhs => rhs`. If lhs is omitted it means `else`.2550 /// `lhs => rhs`. If lhs is omitted it means `else`.
2551 /// main_token is the `=>`2551 /// main_token is the `=>`
2552 SwitchCaseOne,2552 switch_case_one,
2553 /// `a, b, c => rhs`. `SubRange[lhs]`.2553 /// `a, b, c => rhs`. `SubRange[lhs]`.
2554 /// main_token is the `=>`2554 /// main_token is the `=>`
2555 SwitchCase,2555 switch_case,
2556 /// `lhs...rhs`.2556 /// `lhs...rhs`.
2557 SwitchRange,2557 switch_range,
2558 /// `while (lhs) rhs`.2558 /// `while (lhs) rhs`.
2559 /// `while (lhs) |x| rhs`.2559 /// `while (lhs) |x| rhs`.
2560 WhileSimple,2560 while_simple,
2561 /// `while (lhs) : (a) b`. `WhileCont[rhs]`.2561 /// `while (lhs) : (a) b`. `WhileCont[rhs]`.
2562 /// `while (lhs) : (a) b`. `WhileCont[rhs]`.2562 /// `while (lhs) : (a) b`. `WhileCont[rhs]`.
2563 WhileCont,2563 while_cont,
2564 /// `while (lhs) : (a) b else c`. `While[rhs]`.2564 /// `while (lhs) : (a) b else c`. `While[rhs]`.
2565 /// `while (lhs) |x| : (a) b else c`. `While[rhs]`.2565 /// `while (lhs) |x| : (a) b else c`. `While[rhs]`.
2566 /// `while (lhs) |x| : (a) b else |y| c`. `While[rhs]`.2566 /// `while (lhs) |x| : (a) b else |y| c`. `While[rhs]`.
2567 While,2567 @"while",
2568 /// `for (lhs) rhs`.2568 /// `for (lhs) rhs`.
2569 ForSimple,2569 for_simple,
2570 /// `for (lhs) a else b`. `if_list[rhs]`.2570 /// `for (lhs) a else b`. `if_list[rhs]`.
2571 For,2571 @"for",
2572 /// `if (lhs) rhs`.2572 /// `if (lhs) rhs`.
2573 /// `if (lhs) |a| rhs`.2573 /// `if (lhs) |a| rhs`.
2574 IfSimple,2574 if_simple,
2575 /// `if (lhs) a else b`. `If[rhs]`.2575 /// `if (lhs) a else b`. `If[rhs]`.
2576 /// `if (lhs) |x| a else b`. `If[rhs]`.2576 /// `if (lhs) |x| a else b`. `If[rhs]`.
2577 /// `if (lhs) |x| a else |y| b`. `If[rhs]`.2577 /// `if (lhs) |x| a else |y| b`. `If[rhs]`.
2578 If,2578 @"if",
2579 /// `suspend lhs`. lhs can be omitted. rhs is unused.2579 /// `suspend lhs`. lhs can be omitted. rhs is unused.
2580 Suspend,2580 @"suspend",
2581 /// `resume lhs`. rhs is unused.2581 /// `resume lhs`. rhs is unused.
2582 Resume,2582 @"resume",
2583 /// `continue`. lhs is token index of label if any. rhs is unused.2583 /// `continue`. lhs is token index of label if any. rhs is unused.
2584 Continue,2584 @"continue",
2585 /// `break :lhs rhs`2585 /// `break :lhs rhs`
2586 /// both lhs and rhs may be omitted.2586 /// both lhs and rhs may be omitted.
2587 Break,2587 @"break",
2588 /// `return lhs`. lhs can be omitted. rhs is unused.2588 /// `return lhs`. lhs can be omitted. rhs is unused.
2589 Return,2589 @"return",
2590 /// `fn(a: lhs) rhs`. lhs can be omitted.2590 /// `fn(a: lhs) rhs`. lhs can be omitted.
2591 /// anytype and ... parameters are omitted from the AST tree.2591 /// anytype and ... parameters are omitted from the AST tree.
2592 FnProtoSimple,2592 fn_proto_simple,
2593 /// `fn(a: b, c: d) rhs`. `sub_range_list[lhs]`.2593 /// `fn(a: b, c: d) rhs`. `sub_range_list[lhs]`.
2594 /// anytype and ... parameters are omitted from the AST tree.2594 /// anytype and ... parameters are omitted from the AST tree.
2595 FnProtoMulti,2595 fn_proto_multi,
2596 /// `fn(a: b) rhs linksection(e) callconv(f)`. `FnProtoOne[lhs]`.2596 /// `fn(a: b) rhs linksection(e) callconv(f)`. `FnProtoOne[lhs]`.
2597 /// zero or one parameters.2597 /// zero or one parameters.
2598 /// anytype and ... parameters are omitted from the AST tree.2598 /// anytype and ... parameters are omitted from the AST tree.
2599 FnProtoOne,2599 fn_proto_one,
2600 /// `fn(a: b, c: d) rhs linksection(e) callconv(f)`. `FnProto[lhs]`.2600 /// `fn(a: b, c: d) rhs linksection(e) callconv(f)`. `FnProto[lhs]`.
2601 /// anytype and ... parameters are omitted from the AST tree.2601 /// anytype and ... parameters are omitted from the AST tree.
2602 FnProto,2602 fn_proto,
2603 /// lhs is the FnProto.2603 /// lhs is the fn_proto.
2604 /// rhs is the function body block if non-zero.2604 /// rhs is the function body block if non-zero.
2605 /// if rhs is zero, the funtion decl has no body (e.g. an extern function)2605 /// if rhs is zero, the function decl has no body (e.g. an extern function)
2606 FnDecl,2606 fn_decl,
2607 /// `anyframe->rhs`. main_token is `anyframe`. `lhs` is arrow token index.2607 /// `anyframe->rhs`. main_token is `anyframe`. `lhs` is arrow token index.
2608 AnyFrameType,2608 anyframe_type,
2609 /// Both lhs and rhs unused.2609 /// Both lhs and rhs unused.
2610 AnyFrameLiteral,2610 anyframe_literal,
2611 /// Both lhs and rhs unused.2611 /// Both lhs and rhs unused.
2612 CharLiteral,2612 char_literal,
2613 /// Both lhs and rhs unused.2613 /// Both lhs and rhs unused.
2614 IntegerLiteral,2614 integer_literal,
2615 /// Both lhs and rhs unused.2615 /// Both lhs and rhs unused.
2616 FloatLiteral,2616 float_literal,
2617 /// Both lhs and rhs unused.2617 /// Both lhs and rhs unused.
2618 FalseLiteral,2618 false_literal,
2619 /// Both lhs and rhs unused.2619 /// Both lhs and rhs unused.
2620 TrueLiteral,2620 true_literal,
2621 /// Both lhs and rhs unused.2621 /// Both lhs and rhs unused.
2622 NullLiteral,2622 null_literal,
2623 /// Both lhs and rhs unused.2623 /// Both lhs and rhs unused.
2624 UndefinedLiteral,2624 undefined_literal,
2625 /// Both lhs and rhs unused.2625 /// Both lhs and rhs unused.
2626 UnreachableLiteral,2626 unreachable_literal,
2627 /// Both lhs and rhs unused.2627 /// Both lhs and rhs unused.
2628 /// Most identifiers will not have explicit AST nodes, however for expressions2628 /// Most identifiers will not have explicit AST nodes, however for expressions
2629 /// which could be one of many different kinds of AST nodes, there will be an2629 /// which could be one of many different kinds of AST nodes, there will be an
2630 /// Identifier AST node for it.2630 /// identifier AST node for it.
2631 Identifier,2631 identifier,
2632 /// lhs is the dot token index, rhs unused, main_token is the identifier.2632 /// lhs is the dot token index, rhs unused, main_token is the identifier.
2633 EnumLiteral,2633 enum_literal,
2634 /// main_token is the first token index (redundant with lhs)2634 /// main_token is the first token index (redundant with lhs)
2635 /// lhs is the first token index; rhs is the last token index.2635 /// lhs is the first token index; rhs is the last token index.
2636 /// Could be a series of MultilineStringLiteralLine tokens, or a single2636 /// Could be a series of multiline_string_literal_line tokens, or a single
2637 /// StringLiteral token.2637 /// string_literal token.
2638 StringLiteral,2638 string_literal,
2639 /// `(lhs)`. main_token is the `(`; rhs is the token index of the `)`.2639 /// `(lhs)`. main_token is the `(`; rhs is the token index of the `)`.
2640 GroupedExpression,2640 grouped_expression,
2641 /// `@a(lhs, rhs)`. lhs and rhs may be omitted.2641 /// `@a(lhs, rhs)`. lhs and rhs may be omitted.
2642 BuiltinCallTwo,2642 builtin_call_two,
2643 /// Same as BuiltinCallTwo but there is known to be a trailing comma before the rparen.2643 /// Same as builtin_call_two but there is known to be a trailing comma before the rparen.
2644 BuiltinCallTwoComma,2644 builtin_call_two_comma,
2645 /// `@a(b, c)`. `sub_list[lhs..rhs]`.2645 /// `@a(b, c)`. `sub_list[lhs..rhs]`.
2646 BuiltinCall,2646 builtin_call,
2647 /// Same as BuiltinCall but there is known to be a trailing comma before the rparen.2647 /// Same as builtin_call but there is known to be a trailing comma before the rparen.
2648 BuiltinCallComma,2648 builtin_call_comma,
2649 /// `error{a, b}`.2649 /// `error{a, b}`.
2650 /// rhs is the rbrace, lhs is unused.2650 /// rhs is the rbrace, lhs is unused.
2651 ErrorSetDecl,2651 error_set_decl,
2652 /// `struct {}`, `union {}`, `opaque {}`, `enum {}`. `extra_data[lhs..rhs]`.2652 /// `struct {}`, `union {}`, `opaque {}`, `enum {}`. `extra_data[lhs..rhs]`.
2653 /// main_token is `struct`, `union`, `opaque`, `enum` keyword.2653 /// main_token is `struct`, `union`, `opaque`, `enum` keyword.
2654 ContainerDecl,2654 container_decl,
2655 /// Same as ContainerDecl but there is known to be a trailing comma before the rbrace.2655 /// Same as ContainerDecl but there is known to be a trailing comma before the rbrace.
2656 ContainerDeclComma,2656 container_decl_comma,
2657 /// `struct {lhs, rhs}`, `union {lhs, rhs}`, `opaque {lhs, rhs}`, `enum {lhs, rhs}`.2657 /// `struct {lhs, rhs}`, `union {lhs, rhs}`, `opaque {lhs, rhs}`, `enum {lhs, rhs}`.
2658 /// lhs or rhs can be omitted.2658 /// lhs or rhs can be omitted.
2659 /// main_token is `struct`, `union`, `opaque`, `enum` keyword.2659 /// main_token is `struct`, `union`, `opaque`, `enum` keyword.
2660 ContainerDeclTwo,2660 container_decl_two,
2661 /// Same as ContainerDeclTwo except there is known to be a trailing comma2661 /// Same as ContainerDeclTwo except there is known to be a trailing comma
2662 /// before the rbrace.2662 /// before the rbrace.
2663 ContainerDeclTwoComma,2663 container_decl_two_comma,
2664 /// `union(lhs)` / `enum(lhs)`. `SubRange[rhs]`.2664 /// `union(lhs)` / `enum(lhs)`. `SubRange[rhs]`.
2665 ContainerDeclArg,2665 container_decl_arg,
2666 /// Same as ContainerDeclArg but there is known to be a trailing comma before the rbrace.2666 /// Same as container_decl_arg but there is known to be a trailing comma before the rbrace.
2667 ContainerDeclArgComma,2667 container_decl_arg_comma,
2668 /// `union(enum) {}`. `sub_list[lhs..rhs]`.2668 /// `union(enum) {}`. `sub_list[lhs..rhs]`.
2669 /// Note that tagged unions with explicitly provided enums are represented2669 /// Note that tagged unions with explicitly provided enums are represented
2670 /// by `ContainerDeclArg`.2670 /// by `container_decl_arg`.
2671 TaggedUnion,2671 tagged_union,
2672 /// Same as TaggedUnion but there is known to be a trailing comma before the rbrace.2672 /// Same as tagged_union but there is known to be a trailing comma before the rbrace.
2673 TaggedUnionComma,2673 tagged_union_comma,
2674 /// `union(enum) {lhs, rhs}`. lhs or rhs may be omitted.2674 /// `union(enum) {lhs, rhs}`. lhs or rhs may be omitted.
2675 /// Note that tagged unions with explicitly provided enums are represented2675 /// Note that tagged unions with explicitly provided enums are represented
2676 /// by `ContainerDeclArg`.2676 /// by `container_decl_arg`.
2677 TaggedUnionTwo,2677 tagged_union_two,
2678 /// Same as TaggedUnionTwo but there is known to be a trailing comma before the rbrace.2678 /// Same as tagged_union_two but there is known to be a trailing comma before the rbrace.
2679 TaggedUnionTwoComma,2679 tagged_union_two_comma,
2680 /// `union(enum(lhs)) {}`. `SubRange[rhs]`.2680 /// `union(enum(lhs)) {}`. `SubRange[rhs]`.
2681 TaggedUnionEnumTag,2681 tagged_union_enum_tag,
2682 /// Same as TaggedUnionEnumTag but there is known to be a trailing comma2682 /// Same as tagged_union_enum_tag but there is known to be a trailing comma
2683 /// before the rbrace.2683 /// before the rbrace.
2684 TaggedUnionEnumTagComma,2684 tagged_union_enum_tag_comma,
2685 /// `a: lhs = rhs,`. lhs and rhs can be omitted.2685 /// `a: lhs = rhs,`. lhs and rhs can be omitted.
2686 /// main_token is the field name identifier.2686 /// main_token is the field name identifier.
2687 /// lastToken() does not include the possible trailing comma.2687 /// lastToken() does not include the possible trailing comma.
2688 ContainerFieldInit,2688 container_field_init,
2689 /// `a: lhs align(rhs),`. rhs can be omitted.2689 /// `a: lhs align(rhs),`. rhs can be omitted.
2690 /// main_token is the field name identifier.2690 /// main_token is the field name identifier.
2691 /// lastToken() does not include the possible trailing comma.2691 /// lastToken() does not include the possible trailing comma.
2692 ContainerFieldAlign,2692 container_field_align,
2693 /// `a: lhs align(c) = d,`. `container_field_list[rhs]`.2693 /// `a: lhs align(c) = d,`. `container_field_list[rhs]`.
2694 /// main_token is the field name identifier.2694 /// main_token is the field name identifier.
2695 /// lastToken() does not include the possible trailing comma.2695 /// lastToken() does not include the possible trailing comma.
2696 ContainerField,2696 container_field,
2697 /// `anytype`. both lhs and rhs unused.2697 /// `anytype`. both lhs and rhs unused.
2698 /// Used by `ContainerField`.2698 /// Used by `ContainerField`.
2699 AnyType,2699 @"anytype",
2700 /// `comptime lhs`. rhs unused.2700 /// `comptime lhs`. rhs unused.
2701 Comptime,2701 @"comptime",
2702 /// `nosuspend lhs`. rhs unused.2702 /// `nosuspend lhs`. rhs unused.
2703 Nosuspend,2703 @"nosuspend",
2704 /// `{lhs rhs}`. rhs or lhs can be omitted.2704 /// `{lhs rhs}`. rhs or lhs can be omitted.
2705 /// main_token points at the lbrace.2705 /// main_token points at the lbrace.
2706 BlockTwo,2706 block_two,
2707 /// Same as BlockTwo but there is known to be a semicolon before the rbrace.2707 /// Same as block_two but there is known to be a semicolon before the rbrace.
2708 BlockTwoSemicolon,2708 block_two_semicolon,
2709 /// `{}`. `sub_list[lhs..rhs]`.2709 /// `{}`. `sub_list[lhs..rhs]`.
2710 /// main_token points at the lbrace.2710 /// main_token points at the lbrace.
2711 Block,2711 block,
2712 /// Same as Block but there is known to be a semicolon before the rbrace.2712 /// Same as block but there is known to be a semicolon before the rbrace.
2713 BlockSemicolon,2713 block_semicolon,
2714 /// `asm(lhs)`. rhs is the token index of the rparen.2714 /// `asm(lhs)`. rhs is the token index of the rparen.
2715 AsmSimple,2715 asm_simple,
2716 /// `asm(lhs, a)`. `Asm[rhs]`.2716 /// `asm(lhs, a)`. `Asm[rhs]`.
2717 Asm,2717 @"asm",
2718 /// `[a] "b" (c)`. lhs is 0, rhs is token index of the rparen.2718 /// `[a] "b" (c)`. lhs is 0, rhs is token index of the rparen.
2719 /// `[a] "b" (-> lhs)`. rhs is token index of the rparen.2719 /// `[a] "b" (-> lhs)`. rhs is token index of the rparen.
2720 /// main_token is `a`.2720 /// main_token is `a`.
2721 AsmOutput,2721 asm_output,
2722 /// `[a] "b" (lhs)`. rhs is token index of the rparen.2722 /// `[a] "b" (lhs)`. rhs is token index of the rparen.
2723 /// main_token is `a`.2723 /// main_token is `a`.
2724 AsmInput,2724 asm_input,
2725 /// `error.a`. lhs is token index of `.`. rhs is token index of `a`.2725 /// `error.a`. lhs is token index of `.`. rhs is token index of `a`.
2726 ErrorValue,2726 error_value,
2727 /// `lhs!rhs`. main_token is the `!`.2727 /// `lhs!rhs`. main_token is the `!`.
2728 ErrorUnion,2728 error_union,
27292729
2730 pub fn isContainerField(tag: Tag) bool {2730 pub fn isContainerField(tag: Tag) bool {
2731 return switch (tag) {2731 return switch (tag) {
2732 .ContainerFieldInit,2732 .container_field_init,
2733 .ContainerFieldAlign,2733 .container_field_align,
2734 .ContainerField,2734 .container_field,
2735 => true,2735 => true,
27362736
2737 else => false,2737 else => false,
lib/std/zig/parse.zig+199-199
...@@ -57,7 +57,7 @@ pub fn parse(gpa: *Allocator, source: []const u8) Allocator.Error!Tree {...@@ -57,7 +57,7 @@ pub fn parse(gpa: *Allocator, source: []const u8) Allocator.Error!Tree {
57 // Root node must be index 0.57 // Root node must be index 0.
58 // Root <- skip ContainerMembers eof58 // Root <- skip ContainerMembers eof
59 parser.nodes.appendAssumeCapacity(.{59 parser.nodes.appendAssumeCapacity(.{
60 .tag = .Root,60 .tag = .root,
61 .main_token = 0,61 .main_token = 0,
62 .data = .{62 .data = .{
63 .lhs = undefined,63 .lhs = undefined,
...@@ -251,7 +251,7 @@ const Parser = struct {...@@ -251,7 +251,7 @@ const Parser = struct {
251 };251 };
252 if (block != 0) {252 if (block != 0) {
253 const comptime_node = try p.addNode(.{253 const comptime_node = try p.addNode(.{
254 .tag = .Comptime,254 .tag = .@"comptime",
255 .main_token = comptime_token,255 .main_token = comptime_token,
256 .data = .{256 .data = .{
257 .lhs = block,257 .lhs = block,
...@@ -477,7 +477,7 @@ const Parser = struct {...@@ -477,7 +477,7 @@ const Parser = struct {
477 const block_node = try p.parseBlock();477 const block_node = try p.parseBlock();
478 if (block_node == 0) return p.fail(.{ .ExpectedLBrace = .{ .token = p.tok_i } });478 if (block_node == 0) return p.fail(.{ .ExpectedLBrace = .{ .token = p.tok_i } });
479 return p.addNode(.{479 return p.addNode(.{
480 .tag = .TestDecl,480 .tag = .test_decl,
481 .main_token = test_token,481 .main_token = test_token,
482 .data = .{482 .data = .{
483 .lhs = name_token orelse 0,483 .lhs = name_token orelse 0,
...@@ -517,7 +517,7 @@ const Parser = struct {...@@ -517,7 +517,7 @@ const Parser = struct {
517 const semicolon_token = p.nextToken();517 const semicolon_token = p.nextToken();
518 try p.parseAppendedDocComment(semicolon_token);518 try p.parseAppendedDocComment(semicolon_token);
519 return p.addNode(.{519 return p.addNode(.{
520 .tag = .FnDecl,520 .tag = .fn_decl,
521 .main_token = p.nodes.items(.main_token)[fn_proto],521 .main_token = p.nodes.items(.main_token)[fn_proto],
522 .data = .{522 .data = .{
523 .lhs = fn_proto,523 .lhs = fn_proto,
...@@ -529,7 +529,7 @@ const Parser = struct {...@@ -529,7 +529,7 @@ const Parser = struct {
529 const body_block = try p.parseBlock();529 const body_block = try p.parseBlock();
530 assert(body_block != 0);530 assert(body_block != 0);
531 return p.addNode(.{531 return p.addNode(.{
532 .tag = .FnDecl,532 .tag = .fn_decl,
533 .main_token = p.nodes.items(.main_token)[fn_proto],533 .main_token = p.nodes.items(.main_token)[fn_proto],
534 .data = .{534 .data = .{
535 .lhs = fn_proto,535 .lhs = fn_proto,
...@@ -587,7 +587,7 @@ const Parser = struct {...@@ -587,7 +587,7 @@ const Parser = struct {
587 const semicolon_token = try p.expectToken(.semicolon);587 const semicolon_token = try p.expectToken(.semicolon);
588 try p.parseAppendedDocComment(semicolon_token);588 try p.parseAppendedDocComment(semicolon_token);
589 return p.addNode(.{589 return p.addNode(.{
590 .tag = .UsingNamespace,590 .tag = .@"usingnamespace",
591 .main_token = usingnamespace_token,591 .main_token = usingnamespace_token,
592 .data = .{592 .data = .{
593 .lhs = expr,593 .lhs = expr,
...@@ -627,7 +627,7 @@ const Parser = struct {...@@ -627,7 +627,7 @@ const Parser = struct {
627 if (align_expr == 0 and section_expr == 0 and callconv_expr == 0) {627 if (align_expr == 0 and section_expr == 0 and callconv_expr == 0) {
628 switch (params) {628 switch (params) {
629 .zero_or_one => |param| return p.addNode(.{629 .zero_or_one => |param| return p.addNode(.{
630 .tag = .FnProtoSimple,630 .tag = .fn_proto_simple,
631 .main_token = fn_token,631 .main_token = fn_token,
632 .data = .{632 .data = .{
633 .lhs = param,633 .lhs = param,
...@@ -637,7 +637,7 @@ const Parser = struct {...@@ -637,7 +637,7 @@ const Parser = struct {
637 .multi => |list| {637 .multi => |list| {
638 const span = try p.listToSpan(list);638 const span = try p.listToSpan(list);
639 return p.addNode(.{639 return p.addNode(.{
640 .tag = .FnProtoMulti,640 .tag = .fn_proto_multi,
641 .main_token = fn_token,641 .main_token = fn_token,
642 .data = .{642 .data = .{
643 .lhs = try p.addExtra(Node.SubRange{643 .lhs = try p.addExtra(Node.SubRange{
...@@ -652,7 +652,7 @@ const Parser = struct {...@@ -652,7 +652,7 @@ const Parser = struct {
652 }652 }
653 switch (params) {653 switch (params) {
654 .zero_or_one => |param| return p.addNode(.{654 .zero_or_one => |param| return p.addNode(.{
655 .tag = .FnProtoOne,655 .tag = .fn_proto_one,
656 .main_token = fn_token,656 .main_token = fn_token,
657 .data = .{657 .data = .{
658 .lhs = try p.addExtra(Node.FnProtoOne{658 .lhs = try p.addExtra(Node.FnProtoOne{
...@@ -667,7 +667,7 @@ const Parser = struct {...@@ -667,7 +667,7 @@ const Parser = struct {
667 .multi => |list| {667 .multi => |list| {
668 const span = try p.listToSpan(list);668 const span = try p.listToSpan(list);
669 return p.addNode(.{669 return p.addNode(.{
670 .tag = .FnProto,670 .tag = .fn_proto,
671 .main_token = fn_token,671 .main_token = fn_token,
672 .data = .{672 .data = .{
673 .lhs = try p.addExtra(Node.FnProto{673 .lhs = try p.addExtra(Node.FnProto{
...@@ -698,7 +698,7 @@ const Parser = struct {...@@ -698,7 +698,7 @@ const Parser = struct {
698 if (section_node == 0) {698 if (section_node == 0) {
699 if (align_node == 0) {699 if (align_node == 0) {
700 return p.addNode(.{700 return p.addNode(.{
701 .tag = .SimpleVarDecl,701 .tag = .simple_var_decl,
702 .main_token = mut_token,702 .main_token = mut_token,
703 .data = .{703 .data = .{
704 .lhs = type_node,704 .lhs = type_node,
...@@ -707,7 +707,7 @@ const Parser = struct {...@@ -707,7 +707,7 @@ const Parser = struct {
707 });707 });
708 } else if (type_node == 0) {708 } else if (type_node == 0) {
709 return p.addNode(.{709 return p.addNode(.{
710 .tag = .AlignedVarDecl,710 .tag = .aligned_var_decl,
711 .main_token = mut_token,711 .main_token = mut_token,
712 .data = .{712 .data = .{
713 .lhs = align_node,713 .lhs = align_node,
...@@ -716,7 +716,7 @@ const Parser = struct {...@@ -716,7 +716,7 @@ const Parser = struct {
716 });716 });
717 } else {717 } else {
718 return p.addNode(.{718 return p.addNode(.{
719 .tag = .LocalVarDecl,719 .tag = .local_var_decl,
720 .main_token = mut_token,720 .main_token = mut_token,
721 .data = .{721 .data = .{
722 .lhs = try p.addExtra(Node.LocalVarDecl{722 .lhs = try p.addExtra(Node.LocalVarDecl{
...@@ -729,7 +729,7 @@ const Parser = struct {...@@ -729,7 +729,7 @@ const Parser = struct {
729 }729 }
730 } else {730 } else {
731 return p.addNode(.{731 return p.addNode(.{
732 .tag = .GlobalVarDecl,732 .tag = .global_var_decl,
733 .main_token = mut_token,733 .main_token = mut_token,
734 .data = .{734 .data = .{
735 .lhs = try p.addExtra(Node.GlobalVarDecl{735 .lhs = try p.addExtra(Node.GlobalVarDecl{
...@@ -753,7 +753,7 @@ const Parser = struct {...@@ -753,7 +753,7 @@ const Parser = struct {
753 if (p.eatToken(.colon)) |_| {753 if (p.eatToken(.colon)) |_| {
754 if (p.eatToken(.keyword_anytype)) |anytype_tok| {754 if (p.eatToken(.keyword_anytype)) |anytype_tok| {
755 type_expr = try p.addNode(.{755 type_expr = try p.addNode(.{
756 .tag = .AnyType,756 .tag = .@"anytype",
757 .main_token = anytype_tok,757 .main_token = anytype_tok,
758 .data = .{758 .data = .{
759 .lhs = undefined,759 .lhs = undefined,
...@@ -770,7 +770,7 @@ const Parser = struct {...@@ -770,7 +770,7 @@ const Parser = struct {
770770
771 if (align_expr == 0) {771 if (align_expr == 0) {
772 return p.addNode(.{772 return p.addNode(.{
773 .tag = .ContainerFieldInit,773 .tag = .container_field_init,
774 .main_token = name_token,774 .main_token = name_token,
775 .data = .{775 .data = .{
776 .lhs = type_expr,776 .lhs = type_expr,
...@@ -779,7 +779,7 @@ const Parser = struct {...@@ -779,7 +779,7 @@ const Parser = struct {
779 });779 });
780 } else if (value_expr == 0) {780 } else if (value_expr == 0) {
781 return p.addNode(.{781 return p.addNode(.{
782 .tag = .ContainerFieldAlign,782 .tag = .container_field_align,
783 .main_token = name_token,783 .main_token = name_token,
784 .data = .{784 .data = .{
785 .lhs = type_expr,785 .lhs = type_expr,
...@@ -788,7 +788,7 @@ const Parser = struct {...@@ -788,7 +788,7 @@ const Parser = struct {
788 });788 });
789 } else {789 } else {
790 return p.addNode(.{790 return p.addNode(.{
791 .tag = .ContainerField,791 .tag = .container_field,
792 .main_token = name_token,792 .main_token = name_token,
793 .data = .{793 .data = .{
794 .lhs = type_expr,794 .lhs = type_expr,
...@@ -833,7 +833,7 @@ const Parser = struct {...@@ -833,7 +833,7 @@ const Parser = struct {
833833
834 if (comptime_token) |token| {834 if (comptime_token) |token| {
835 return p.addNode(.{835 return p.addNode(.{
836 .tag = .Comptime,836 .tag = .@"comptime",
837 .main_token = token,837 .main_token = token,
838 .data = .{838 .data = .{
839 .lhs = try p.expectBlockExprStatement(),839 .lhs = try p.expectBlockExprStatement(),
...@@ -845,7 +845,7 @@ const Parser = struct {...@@ -845,7 +845,7 @@ const Parser = struct {
845 switch (p.token_tags[p.tok_i]) {845 switch (p.token_tags[p.tok_i]) {
846 .keyword_nosuspend => {846 .keyword_nosuspend => {
847 return p.addNode(.{847 return p.addNode(.{
848 .tag = .Nosuspend,848 .tag = .@"nosuspend",
849 .main_token = p.nextToken(),849 .main_token = p.nextToken(),
850 .data = .{850 .data = .{
851 .lhs = try p.expectBlockExprStatement(),851 .lhs = try p.expectBlockExprStatement(),
...@@ -860,7 +860,7 @@ const Parser = struct {...@@ -860,7 +860,7 @@ const Parser = struct {
860 else860 else
861 try p.expectBlockExprStatement();861 try p.expectBlockExprStatement();
862 return p.addNode(.{862 return p.addNode(.{
863 .tag = .Suspend,863 .tag = .@"suspend",
864 .main_token = token,864 .main_token = token,
865 .data = .{865 .data = .{
866 .lhs = block_expr,866 .lhs = block_expr,
...@@ -869,7 +869,7 @@ const Parser = struct {...@@ -869,7 +869,7 @@ const Parser = struct {
869 });869 });
870 },870 },
871 .keyword_defer => return p.addNode(.{871 .keyword_defer => return p.addNode(.{
872 .tag = .Defer,872 .tag = .@"defer",
873 .main_token = p.nextToken(),873 .main_token = p.nextToken(),
874 .data = .{874 .data = .{
875 .lhs = undefined,875 .lhs = undefined,
...@@ -877,7 +877,7 @@ const Parser = struct {...@@ -877,7 +877,7 @@ const Parser = struct {
877 },877 },
878 }),878 }),
879 .keyword_errdefer => return p.addNode(.{879 .keyword_errdefer => return p.addNode(.{
880 .tag = .ErrDefer,880 .tag = .@"errdefer",
881 .main_token = p.nextToken(),881 .main_token = p.nextToken(),
882 .data = .{882 .data = .{
883 .lhs = try p.parsePayload(),883 .lhs = try p.parsePayload(),
...@@ -947,7 +947,7 @@ const Parser = struct {...@@ -947,7 +947,7 @@ const Parser = struct {
947 }947 }
948 if (p.eatToken(.semicolon)) |_| {948 if (p.eatToken(.semicolon)) |_| {
949 return p.addNode(.{949 return p.addNode(.{
950 .tag = .IfSimple,950 .tag = .if_simple,
951 .main_token = if_token,951 .main_token = if_token,
952 .data = .{952 .data = .{
953 .lhs = condition,953 .lhs = condition,
...@@ -963,7 +963,7 @@ const Parser = struct {...@@ -963,7 +963,7 @@ const Parser = struct {
963 return p.fail(.{ .ExpectedSemiOrElse = .{ .token = p.tok_i } });963 return p.fail(.{ .ExpectedSemiOrElse = .{ .token = p.tok_i } });
964 }964 }
965 return p.addNode(.{965 return p.addNode(.{
966 .tag = .IfSimple,966 .tag = .if_simple,
967 .main_token = if_token,967 .main_token = if_token,
968 .data = .{968 .data = .{
969 .lhs = condition,969 .lhs = condition,
...@@ -974,7 +974,7 @@ const Parser = struct {...@@ -974,7 +974,7 @@ const Parser = struct {
974 const else_payload = try p.parsePayload();974 const else_payload = try p.parsePayload();
975 const else_expr = try p.expectStatement();975 const else_expr = try p.expectStatement();
976 return p.addNode(.{976 return p.addNode(.{
977 .tag = .If,977 .tag = .@"if",
978 .main_token = if_token,978 .main_token = if_token,
979 .data = .{979 .data = .{
980 .lhs = condition,980 .lhs = condition,
...@@ -1041,7 +1041,7 @@ const Parser = struct {...@@ -1041,7 +1041,7 @@ const Parser = struct {
1041 }1041 }
1042 if (p.eatToken(.semicolon)) |_| {1042 if (p.eatToken(.semicolon)) |_| {
1043 return p.addNode(.{1043 return p.addNode(.{
1044 .tag = .ForSimple,1044 .tag = .for_simple,
1045 .main_token = for_token,1045 .main_token = for_token,
1046 .data = .{1046 .data = .{
1047 .lhs = array_expr,1047 .lhs = array_expr,
...@@ -1057,7 +1057,7 @@ const Parser = struct {...@@ -1057,7 +1057,7 @@ const Parser = struct {
1057 return p.fail(.{ .ExpectedSemiOrElse = .{ .token = p.tok_i } });1057 return p.fail(.{ .ExpectedSemiOrElse = .{ .token = p.tok_i } });
1058 }1058 }
1059 return p.addNode(.{1059 return p.addNode(.{
1060 .tag = .ForSimple,1060 .tag = .for_simple,
1061 .main_token = for_token,1061 .main_token = for_token,
1062 .data = .{1062 .data = .{
1063 .lhs = array_expr,1063 .lhs = array_expr,
...@@ -1066,7 +1066,7 @@ const Parser = struct {...@@ -1066,7 +1066,7 @@ const Parser = struct {
1066 });1066 });
1067 };1067 };
1068 return p.addNode(.{1068 return p.addNode(.{
1069 .tag = .For,1069 .tag = .@"for",
1070 .main_token = for_token,1070 .main_token = for_token,
1071 .data = .{1071 .data = .{
1072 .lhs = array_expr,1072 .lhs = array_expr,
...@@ -1103,7 +1103,7 @@ const Parser = struct {...@@ -1103,7 +1103,7 @@ const Parser = struct {
1103 if (p.eatToken(.semicolon)) |_| {1103 if (p.eatToken(.semicolon)) |_| {
1104 if (cont_expr == 0) {1104 if (cont_expr == 0) {
1105 return p.addNode(.{1105 return p.addNode(.{
1106 .tag = .WhileSimple,1106 .tag = .while_simple,
1107 .main_token = while_token,1107 .main_token = while_token,
1108 .data = .{1108 .data = .{
1109 .lhs = condition,1109 .lhs = condition,
...@@ -1112,7 +1112,7 @@ const Parser = struct {...@@ -1112,7 +1112,7 @@ const Parser = struct {
1112 });1112 });
1113 } else {1113 } else {
1114 return p.addNode(.{1114 return p.addNode(.{
1115 .tag = .WhileCont,1115 .tag = .while_cont,
1116 .main_token = while_token,1116 .main_token = while_token,
1117 .data = .{1117 .data = .{
1118 .lhs = condition,1118 .lhs = condition,
...@@ -1133,7 +1133,7 @@ const Parser = struct {...@@ -1133,7 +1133,7 @@ const Parser = struct {
1133 }1133 }
1134 if (cont_expr == 0) {1134 if (cont_expr == 0) {
1135 return p.addNode(.{1135 return p.addNode(.{
1136 .tag = .WhileSimple,1136 .tag = .while_simple,
1137 .main_token = while_token,1137 .main_token = while_token,
1138 .data = .{1138 .data = .{
1139 .lhs = condition,1139 .lhs = condition,
...@@ -1142,7 +1142,7 @@ const Parser = struct {...@@ -1142,7 +1142,7 @@ const Parser = struct {
1142 });1142 });
1143 } else {1143 } else {
1144 return p.addNode(.{1144 return p.addNode(.{
1145 .tag = .WhileCont,1145 .tag = .while_cont,
1146 .main_token = while_token,1146 .main_token = while_token,
1147 .data = .{1147 .data = .{
1148 .lhs = condition,1148 .lhs = condition,
...@@ -1157,7 +1157,7 @@ const Parser = struct {...@@ -1157,7 +1157,7 @@ const Parser = struct {
1157 const else_payload = try p.parsePayload();1157 const else_payload = try p.parsePayload();
1158 const else_expr = try p.expectStatement();1158 const else_expr = try p.expectStatement();
1159 return p.addNode(.{1159 return p.addNode(.{
1160 .tag = .While,1160 .tag = .@"while",
1161 .main_token = while_token,1161 .main_token = while_token,
1162 .data = .{1162 .data = .{
1163 .lhs = condition,1163 .lhs = condition,
...@@ -1233,20 +1233,20 @@ const Parser = struct {...@@ -1233,20 +1233,20 @@ const Parser = struct {
1233 if (expr == 0) return null_node;1233 if (expr == 0) return null_node;
12341234
1235 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1235 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1236 .asterisk_equal => .AssignMul,1236 .asterisk_equal => .assign_mul,
1237 .slash_equal => .AssignDiv,1237 .slash_equal => .assign_div,
1238 .percent_equal => .AssignMod,1238 .percent_equal => .assign_mod,
1239 .plus_equal => .AssignAdd,1239 .plus_equal => .assign_add,
1240 .minus_equal => .AssignSub,1240 .minus_equal => .assign_sub,
1241 .angle_bracket_angle_bracket_left_equal => .AssignBitShiftLeft,1241 .angle_bracket_angle_bracket_left_equal => .assign_bit_shift_left,
1242 .angle_bracket_angle_bracket_right_equal => .AssignBitShiftRight,1242 .angle_bracket_angle_bracket_right_equal => .assign_bit_shift_right,
1243 .ampersand_equal => .AssignBitAnd,1243 .ampersand_equal => .assign_bit_and,
1244 .caret_equal => .AssignBitXor,1244 .caret_equal => .assign_bit_xor,
1245 .pipe_equal => .AssignBitOr,1245 .pipe_equal => .assign_bit_or,
1246 .asterisk_percent_equal => .AssignMulWrap,1246 .asterisk_percent_equal => .assign_mul_wrap,
1247 .plus_percent_equal => .AssignAddWrap,1247 .plus_percent_equal => .assign_add_wrap,
1248 .minus_percent_equal => .AssignSubWrap,1248 .minus_percent_equal => .assign_sub_wrap,
1249 .equal => .Assign,1249 .equal => .assign,
1250 else => return expr,1250 else => return expr,
1251 };1251 };
1252 return p.addNode(.{1252 return p.addNode(.{
...@@ -1295,7 +1295,7 @@ const Parser = struct {...@@ -1295,7 +1295,7 @@ const Parser = struct {
1295 return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });1295 return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });
1296 }1296 }
1297 res = try p.addNode(.{1297 res = try p.addNode(.{
1298 .tag = .BoolOr,1298 .tag = .bool_or,
1299 .main_token = or_token,1299 .main_token = or_token,
1300 .data = .{1300 .data = .{
1301 .lhs = res,1301 .lhs = res,
...@@ -1322,7 +1322,7 @@ const Parser = struct {...@@ -1322,7 +1322,7 @@ const Parser = struct {
1322 return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });1322 return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });
1323 }1323 }
1324 res = try p.addNode(.{1324 res = try p.addNode(.{
1325 .tag = .BoolAnd,1325 .tag = .bool_and,
1326 .main_token = and_token,1326 .main_token = and_token,
1327 .data = .{1327 .data = .{
1328 .lhs = res,1328 .lhs = res,
...@@ -1348,12 +1348,12 @@ const Parser = struct {...@@ -1348,12 +1348,12 @@ const Parser = struct {
1348 if (expr == 0) return null_node;1348 if (expr == 0) return null_node;
13491349
1350 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1350 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1351 .equal_equal => .EqualEqual,1351 .equal_equal => .equal_equal,
1352 .bang_equal => .BangEqual,1352 .bang_equal => .bang_equal,
1353 .angle_bracket_left => .LessThan,1353 .angle_bracket_left => .less_than,
1354 .angle_bracket_right => .GreaterThan,1354 .angle_bracket_right => .greater_than,
1355 .angle_bracket_left_equal => .LessOrEqual,1355 .angle_bracket_left_equal => .less_or_equal,
1356 .angle_bracket_right_equal => .GreaterOrEqual,1356 .angle_bracket_right_equal => .greater_or_equal,
1357 else => return expr,1357 else => return expr,
1358 };1358 };
1359 return p.addNode(.{1359 return p.addNode(.{
...@@ -1379,10 +1379,10 @@ const Parser = struct {...@@ -1379,10 +1379,10 @@ const Parser = struct {
13791379
1380 while (true) {1380 while (true) {
1381 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1381 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1382 .ampersand => .BitAnd,1382 .ampersand => .bit_and,
1383 .caret => .BitXor,1383 .caret => .bit_xor,
1384 .pipe => .BitOr,1384 .pipe => .bit_or,
1385 .keyword_orelse => .OrElse,1385 .keyword_orelse => .@"orelse",
1386 .keyword_catch => {1386 .keyword_catch => {
1387 const catch_token = p.nextToken();1387 const catch_token = p.nextToken();
1388 _ = try p.parsePayload();1388 _ = try p.parsePayload();
...@@ -1391,7 +1391,7 @@ const Parser = struct {...@@ -1391,7 +1391,7 @@ const Parser = struct {
1391 return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });1391 return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });
1392 }1392 }
1393 res = try p.addNode(.{1393 res = try p.addNode(.{
1394 .tag = .Catch,1394 .tag = .@"catch",
1395 .main_token = catch_token,1395 .main_token = catch_token,
1396 .data = .{1396 .data = .{
1397 .lhs = res,1397 .lhs = res,
...@@ -1432,8 +1432,8 @@ const Parser = struct {...@@ -1432,8 +1432,8 @@ const Parser = struct {
14321432
1433 while (true) {1433 while (true) {
1434 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1434 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1435 .angle_bracket_angle_bracket_left => .BitShiftLeft,1435 .angle_bracket_angle_bracket_left => .bit_shift_left,
1436 .angle_bracket_angle_bracket_right => .BitShiftRight,1436 .angle_bracket_angle_bracket_right => .bit_shift_right,
1437 else => return res,1437 else => return res,
1438 };1438 };
1439 res = try p.addNode(.{1439 res = try p.addNode(.{
...@@ -1469,11 +1469,11 @@ const Parser = struct {...@@ -1469,11 +1469,11 @@ const Parser = struct {
14691469
1470 while (true) {1470 while (true) {
1471 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1471 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1472 .plus => .Add,1472 .plus => .add,
1473 .minus => .Sub,1473 .minus => .sub,
1474 .plus_plus => .ArrayCat,1474 .plus_plus => .array_cat,
1475 .plus_percent => .AddWrap,1475 .plus_percent => .add_wrap,
1476 .minus_percent => .SubWrap,1476 .minus_percent => .sub_wrap,
1477 else => return res,1477 else => return res,
1478 };1478 };
1479 res = try p.addNode(.{1479 res = try p.addNode(.{
...@@ -1509,12 +1509,12 @@ const Parser = struct {...@@ -1509,12 +1509,12 @@ const Parser = struct {
15091509
1510 while (true) {1510 while (true) {
1511 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1511 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1512 .pipe_pipe => .MergeErrorSets,1512 .pipe_pipe => .merge_error_sets,
1513 .asterisk => .Mul,1513 .asterisk => .mul,
1514 .slash => .Div,1514 .slash => .div,
1515 .percent => .Mod,1515 .percent => .mod,
1516 .asterisk_asterisk => .ArrayMult,1516 .asterisk_asterisk => .array_mult,
1517 .asterisk_percent => .MulWrap,1517 .asterisk_percent => .mul_wrap,
1518 else => return res,1518 else => return res,
1519 };1519 };
1520 res = try p.addNode(.{1520 res = try p.addNode(.{
...@@ -1547,13 +1547,13 @@ const Parser = struct {...@@ -1547,13 +1547,13 @@ const Parser = struct {
1547 /// / KEYWORD_await1547 /// / KEYWORD_await
1548 fn parsePrefixExpr(p: *Parser) Error!Node.Index {1548 fn parsePrefixExpr(p: *Parser) Error!Node.Index {
1549 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {1549 const tag: Node.Tag = switch (p.token_tags[p.tok_i]) {
1550 .bang => .BoolNot,1550 .bang => .bool_not,
1551 .minus => .Negation,1551 .minus => .negation,
1552 .tilde => .BitNot,1552 .tilde => .bit_not,
1553 .minus_percent => .NegationWrap,1553 .minus_percent => .negation_wrap,
1554 .ampersand => .AddressOf,1554 .ampersand => .address_of,
1555 .keyword_try => .Try,1555 .keyword_try => .@"try",
1556 .keyword_await => .Await,1556 .keyword_await => .@"await",
1557 else => return p.parsePrimaryExpr(),1557 else => return p.parsePrimaryExpr(),
1558 };1558 };
1559 return p.addNode(.{1559 return p.addNode(.{
...@@ -1588,7 +1588,7 @@ const Parser = struct {...@@ -1588,7 +1588,7 @@ const Parser = struct {
1588 fn parseTypeExpr(p: *Parser) Error!Node.Index {1588 fn parseTypeExpr(p: *Parser) Error!Node.Index {
1589 switch (p.token_tags[p.tok_i]) {1589 switch (p.token_tags[p.tok_i]) {
1590 .question_mark => return p.addNode(.{1590 .question_mark => return p.addNode(.{
1591 .tag = .OptionalType,1591 .tag = .optional_type,
1592 .main_token = p.nextToken(),1592 .main_token = p.nextToken(),
1593 .data = .{1593 .data = .{
1594 .lhs = try p.expectTypeExpr(),1594 .lhs = try p.expectTypeExpr(),
...@@ -1597,7 +1597,7 @@ const Parser = struct {...@@ -1597,7 +1597,7 @@ const Parser = struct {
1597 }),1597 }),
1598 .keyword_anyframe => switch (p.token_tags[p.tok_i + 1]) {1598 .keyword_anyframe => switch (p.token_tags[p.tok_i + 1]) {
1599 .arrow => return p.addNode(.{1599 .arrow => return p.addNode(.{
1600 .tag = .AnyFrameType,1600 .tag = .anyframe_type,
1601 .main_token = p.nextToken(),1601 .main_token = p.nextToken(),
1602 .data = .{1602 .data = .{
1603 .lhs = p.nextToken(),1603 .lhs = p.nextToken(),
...@@ -1612,7 +1612,7 @@ const Parser = struct {...@@ -1612,7 +1612,7 @@ const Parser = struct {
1612 const elem_type = try p.expectTypeExpr();1612 const elem_type = try p.expectTypeExpr();
1613 if (mods.bit_range_start == 0) {1613 if (mods.bit_range_start == 0) {
1614 return p.addNode(.{1614 return p.addNode(.{
1615 .tag = .PtrTypeAligned,1615 .tag = .ptr_type_aligned,
1616 .main_token = asterisk,1616 .main_token = asterisk,
1617 .data = .{1617 .data = .{
1618 .lhs = mods.align_node,1618 .lhs = mods.align_node,
...@@ -1621,7 +1621,7 @@ const Parser = struct {...@@ -1621,7 +1621,7 @@ const Parser = struct {
1621 });1621 });
1622 } else {1622 } else {
1623 return p.addNode(.{1623 return p.addNode(.{
1624 .tag = .PtrTypeBitRange,1624 .tag = .ptr_type_bit_range,
1625 .main_token = asterisk,1625 .main_token = asterisk,
1626 .data = .{1626 .data = .{
1627 .lhs = try p.addExtra(Node.PtrTypeBitRange{1627 .lhs = try p.addExtra(Node.PtrTypeBitRange{
...@@ -1642,7 +1642,7 @@ const Parser = struct {...@@ -1642,7 +1642,7 @@ const Parser = struct {
1642 const inner: Node.Index = inner: {1642 const inner: Node.Index = inner: {
1643 if (mods.bit_range_start == 0) {1643 if (mods.bit_range_start == 0) {
1644 break :inner try p.addNode(.{1644 break :inner try p.addNode(.{
1645 .tag = .PtrTypeAligned,1645 .tag = .ptr_type_aligned,
1646 .main_token = asterisk,1646 .main_token = asterisk,
1647 .data = .{1647 .data = .{
1648 .lhs = mods.align_node,1648 .lhs = mods.align_node,
...@@ -1651,7 +1651,7 @@ const Parser = struct {...@@ -1651,7 +1651,7 @@ const Parser = struct {
1651 });1651 });
1652 } else {1652 } else {
1653 break :inner try p.addNode(.{1653 break :inner try p.addNode(.{
1654 .tag = .PtrTypeBitRange,1654 .tag = .ptr_type_bit_range,
1655 .main_token = asterisk,1655 .main_token = asterisk,
1656 .data = .{1656 .data = .{
1657 .lhs = try p.addExtra(Node.PtrTypeBitRange{1657 .lhs = try p.addExtra(Node.PtrTypeBitRange{
...@@ -1666,7 +1666,7 @@ const Parser = struct {...@@ -1666,7 +1666,7 @@ const Parser = struct {
1666 }1666 }
1667 };1667 };
1668 return p.addNode(.{1668 return p.addNode(.{
1669 .tag = .PtrTypeAligned,1669 .tag = .ptr_type_aligned,
1670 .main_token = asterisk,1670 .main_token = asterisk,
1671 .data = .{1671 .data = .{
1672 .lhs = 0,1672 .lhs = 0,
...@@ -1698,7 +1698,7 @@ const Parser = struct {...@@ -1698,7 +1698,7 @@ const Parser = struct {
1698 if (mods.bit_range_start == 0) {1698 if (mods.bit_range_start == 0) {
1699 if (sentinel == 0) {1699 if (sentinel == 0) {
1700 return p.addNode(.{1700 return p.addNode(.{
1701 .tag = .PtrTypeAligned,1701 .tag = .ptr_type_aligned,
1702 .main_token = asterisk,1702 .main_token = asterisk,
1703 .data = .{1703 .data = .{
1704 .lhs = mods.align_node,1704 .lhs = mods.align_node,
...@@ -1707,7 +1707,7 @@ const Parser = struct {...@@ -1707,7 +1707,7 @@ const Parser = struct {
1707 });1707 });
1708 } else if (mods.align_node == 0) {1708 } else if (mods.align_node == 0) {
1709 return p.addNode(.{1709 return p.addNode(.{
1710 .tag = .PtrTypeSentinel,1710 .tag = .ptr_type_sentinel,
1711 .main_token = asterisk,1711 .main_token = asterisk,
1712 .data = .{1712 .data = .{
1713 .lhs = sentinel,1713 .lhs = sentinel,
...@@ -1716,7 +1716,7 @@ const Parser = struct {...@@ -1716,7 +1716,7 @@ const Parser = struct {
1716 });1716 });
1717 } else {1717 } else {
1718 return p.addNode(.{1718 return p.addNode(.{
1719 .tag = .PtrType,1719 .tag = .ptr_type,
1720 .main_token = asterisk,1720 .main_token = asterisk,
1721 .data = .{1721 .data = .{
1722 .lhs = try p.addExtra(Node.PtrType{1722 .lhs = try p.addExtra(Node.PtrType{
...@@ -1729,7 +1729,7 @@ const Parser = struct {...@@ -1729,7 +1729,7 @@ const Parser = struct {
1729 }1729 }
1730 } else {1730 } else {
1731 return p.addNode(.{1731 return p.addNode(.{
1732 .tag = .PtrTypeBitRange,1732 .tag = .ptr_type_bit_range,
1733 .main_token = asterisk,1733 .main_token = asterisk,
1734 .data = .{1734 .data = .{
1735 .lhs = try p.addExtra(Node.PtrTypeBitRange{1735 .lhs = try p.addExtra(Node.PtrTypeBitRange{
...@@ -1762,7 +1762,7 @@ const Parser = struct {...@@ -1762,7 +1762,7 @@ const Parser = struct {
1762 if (len_expr == 0) {1762 if (len_expr == 0) {
1763 if (sentinel == 0) {1763 if (sentinel == 0) {
1764 return p.addNode(.{1764 return p.addNode(.{
1765 .tag = .PtrTypeAligned,1765 .tag = .ptr_type_aligned,
1766 .main_token = lbracket,1766 .main_token = lbracket,
1767 .data = .{1767 .data = .{
1768 .lhs = mods.align_node,1768 .lhs = mods.align_node,
...@@ -1771,7 +1771,7 @@ const Parser = struct {...@@ -1771,7 +1771,7 @@ const Parser = struct {
1771 });1771 });
1772 } else if (mods.align_node == 0) {1772 } else if (mods.align_node == 0) {
1773 return p.addNode(.{1773 return p.addNode(.{
1774 .tag = .PtrTypeSentinel,1774 .tag = .ptr_type_sentinel,
1775 .main_token = lbracket,1775 .main_token = lbracket,
1776 .data = .{1776 .data = .{
1777 .lhs = sentinel,1777 .lhs = sentinel,
...@@ -1780,7 +1780,7 @@ const Parser = struct {...@@ -1780,7 +1780,7 @@ const Parser = struct {
1780 });1780 });
1781 } else {1781 } else {
1782 return p.addNode(.{1782 return p.addNode(.{
1783 .tag = .PtrType,1783 .tag = .ptr_type,
1784 .main_token = lbracket,1784 .main_token = lbracket,
1785 .data = .{1785 .data = .{
1786 .lhs = try p.addExtra(Node.PtrType{1786 .lhs = try p.addExtra(Node.PtrType{
...@@ -1800,7 +1800,7 @@ const Parser = struct {...@@ -1800,7 +1800,7 @@ const Parser = struct {
1800 }1800 }
1801 if (sentinel == 0) {1801 if (sentinel == 0) {
1802 return p.addNode(.{1802 return p.addNode(.{
1803 .tag = .ArrayType,1803 .tag = .array_type,
1804 .main_token = lbracket,1804 .main_token = lbracket,
1805 .data = .{1805 .data = .{
1806 .lhs = len_expr,1806 .lhs = len_expr,
...@@ -1809,7 +1809,7 @@ const Parser = struct {...@@ -1809,7 +1809,7 @@ const Parser = struct {
1809 });1809 });
1810 } else {1810 } else {
1811 return p.addNode(.{1811 return p.addNode(.{
1812 .tag = .ArrayTypeSentinel,1812 .tag = .array_type_sentinel,
1813 .main_token = lbracket,1813 .main_token = lbracket,
1814 .data = .{1814 .data = .{
1815 .lhs = len_expr,1815 .lhs = len_expr,
...@@ -1854,7 +1854,7 @@ const Parser = struct {...@@ -1854,7 +1854,7 @@ const Parser = struct {
1854 .keyword_break => {1854 .keyword_break => {
1855 p.tok_i += 1;1855 p.tok_i += 1;
1856 return p.addNode(.{1856 return p.addNode(.{
1857 .tag = .Break,1857 .tag = .@"break",
1858 .main_token = p.tok_i - 1,1858 .main_token = p.tok_i - 1,
1859 .data = .{1859 .data = .{
1860 .lhs = try p.parseBreakLabel(),1860 .lhs = try p.parseBreakLabel(),
...@@ -1865,7 +1865,7 @@ const Parser = struct {...@@ -1865,7 +1865,7 @@ const Parser = struct {
1865 .keyword_continue => {1865 .keyword_continue => {
1866 p.tok_i += 1;1866 p.tok_i += 1;
1867 return p.addNode(.{1867 return p.addNode(.{
1868 .tag = .Continue,1868 .tag = .@"continue",
1869 .main_token = p.tok_i - 1,1869 .main_token = p.tok_i - 1,
1870 .data = .{1870 .data = .{
1871 .lhs = try p.parseBreakLabel(),1871 .lhs = try p.parseBreakLabel(),
...@@ -1876,7 +1876,7 @@ const Parser = struct {...@@ -1876,7 +1876,7 @@ const Parser = struct {
1876 .keyword_comptime => {1876 .keyword_comptime => {
1877 p.tok_i += 1;1877 p.tok_i += 1;
1878 return p.addNode(.{1878 return p.addNode(.{
1879 .tag = .Comptime,1879 .tag = .@"comptime",
1880 .main_token = p.tok_i - 1,1880 .main_token = p.tok_i - 1,
1881 .data = .{1881 .data = .{
1882 .lhs = try p.expectExpr(),1882 .lhs = try p.expectExpr(),
...@@ -1887,7 +1887,7 @@ const Parser = struct {...@@ -1887,7 +1887,7 @@ const Parser = struct {
1887 .keyword_nosuspend => {1887 .keyword_nosuspend => {
1888 p.tok_i += 1;1888 p.tok_i += 1;
1889 return p.addNode(.{1889 return p.addNode(.{
1890 .tag = .Nosuspend,1890 .tag = .@"nosuspend",
1891 .main_token = p.tok_i - 1,1891 .main_token = p.tok_i - 1,
1892 .data = .{1892 .data = .{
1893 .lhs = try p.expectExpr(),1893 .lhs = try p.expectExpr(),
...@@ -1898,7 +1898,7 @@ const Parser = struct {...@@ -1898,7 +1898,7 @@ const Parser = struct {
1898 .keyword_resume => {1898 .keyword_resume => {
1899 p.tok_i += 1;1899 p.tok_i += 1;
1900 return p.addNode(.{1900 return p.addNode(.{
1901 .tag = .Resume,1901 .tag = .@"resume",
1902 .main_token = p.tok_i - 1,1902 .main_token = p.tok_i - 1,
1903 .data = .{1903 .data = .{
1904 .lhs = try p.expectExpr(),1904 .lhs = try p.expectExpr(),
...@@ -1909,7 +1909,7 @@ const Parser = struct {...@@ -1909,7 +1909,7 @@ const Parser = struct {
1909 .keyword_return => {1909 .keyword_return => {
1910 p.tok_i += 1;1910 p.tok_i += 1;
1911 return p.addNode(.{1911 return p.addNode(.{
1912 .tag = .Return,1912 .tag = .@"return",
1913 .main_token = p.tok_i - 1,1913 .main_token = p.tok_i - 1,
1914 .data = .{1914 .data = .{
1915 .lhs = try p.parseExpr(),1915 .lhs = try p.parseExpr(),
...@@ -1976,7 +1976,7 @@ const Parser = struct {...@@ -1976,7 +1976,7 @@ const Parser = struct {
19761976
1977 if (p.eatToken(.r_brace)) |_| {1977 if (p.eatToken(.r_brace)) |_| {
1978 return p.addNode(.{1978 return p.addNode(.{
1979 .tag = .BlockTwo,1979 .tag = .block_two,
1980 .main_token = lbrace,1980 .main_token = lbrace,
1981 .data = .{1981 .data = .{
1982 .lhs = 0,1982 .lhs = 0,
...@@ -1989,7 +1989,7 @@ const Parser = struct {...@@ -1989,7 +1989,7 @@ const Parser = struct {
1989 if (p.eatToken(.r_brace)) |_| {1989 if (p.eatToken(.r_brace)) |_| {
1990 const semicolon = p.token_tags[p.tok_i - 2] == .semicolon;1990 const semicolon = p.token_tags[p.tok_i - 2] == .semicolon;
1991 return p.addNode(.{1991 return p.addNode(.{
1992 .tag = if (semicolon) .BlockTwoSemicolon else .BlockTwo,1992 .tag = if (semicolon) .block_two_semicolon else .block_two,
1993 .main_token = lbrace,1993 .main_token = lbrace,
1994 .data = .{1994 .data = .{
1995 .lhs = stmt_one,1995 .lhs = stmt_one,
...@@ -2001,7 +2001,7 @@ const Parser = struct {...@@ -2001,7 +2001,7 @@ const Parser = struct {
2001 if (p.eatToken(.r_brace)) |_| {2001 if (p.eatToken(.r_brace)) |_| {
2002 const semicolon = p.token_tags[p.tok_i - 2] == .semicolon;2002 const semicolon = p.token_tags[p.tok_i - 2] == .semicolon;
2003 return p.addNode(.{2003 return p.addNode(.{
2004 .tag = if (semicolon) .BlockTwoSemicolon else .BlockTwo,2004 .tag = if (semicolon) .block_two_semicolon else .block_two,
2005 .main_token = lbrace,2005 .main_token = lbrace,
2006 .data = .{2006 .data = .{
2007 .lhs = stmt_one,2007 .lhs = stmt_one,
...@@ -2025,7 +2025,7 @@ const Parser = struct {...@@ -2025,7 +2025,7 @@ const Parser = struct {
2025 const semicolon = p.token_tags[p.tok_i - 2] == .semicolon;2025 const semicolon = p.token_tags[p.tok_i - 2] == .semicolon;
2026 const statements_span = try p.listToSpan(statements.items);2026 const statements_span = try p.listToSpan(statements.items);
2027 return p.addNode(.{2027 return p.addNode(.{
2028 .tag = if (semicolon) .BlockSemicolon else .Block,2028 .tag = if (semicolon) .block_semicolon else .block,
2029 .main_token = lbrace,2029 .main_token = lbrace,
2030 .data = .{2030 .data = .{
2031 .lhs = statements_span.start,2031 .lhs = statements_span.start,
...@@ -2046,7 +2046,7 @@ const Parser = struct {...@@ -2046,7 +2046,7 @@ const Parser = struct {
2046 const then_expr = try p.expectExpr();2046 const then_expr = try p.expectExpr();
2047 const else_token = p.eatToken(.keyword_else) orelse {2047 const else_token = p.eatToken(.keyword_else) orelse {
2048 return p.addNode(.{2048 return p.addNode(.{
2049 .tag = .ForSimple,2049 .tag = .for_simple,
2050 .main_token = for_token,2050 .main_token = for_token,
2051 .data = .{2051 .data = .{
2052 .lhs = array_expr,2052 .lhs = array_expr,
...@@ -2056,7 +2056,7 @@ const Parser = struct {...@@ -2056,7 +2056,7 @@ const Parser = struct {
2056 };2056 };
2057 const else_expr = try p.expectExpr();2057 const else_expr = try p.expectExpr();
2058 return p.addNode(.{2058 return p.addNode(.{
2059 .tag = .For,2059 .tag = .@"for",
2060 .main_token = for_token,2060 .main_token = for_token,
2061 .data = .{2061 .data = .{
2062 .lhs = array_expr,2062 .lhs = array_expr,
...@@ -2082,7 +2082,7 @@ const Parser = struct {...@@ -2082,7 +2082,7 @@ const Parser = struct {
2082 const else_token = p.eatToken(.keyword_else) orelse {2082 const else_token = p.eatToken(.keyword_else) orelse {
2083 if (cont_expr == 0) {2083 if (cont_expr == 0) {
2084 return p.addNode(.{2084 return p.addNode(.{
2085 .tag = .WhileSimple,2085 .tag = .while_simple,
2086 .main_token = while_token,2086 .main_token = while_token,
2087 .data = .{2087 .data = .{
2088 .lhs = condition,2088 .lhs = condition,
...@@ -2091,7 +2091,7 @@ const Parser = struct {...@@ -2091,7 +2091,7 @@ const Parser = struct {
2091 });2091 });
2092 } else {2092 } else {
2093 return p.addNode(.{2093 return p.addNode(.{
2094 .tag = .WhileCont,2094 .tag = .while_cont,
2095 .main_token = while_token,2095 .main_token = while_token,
2096 .data = .{2096 .data = .{
2097 .lhs = condition,2097 .lhs = condition,
...@@ -2106,7 +2106,7 @@ const Parser = struct {...@@ -2106,7 +2106,7 @@ const Parser = struct {
2106 const else_payload = try p.parsePayload();2106 const else_payload = try p.parsePayload();
2107 const else_expr = try p.expectExpr();2107 const else_expr = try p.expectExpr();
2108 return p.addNode(.{2108 return p.addNode(.{
2109 .tag = .While,2109 .tag = .@"while",
2110 .main_token = while_token,2110 .main_token = while_token,
2111 .data = .{2111 .data = .{
2112 .lhs = condition,2112 .lhs = condition,
...@@ -2134,7 +2134,7 @@ const Parser = struct {...@@ -2134,7 +2134,7 @@ const Parser = struct {
21342134
2135 if (p.eatToken(.r_brace)) |_| {2135 if (p.eatToken(.r_brace)) |_| {
2136 return p.addNode(.{2136 return p.addNode(.{
2137 .tag = .StructInitOne,2137 .tag = .struct_init_one,
2138 .main_token = lbrace,2138 .main_token = lbrace,
2139 .data = .{2139 .data = .{
2140 .lhs = lhs,2140 .lhs = lhs,
...@@ -2147,7 +2147,7 @@ const Parser = struct {...@@ -2147,7 +2147,7 @@ const Parser = struct {
2147 const comma_one = p.eatToken(.comma);2147 const comma_one = p.eatToken(.comma);
2148 if (p.eatToken(.r_brace)) |_| {2148 if (p.eatToken(.r_brace)) |_| {
2149 return p.addNode(.{2149 return p.addNode(.{
2150 .tag = if (comma_one != null) .StructInitOneComma else .StructInitOne,2150 .tag = if (comma_one != null) .struct_init_one_comma else .struct_init_one,
2151 .main_token = lbrace,2151 .main_token = lbrace,
2152 .data = .{2152 .data = .{
2153 .lhs = lhs,2153 .lhs = lhs,
...@@ -2192,7 +2192,7 @@ const Parser = struct {...@@ -2192,7 +2192,7 @@ const Parser = struct {
2192 }2192 }
2193 const span = try p.listToSpan(init_list.items);2193 const span = try p.listToSpan(init_list.items);
2194 return p.addNode(.{2194 return p.addNode(.{
2195 .tag = if (p.token_tags[p.tok_i - 2] == .comma) .StructInitComma else .StructInit,2195 .tag = if (p.token_tags[p.tok_i - 2] == .comma) .struct_init_comma else .struct_init,
2196 .main_token = lbrace,2196 .main_token = lbrace,
2197 .data = .{2197 .data = .{
2198 .lhs = lhs,2198 .lhs = lhs,
...@@ -2208,7 +2208,7 @@ const Parser = struct {...@@ -2208,7 +2208,7 @@ const Parser = struct {
2208 const comma_one = p.eatToken(.comma);2208 const comma_one = p.eatToken(.comma);
2209 if (p.eatToken(.r_brace)) |_| {2209 if (p.eatToken(.r_brace)) |_| {
2210 return p.addNode(.{2210 return p.addNode(.{
2211 .tag = if (comma_one != null) .ArrayInitOneComma else .ArrayInitOne,2211 .tag = if (comma_one != null) .array_init_one_comma else .array_init_one,
2212 .main_token = lbrace,2212 .main_token = lbrace,
2213 .data = .{2213 .data = .{
2214 .lhs = lhs,2214 .lhs = lhs,
...@@ -2239,7 +2239,7 @@ const Parser = struct {...@@ -2239,7 +2239,7 @@ const Parser = struct {
2239 _ = try p.expectToken(.r_brace);2239 _ = try p.expectToken(.r_brace);
2240 const span = try p.listToSpan(init_list.items);2240 const span = try p.listToSpan(init_list.items);
2241 return p.addNode(.{2241 return p.addNode(.{
2242 .tag = if (trailing_comma) .ArrayInitComma else .ArrayInit,2242 .tag = if (trailing_comma) .array_init_comma else .array_init,
2243 .main_token = lbrace,2243 .main_token = lbrace,
2244 .data = .{2244 .data = .{
2245 .lhs = lhs,2245 .lhs = lhs,
...@@ -2257,7 +2257,7 @@ const Parser = struct {...@@ -2257,7 +2257,7 @@ const Parser = struct {
2257 if (suffix_expr == 0) return null_node;2257 if (suffix_expr == 0) return null_node;
2258 const bang = p.eatToken(.bang) orelse return suffix_expr;2258 const bang = p.eatToken(.bang) orelse return suffix_expr;
2259 return p.addNode(.{2259 return p.addNode(.{
2260 .tag = .ErrorUnion,2260 .tag = .error_union,
2261 .main_token = bang,2261 .main_token = bang,
2262 .data = .{2262 .data = .{
2263 .lhs = suffix_expr,2263 .lhs = suffix_expr,
...@@ -2286,7 +2286,7 @@ const Parser = struct {...@@ -2286,7 +2286,7 @@ const Parser = struct {
2286 };2286 };
2287 if (p.eatToken(.r_paren)) |_| {2287 if (p.eatToken(.r_paren)) |_| {
2288 return p.addNode(.{2288 return p.addNode(.{
2289 .tag = .AsyncCallOne,2289 .tag = .async_call_one,
2290 .main_token = lparen,2290 .main_token = lparen,
2291 .data = .{2291 .data = .{
2292 .lhs = res,2292 .lhs = res,
...@@ -2298,7 +2298,7 @@ const Parser = struct {...@@ -2298,7 +2298,7 @@ const Parser = struct {
2298 const comma_one = p.eatToken(.comma);2298 const comma_one = p.eatToken(.comma);
2299 if (p.eatToken(.r_paren)) |_| {2299 if (p.eatToken(.r_paren)) |_| {
2300 return p.addNode(.{2300 return p.addNode(.{
2301 .tag = if (comma_one == null) .AsyncCallOne else .AsyncCallOneComma,2301 .tag = if (comma_one == null) .async_call_one else .async_call_one_comma,
2302 .main_token = lparen,2302 .main_token = lparen,
2303 .data = .{2303 .data = .{
2304 .lhs = res,2304 .lhs = res,
...@@ -2325,7 +2325,7 @@ const Parser = struct {...@@ -2325,7 +2325,7 @@ const Parser = struct {
2325 if (p.eatToken(.r_paren)) |_| {2325 if (p.eatToken(.r_paren)) |_| {
2326 const span = try p.listToSpan(param_list.items);2326 const span = try p.listToSpan(param_list.items);
2327 return p.addNode(.{2327 return p.addNode(.{
2328 .tag = .AsyncCallComma,2328 .tag = .async_call_comma,
2329 .main_token = lparen,2329 .main_token = lparen,
2330 .data = .{2330 .data = .{
2331 .lhs = res,2331 .lhs = res,
...@@ -2342,7 +2342,7 @@ const Parser = struct {...@@ -2342,7 +2342,7 @@ const Parser = struct {
2342 .r_paren => {2342 .r_paren => {
2343 const span = try p.listToSpan(param_list.items);2343 const span = try p.listToSpan(param_list.items);
2344 return p.addNode(.{2344 return p.addNode(.{
2345 .tag = .AsyncCall,2345 .tag = .async_call,
2346 .main_token = lparen,2346 .main_token = lparen,
2347 .data = .{2347 .data = .{
2348 .lhs = res,2348 .lhs = res,
...@@ -2387,7 +2387,7 @@ const Parser = struct {...@@ -2387,7 +2387,7 @@ const Parser = struct {
2387 const lparen = p.eatToken(.l_paren) orelse return res;2387 const lparen = p.eatToken(.l_paren) orelse return res;
2388 if (p.eatToken(.r_paren)) |_| {2388 if (p.eatToken(.r_paren)) |_| {
2389 break :res try p.addNode(.{2389 break :res try p.addNode(.{
2390 .tag = .CallOne,2390 .tag = .call_one,
2391 .main_token = lparen,2391 .main_token = lparen,
2392 .data = .{2392 .data = .{
2393 .lhs = res,2393 .lhs = res,
...@@ -2399,7 +2399,7 @@ const Parser = struct {...@@ -2399,7 +2399,7 @@ const Parser = struct {
2399 const comma_one = p.eatToken(.comma);2399 const comma_one = p.eatToken(.comma);
2400 if (p.eatToken(.r_paren)) |_| {2400 if (p.eatToken(.r_paren)) |_| {
2401 break :res try p.addNode(.{2401 break :res try p.addNode(.{
2402 .tag = if (comma_one == null) .CallOne else .CallOneComma,2402 .tag = if (comma_one == null) .call_one else .call_one_comma,
2403 .main_token = lparen,2403 .main_token = lparen,
2404 .data = .{2404 .data = .{
2405 .lhs = res,2405 .lhs = res,
...@@ -2426,7 +2426,7 @@ const Parser = struct {...@@ -2426,7 +2426,7 @@ const Parser = struct {
2426 if (p.eatToken(.r_paren)) |_| {2426 if (p.eatToken(.r_paren)) |_| {
2427 const span = try p.listToSpan(param_list.items);2427 const span = try p.listToSpan(param_list.items);
2428 break :res try p.addNode(.{2428 break :res try p.addNode(.{
2429 .tag = .CallComma,2429 .tag = .call_comma,
2430 .main_token = lparen,2430 .main_token = lparen,
2431 .data = .{2431 .data = .{
2432 .lhs = res,2432 .lhs = res,
...@@ -2443,7 +2443,7 @@ const Parser = struct {...@@ -2443,7 +2443,7 @@ const Parser = struct {
2443 .r_paren => {2443 .r_paren => {
2444 const span = try p.listToSpan(param_list.items);2444 const span = try p.listToSpan(param_list.items);
2445 break :res try p.addNode(.{2445 break :res try p.addNode(.{
2446 .tag = .Call,2446 .tag = .call,
2447 .main_token = lparen,2447 .main_token = lparen,
2448 .data = .{2448 .data = .{
2449 .lhs = res,2449 .lhs = res,
...@@ -2518,7 +2518,7 @@ const Parser = struct {...@@ -2518,7 +2518,7 @@ const Parser = struct {
2518 fn parsePrimaryTypeExpr(p: *Parser) !Node.Index {2518 fn parsePrimaryTypeExpr(p: *Parser) !Node.Index {
2519 switch (p.token_tags[p.tok_i]) {2519 switch (p.token_tags[p.tok_i]) {
2520 .char_literal => return p.addNode(.{2520 .char_literal => return p.addNode(.{
2521 .tag = .CharLiteral,2521 .tag = .char_literal,
2522 .main_token = p.nextToken(),2522 .main_token = p.nextToken(),
2523 .data = .{2523 .data = .{
2524 .lhs = undefined,2524 .lhs = undefined,
...@@ -2526,7 +2526,7 @@ const Parser = struct {...@@ -2526,7 +2526,7 @@ const Parser = struct {
2526 },2526 },
2527 }),2527 }),
2528 .integer_literal => return p.addNode(.{2528 .integer_literal => return p.addNode(.{
2529 .tag = .IntegerLiteral,2529 .tag = .integer_literal,
2530 .main_token = p.nextToken(),2530 .main_token = p.nextToken(),
2531 .data = .{2531 .data = .{
2532 .lhs = undefined,2532 .lhs = undefined,
...@@ -2534,7 +2534,7 @@ const Parser = struct {...@@ -2534,7 +2534,7 @@ const Parser = struct {
2534 },2534 },
2535 }),2535 }),
2536 .float_literal => return p.addNode(.{2536 .float_literal => return p.addNode(.{
2537 .tag = .FloatLiteral,2537 .tag = .float_literal,
2538 .main_token = p.nextToken(),2538 .main_token = p.nextToken(),
2539 .data = .{2539 .data = .{
2540 .lhs = undefined,2540 .lhs = undefined,
...@@ -2542,7 +2542,7 @@ const Parser = struct {...@@ -2542,7 +2542,7 @@ const Parser = struct {
2542 },2542 },
2543 }),2543 }),
2544 .keyword_false => return p.addNode(.{2544 .keyword_false => return p.addNode(.{
2545 .tag = .FalseLiteral,2545 .tag = .false_literal,
2546 .main_token = p.nextToken(),2546 .main_token = p.nextToken(),
2547 .data = .{2547 .data = .{
2548 .lhs = undefined,2548 .lhs = undefined,
...@@ -2550,7 +2550,7 @@ const Parser = struct {...@@ -2550,7 +2550,7 @@ const Parser = struct {
2550 },2550 },
2551 }),2551 }),
2552 .keyword_true => return p.addNode(.{2552 .keyword_true => return p.addNode(.{
2553 .tag = .TrueLiteral,2553 .tag = .true_literal,
2554 .main_token = p.nextToken(),2554 .main_token = p.nextToken(),
2555 .data = .{2555 .data = .{
2556 .lhs = undefined,2556 .lhs = undefined,
...@@ -2558,7 +2558,7 @@ const Parser = struct {...@@ -2558,7 +2558,7 @@ const Parser = struct {
2558 },2558 },
2559 }),2559 }),
2560 .keyword_null => return p.addNode(.{2560 .keyword_null => return p.addNode(.{
2561 .tag = .NullLiteral,2561 .tag = .null_literal,
2562 .main_token = p.nextToken(),2562 .main_token = p.nextToken(),
2563 .data = .{2563 .data = .{
2564 .lhs = undefined,2564 .lhs = undefined,
...@@ -2566,7 +2566,7 @@ const Parser = struct {...@@ -2566,7 +2566,7 @@ const Parser = struct {
2566 },2566 },
2567 }),2567 }),
2568 .keyword_undefined => return p.addNode(.{2568 .keyword_undefined => return p.addNode(.{
2569 .tag = .UndefinedLiteral,2569 .tag = .undefined_literal,
2570 .main_token = p.nextToken(),2570 .main_token = p.nextToken(),
2571 .data = .{2571 .data = .{
2572 .lhs = undefined,2572 .lhs = undefined,
...@@ -2574,7 +2574,7 @@ const Parser = struct {...@@ -2574,7 +2574,7 @@ const Parser = struct {
2574 },2574 },
2575 }),2575 }),
2576 .keyword_unreachable => return p.addNode(.{2576 .keyword_unreachable => return p.addNode(.{
2577 .tag = .UnreachableLiteral,2577 .tag = .unreachable_literal,
2578 .main_token = p.nextToken(),2578 .main_token = p.nextToken(),
2579 .data = .{2579 .data = .{
2580 .lhs = undefined,2580 .lhs = undefined,
...@@ -2582,7 +2582,7 @@ const Parser = struct {...@@ -2582,7 +2582,7 @@ const Parser = struct {
2582 },2582 },
2583 }),2583 }),
2584 .keyword_anyframe => return p.addNode(.{2584 .keyword_anyframe => return p.addNode(.{
2585 .tag = .AnyFrameLiteral,2585 .tag = .anyframe_literal,
2586 .main_token = p.nextToken(),2586 .main_token = p.nextToken(),
2587 .data = .{2587 .data = .{
2588 .lhs = undefined,2588 .lhs = undefined,
...@@ -2592,7 +2592,7 @@ const Parser = struct {...@@ -2592,7 +2592,7 @@ const Parser = struct {
2592 .string_literal => {2592 .string_literal => {
2593 const main_token = p.nextToken();2593 const main_token = p.nextToken();
2594 return p.addNode(.{2594 return p.addNode(.{
2595 .tag = .StringLiteral,2595 .tag = .string_literal,
2596 .main_token = main_token,2596 .main_token = main_token,
2597 .data = .{2597 .data = .{
2598 .lhs = main_token,2598 .lhs = main_token,
...@@ -2620,7 +2620,7 @@ const Parser = struct {...@@ -2620,7 +2620,7 @@ const Parser = struct {
2620 => return p.parseContainerDeclAuto(),2620 => return p.parseContainerDeclAuto(),
26212621
2622 .keyword_comptime => return p.addNode(.{2622 .keyword_comptime => return p.addNode(.{
2623 .tag = .Comptime,2623 .tag = .@"comptime",
2624 .main_token = p.nextToken(),2624 .main_token = p.nextToken(),
2625 .data = .{2625 .data = .{
2626 .lhs = try p.expectTypeExpr(),2626 .lhs = try p.expectTypeExpr(),
...@@ -2633,7 +2633,7 @@ const Parser = struct {...@@ -2633,7 +2633,7 @@ const Parser = struct {
2633 p.tok_i += 1;2633 p.tok_i += 1;
2634 }2634 }
2635 return p.addNode(.{2635 return p.addNode(.{
2636 .tag = .StringLiteral,2636 .tag = .string_literal,
2637 .main_token = first_line,2637 .main_token = first_line,
2638 .data = .{2638 .data = .{
2639 .lhs = first_line,2639 .lhs = first_line,
...@@ -2662,7 +2662,7 @@ const Parser = struct {...@@ -2662,7 +2662,7 @@ const Parser = struct {
2662 return p.parseWhileTypeExpr();2662 return p.parseWhileTypeExpr();
2663 },2663 },
2664 else => return p.addNode(.{2664 else => return p.addNode(.{
2665 .tag = .Identifier,2665 .tag = .identifier,
2666 .main_token = p.nextToken(),2666 .main_token = p.nextToken(),
2667 .data = .{2667 .data = .{
2668 .lhs = undefined,2668 .lhs = undefined,
...@@ -2671,7 +2671,7 @@ const Parser = struct {...@@ -2671,7 +2671,7 @@ const Parser = struct {
2671 }),2671 }),
2672 },2672 },
2673 else => return p.addNode(.{2673 else => return p.addNode(.{
2674 .tag = .Identifier,2674 .tag = .identifier,
2675 .main_token = p.nextToken(),2675 .main_token = p.nextToken(),
2676 .data = .{2676 .data = .{
2677 .lhs = undefined,2677 .lhs = undefined,
...@@ -2681,7 +2681,7 @@ const Parser = struct {...@@ -2681,7 +2681,7 @@ const Parser = struct {
2681 },2681 },
2682 .period => switch (p.token_tags[p.tok_i + 1]) {2682 .period => switch (p.token_tags[p.tok_i + 1]) {
2683 .identifier => return p.addNode(.{2683 .identifier => return p.addNode(.{
2684 .tag = .EnumLiteral,2684 .tag = .enum_literal,
2685 .data = .{2685 .data = .{
2686 .lhs = p.nextToken(), // dot2686 .lhs = p.nextToken(), // dot
2687 .rhs = undefined,2687 .rhs = undefined,
...@@ -2697,7 +2697,7 @@ const Parser = struct {...@@ -2697,7 +2697,7 @@ const Parser = struct {
26972697
2698 if (p.eatToken(.r_brace)) |_| {2698 if (p.eatToken(.r_brace)) |_| {
2699 return p.addNode(.{2699 return p.addNode(.{
2700 .tag = .StructInitDotTwo,2700 .tag = .struct_init_dot_two,
2701 .main_token = lbrace,2701 .main_token = lbrace,
2702 .data = .{2702 .data = .{
2703 .lhs = 0,2703 .lhs = 0,
...@@ -2710,7 +2710,7 @@ const Parser = struct {...@@ -2710,7 +2710,7 @@ const Parser = struct {
2710 const comma_one = p.eatToken(.comma);2710 const comma_one = p.eatToken(.comma);
2711 if (p.eatToken(.r_brace)) |_| {2711 if (p.eatToken(.r_brace)) |_| {
2712 return p.addNode(.{2712 return p.addNode(.{
2713 .tag = if (comma_one != null) .StructInitDotTwoComma else .StructInitDotTwo,2713 .tag = if (comma_one != null) .struct_init_dot_two_comma else .struct_init_dot_two,
2714 .main_token = lbrace,2714 .main_token = lbrace,
2715 .data = .{2715 .data = .{
2716 .lhs = field_init_one,2716 .lhs = field_init_one,
...@@ -2727,7 +2727,7 @@ const Parser = struct {...@@ -2727,7 +2727,7 @@ const Parser = struct {
2727 const comma_two = p.eatToken(.comma);2727 const comma_two = p.eatToken(.comma);
2728 if (p.eatToken(.r_brace)) |_| {2728 if (p.eatToken(.r_brace)) |_| {
2729 return p.addNode(.{2729 return p.addNode(.{
2730 .tag = if (comma_two != null) .StructInitDotTwoComma else .StructInitDotTwo,2730 .tag = if (comma_two != null) .struct_init_dot_two_comma else .struct_init_dot_two,
2731 .main_token = lbrace,2731 .main_token = lbrace,
2732 .data = .{2732 .data = .{
2733 .lhs = field_init_one,2733 .lhs = field_init_one,
...@@ -2778,7 +2778,7 @@ const Parser = struct {...@@ -2778,7 +2778,7 @@ const Parser = struct {
2778 const span = try p.listToSpan(init_list.items);2778 const span = try p.listToSpan(init_list.items);
2779 const trailing_comma = p.token_tags[p.tok_i - 2] == .comma;2779 const trailing_comma = p.token_tags[p.tok_i - 2] == .comma;
2780 return p.addNode(.{2780 return p.addNode(.{
2781 .tag = if (trailing_comma) .StructInitDotComma else .StructInitDot,2781 .tag = if (trailing_comma) .struct_init_dot_comma else .struct_init_dot,
2782 .main_token = lbrace,2782 .main_token = lbrace,
2783 .data = .{2783 .data = .{
2784 .lhs = span.start,2784 .lhs = span.start,
...@@ -2791,7 +2791,7 @@ const Parser = struct {...@@ -2791,7 +2791,7 @@ const Parser = struct {
2791 const comma_one = p.eatToken(.comma);2791 const comma_one = p.eatToken(.comma);
2792 if (p.eatToken(.r_brace)) |_| {2792 if (p.eatToken(.r_brace)) |_| {
2793 return p.addNode(.{2793 return p.addNode(.{
2794 .tag = if (comma_one != null) .ArrayInitDotTwoComma else .ArrayInitDotTwo,2794 .tag = if (comma_one != null) .array_init_dot_two_comma else .array_init_dot_two,
2795 .main_token = lbrace,2795 .main_token = lbrace,
2796 .data = .{2796 .data = .{
2797 .lhs = elem_init_one,2797 .lhs = elem_init_one,
...@@ -2808,7 +2808,7 @@ const Parser = struct {...@@ -2808,7 +2808,7 @@ const Parser = struct {
2808 const comma_two = p.eatToken(.comma);2808 const comma_two = p.eatToken(.comma);
2809 if (p.eatToken(.r_brace)) |_| {2809 if (p.eatToken(.r_brace)) |_| {
2810 return p.addNode(.{2810 return p.addNode(.{
2811 .tag = if (comma_two != null) .ArrayInitDotTwoComma else .ArrayInitDotTwo,2811 .tag = if (comma_two != null) .array_init_dot_two_comma else .array_init_dot_two,
2812 .main_token = lbrace,2812 .main_token = lbrace,
2813 .data = .{2813 .data = .{
2814 .lhs = elem_init_one,2814 .lhs = elem_init_one,
...@@ -2858,7 +2858,7 @@ const Parser = struct {...@@ -2858,7 +2858,7 @@ const Parser = struct {
2858 }2858 }
2859 const span = try p.listToSpan(init_list.items);2859 const span = try p.listToSpan(init_list.items);
2860 return p.addNode(.{2860 return p.addNode(.{
2861 .tag = if (p.token_tags[p.tok_i - 2] == .comma) .ArrayInitDotComma else .ArrayInitDot,2861 .tag = if (p.token_tags[p.tok_i - 2] == .comma) .array_init_dot_comma else .array_init_dot,
2862 .main_token = lbrace,2862 .main_token = lbrace,
2863 .data = .{2863 .data = .{
2864 .lhs = span.start,2864 .lhs = span.start,
...@@ -2875,7 +2875,7 @@ const Parser = struct {...@@ -2875,7 +2875,7 @@ const Parser = struct {
28752875
2876 if (p.eatToken(.r_brace)) |rbrace| {2876 if (p.eatToken(.r_brace)) |rbrace| {
2877 return p.addNode(.{2877 return p.addNode(.{
2878 .tag = .ErrorSetDecl,2878 .tag = .error_set_decl,
2879 .main_token = error_token,2879 .main_token = error_token,
2880 .data = .{2880 .data = .{
2881 .lhs = undefined,2881 .lhs = undefined,
...@@ -2913,7 +2913,7 @@ const Parser = struct {...@@ -2913,7 +2913,7 @@ const Parser = struct {
2913 }2913 }
2914 }2914 }
2915 return p.addNode(.{2915 return p.addNode(.{
2916 .tag = .ErrorSetDecl,2916 .tag = .error_set_decl,
2917 .main_token = error_token,2917 .main_token = error_token,
2918 .data = .{2918 .data = .{
2919 .lhs = undefined,2919 .lhs = undefined,
...@@ -2922,7 +2922,7 @@ const Parser = struct {...@@ -2922,7 +2922,7 @@ const Parser = struct {
2922 });2922 });
2923 },2923 },
2924 else => return p.addNode(.{2924 else => return p.addNode(.{
2925 .tag = .ErrorValue,2925 .tag = .error_value,
2926 .main_token = p.nextToken(),2926 .main_token = p.nextToken(),
2927 .data = .{2927 .data = .{
2928 .lhs = try p.expectToken(.period),2928 .lhs = try p.expectToken(.period),
...@@ -2931,7 +2931,7 @@ const Parser = struct {...@@ -2931,7 +2931,7 @@ const Parser = struct {
2931 }),2931 }),
2932 },2932 },
2933 .l_paren => return p.addNode(.{2933 .l_paren => return p.addNode(.{
2934 .tag = .GroupedExpression,2934 .tag = .grouped_expression,
2935 .main_token = p.nextToken(),2935 .main_token = p.nextToken(),
2936 .data = .{2936 .data = .{
2937 .lhs = try p.expectExpr(),2937 .lhs = try p.expectExpr(),
...@@ -2962,7 +2962,7 @@ const Parser = struct {...@@ -2962,7 +2962,7 @@ const Parser = struct {
2962 const then_expr = try p.expectExpr();2962 const then_expr = try p.expectExpr();
2963 const else_token = p.eatToken(.keyword_else) orelse {2963 const else_token = p.eatToken(.keyword_else) orelse {
2964 return p.addNode(.{2964 return p.addNode(.{
2965 .tag = .ForSimple,2965 .tag = .for_simple,
2966 .main_token = for_token,2966 .main_token = for_token,
2967 .data = .{2967 .data = .{
2968 .lhs = array_expr,2968 .lhs = array_expr,
...@@ -2972,7 +2972,7 @@ const Parser = struct {...@@ -2972,7 +2972,7 @@ const Parser = struct {
2972 };2972 };
2973 const else_expr = try p.expectTypeExpr();2973 const else_expr = try p.expectTypeExpr();
2974 return p.addNode(.{2974 return p.addNode(.{
2975 .tag = .For,2975 .tag = .@"for",
2976 .main_token = for_token,2976 .main_token = for_token,
2977 .data = .{2977 .data = .{
2978 .lhs = array_expr,2978 .lhs = array_expr,
...@@ -2998,7 +2998,7 @@ const Parser = struct {...@@ -2998,7 +2998,7 @@ const Parser = struct {
2998 const else_token = p.eatToken(.keyword_else) orelse {2998 const else_token = p.eatToken(.keyword_else) orelse {
2999 if (cont_expr == 0) {2999 if (cont_expr == 0) {
3000 return p.addNode(.{3000 return p.addNode(.{
3001 .tag = .WhileSimple,3001 .tag = .while_simple,
3002 .main_token = while_token,3002 .main_token = while_token,
3003 .data = .{3003 .data = .{
3004 .lhs = condition,3004 .lhs = condition,
...@@ -3007,7 +3007,7 @@ const Parser = struct {...@@ -3007,7 +3007,7 @@ const Parser = struct {
3007 });3007 });
3008 } else {3008 } else {
3009 return p.addNode(.{3009 return p.addNode(.{
3010 .tag = .WhileCont,3010 .tag = .while_cont,
3011 .main_token = while_token,3011 .main_token = while_token,
3012 .data = .{3012 .data = .{
3013 .lhs = condition,3013 .lhs = condition,
...@@ -3022,7 +3022,7 @@ const Parser = struct {...@@ -3022,7 +3022,7 @@ const Parser = struct {
3022 const else_payload = try p.parsePayload();3022 const else_payload = try p.parsePayload();
3023 const else_expr = try p.expectTypeExpr();3023 const else_expr = try p.expectTypeExpr();
3024 return p.addNode(.{3024 return p.addNode(.{
3025 .tag = .While,3025 .tag = .@"while",
3026 .main_token = while_token,3026 .main_token = while_token,
3027 .data = .{3027 .data = .{
3028 .lhs = condition,3028 .lhs = condition,
...@@ -3047,7 +3047,7 @@ const Parser = struct {...@@ -3047,7 +3047,7 @@ const Parser = struct {
3047 _ = try p.expectToken(.r_brace);3047 _ = try p.expectToken(.r_brace);
30483048
3049 return p.addNode(.{3049 return p.addNode(.{
3050 .tag = if (trailing_comma) .SwitchComma else .Switch,3050 .tag = if (trailing_comma) .switch_comma else .@"switch",
3051 .main_token = switch_token,3051 .main_token = switch_token,
3052 .data = .{3052 .data = .{
3053 .lhs = expr_node,3053 .lhs = expr_node,
...@@ -3074,7 +3074,7 @@ const Parser = struct {...@@ -3074,7 +3074,7 @@ const Parser = struct {
30743074
3075 if (p.eatToken(.r_paren)) |rparen| {3075 if (p.eatToken(.r_paren)) |rparen| {
3076 return p.addNode(.{3076 return p.addNode(.{
3077 .tag = .AsmSimple,3077 .tag = .asm_simple,
3078 .main_token = asm_token,3078 .main_token = asm_token,
3079 .data = .{3079 .data = .{
3080 .lhs = template,3080 .lhs = template,
...@@ -3140,7 +3140,7 @@ const Parser = struct {...@@ -3140,7 +3140,7 @@ const Parser = struct {
3140 const rparen = try p.expectToken(.r_paren);3140 const rparen = try p.expectToken(.r_paren);
3141 const span = try p.listToSpan(list.items);3141 const span = try p.listToSpan(list.items);
3142 return p.addNode(.{3142 return p.addNode(.{
3143 .tag = .Asm,3143 .tag = .@"asm",
3144 .main_token = asm_token,3144 .main_token = asm_token,
3145 .data = .{3145 .data = .{
3146 .lhs = template,3146 .lhs = template,
...@@ -3170,7 +3170,7 @@ const Parser = struct {...@@ -3170,7 +3170,7 @@ const Parser = struct {
3170 };3170 };
3171 const rparen = try p.expectToken(.r_paren);3171 const rparen = try p.expectToken(.r_paren);
3172 return p.addNode(.{3172 return p.addNode(.{
3173 .tag = .AsmOutput,3173 .tag = .asm_output,
3174 .main_token = identifier,3174 .main_token = identifier,
3175 .data = .{3175 .data = .{
3176 .lhs = type_expr,3176 .lhs = type_expr,
...@@ -3189,7 +3189,7 @@ const Parser = struct {...@@ -3189,7 +3189,7 @@ const Parser = struct {
3189 const expr = try p.expectExpr();3189 const expr = try p.expectExpr();
3190 const rparen = try p.expectToken(.r_paren);3190 const rparen = try p.expectToken(.r_paren);
3191 return p.addNode(.{3191 return p.addNode(.{
3192 .tag = .AsmInput,3192 .tag = .asm_input,
3193 .main_token = identifier,3193 .main_token = identifier,
3194 .data = .{3194 .data = .{
3195 .lhs = expr,3195 .lhs = expr,
...@@ -3336,7 +3336,7 @@ const Parser = struct {...@@ -3336,7 +3336,7 @@ const Parser = struct {
3336 const arrow_token = try p.expectToken(.equal_angle_bracket_right);3336 const arrow_token = try p.expectToken(.equal_angle_bracket_right);
3337 _ = try p.parsePtrPayload();3337 _ = try p.parsePtrPayload();
3338 return p.addNode(.{3338 return p.addNode(.{
3339 .tag = .SwitchCaseOne,3339 .tag = .switch_case_one,
3340 .main_token = arrow_token,3340 .main_token = arrow_token,
3341 .data = .{3341 .data = .{
3342 .lhs = 0,3342 .lhs = 0,
...@@ -3350,7 +3350,7 @@ const Parser = struct {...@@ -3350,7 +3350,7 @@ const Parser = struct {
3350 if (p.eatToken(.equal_angle_bracket_right)) |arrow_token| {3350 if (p.eatToken(.equal_angle_bracket_right)) |arrow_token| {
3351 _ = try p.parsePtrPayload();3351 _ = try p.parsePtrPayload();
3352 return p.addNode(.{3352 return p.addNode(.{
3353 .tag = .SwitchCaseOne,3353 .tag = .switch_case_one,
3354 .main_token = arrow_token,3354 .main_token = arrow_token,
3355 .data = .{3355 .data = .{
3356 .lhs = first_item,3356 .lhs = first_item,
...@@ -3372,7 +3372,7 @@ const Parser = struct {...@@ -3372,7 +3372,7 @@ const Parser = struct {
3372 const arrow_token = try p.expectToken(.equal_angle_bracket_right);3372 const arrow_token = try p.expectToken(.equal_angle_bracket_right);
3373 _ = try p.parsePtrPayload();3373 _ = try p.parsePtrPayload();
3374 return p.addNode(.{3374 return p.addNode(.{
3375 .tag = .SwitchCase,3375 .tag = .switch_case,
3376 .main_token = arrow_token,3376 .main_token = arrow_token,
3377 .data = .{3377 .data = .{
3378 .lhs = try p.addExtra(Node.SubRange{3378 .lhs = try p.addExtra(Node.SubRange{
...@@ -3391,7 +3391,7 @@ const Parser = struct {...@@ -3391,7 +3391,7 @@ const Parser = struct {
33913391
3392 if (p.eatToken(.ellipsis3)) |token| {3392 if (p.eatToken(.ellipsis3)) |token| {
3393 return p.addNode(.{3393 return p.addNode(.{
3394 .tag = .SwitchRange,3394 .tag = .switch_range,
3395 .main_token = token,3395 .main_token = token,
3396 .data = .{3396 .data = .{
3397 .lhs = expr,3397 .lhs = expr,
...@@ -3485,7 +3485,7 @@ const Parser = struct {...@@ -3485,7 +3485,7 @@ const Parser = struct {
3485 if (end_expr == 0) {3485 if (end_expr == 0) {
3486 _ = try p.expectToken(.r_bracket);3486 _ = try p.expectToken(.r_bracket);
3487 return p.addNode(.{3487 return p.addNode(.{
3488 .tag = .SliceOpen,3488 .tag = .slice_open,
3489 .main_token = lbracket,3489 .main_token = lbracket,
3490 .data = .{3490 .data = .{
3491 .lhs = lhs,3491 .lhs = lhs,
...@@ -3497,7 +3497,7 @@ const Parser = struct {...@@ -3497,7 +3497,7 @@ const Parser = struct {
3497 const sentinel = try p.parseExpr();3497 const sentinel = try p.parseExpr();
3498 _ = try p.expectToken(.r_bracket);3498 _ = try p.expectToken(.r_bracket);
3499 return p.addNode(.{3499 return p.addNode(.{
3500 .tag = .SliceSentinel,3500 .tag = .slice_sentinel,
3501 .main_token = lbracket,3501 .main_token = lbracket,
3502 .data = .{3502 .data = .{
3503 .lhs = lhs,3503 .lhs = lhs,
...@@ -3511,7 +3511,7 @@ const Parser = struct {...@@ -3511,7 +3511,7 @@ const Parser = struct {
3511 } else {3511 } else {
3512 _ = try p.expectToken(.r_bracket);3512 _ = try p.expectToken(.r_bracket);
3513 return p.addNode(.{3513 return p.addNode(.{
3514 .tag = .Slice,3514 .tag = .slice,
3515 .main_token = lbracket,3515 .main_token = lbracket,
3516 .data = .{3516 .data = .{
3517 .lhs = lhs,3517 .lhs = lhs,
...@@ -3525,7 +3525,7 @@ const Parser = struct {...@@ -3525,7 +3525,7 @@ const Parser = struct {
3525 }3525 }
3526 _ = try p.expectToken(.r_bracket);3526 _ = try p.expectToken(.r_bracket);
3527 return p.addNode(.{3527 return p.addNode(.{
3528 .tag = .ArrayAccess,3528 .tag = .array_access,
3529 .main_token = lbracket,3529 .main_token = lbracket,
3530 .data = .{3530 .data = .{
3531 .lhs = lhs,3531 .lhs = lhs,
...@@ -3534,7 +3534,7 @@ const Parser = struct {...@@ -3534,7 +3534,7 @@ const Parser = struct {
3534 });3534 });
3535 },3535 },
3536 .period_asterisk => return p.addNode(.{3536 .period_asterisk => return p.addNode(.{
3537 .tag = .Deref,3537 .tag = .deref,
3538 .main_token = p.nextToken(),3538 .main_token = p.nextToken(),
3539 .data = .{3539 .data = .{
3540 .lhs = lhs,3540 .lhs = lhs,
...@@ -3545,7 +3545,7 @@ const Parser = struct {...@@ -3545,7 +3545,7 @@ const Parser = struct {
3545 const period_asterisk = p.nextToken();3545 const period_asterisk = p.nextToken();
3546 try p.warn(.{ .AsteriskAfterPointerDereference = .{ .token = period_asterisk } });3546 try p.warn(.{ .AsteriskAfterPointerDereference = .{ .token = period_asterisk } });
3547 return p.addNode(.{3547 return p.addNode(.{
3548 .tag = .Deref,3548 .tag = .deref,
3549 .main_token = period_asterisk,3549 .main_token = period_asterisk,
3550 .data = .{3550 .data = .{
3551 .lhs = lhs,3551 .lhs = lhs,
...@@ -3555,7 +3555,7 @@ const Parser = struct {...@@ -3555,7 +3555,7 @@ const Parser = struct {
3555 },3555 },
3556 .period => switch (p.token_tags[p.tok_i + 1]) {3556 .period => switch (p.token_tags[p.tok_i + 1]) {
3557 .identifier => return p.addNode(.{3557 .identifier => return p.addNode(.{
3558 .tag = .FieldAccess,3558 .tag = .field_access,
3559 .main_token = p.nextToken(),3559 .main_token = p.nextToken(),
3560 .data = .{3560 .data = .{
3561 .lhs = lhs,3561 .lhs = lhs,
...@@ -3563,7 +3563,7 @@ const Parser = struct {...@@ -3563,7 +3563,7 @@ const Parser = struct {
3563 },3563 },
3564 }),3564 }),
3565 .question_mark => return p.addNode(.{3565 .question_mark => return p.addNode(.{
3566 .tag = .UnwrapOptional,3566 .tag = .unwrap_optional,
3567 .main_token = p.nextToken(),3567 .main_token = p.nextToken(),
3568 .data = .{3568 .data = .{
3569 .lhs = lhs,3569 .lhs = lhs,
...@@ -3613,8 +3613,8 @@ const Parser = struct {...@@ -3613,8 +3613,8 @@ const Parser = struct {
3613 _ = try p.expectToken(.r_brace);3613 _ = try p.expectToken(.r_brace);
3614 return p.addNode(.{3614 return p.addNode(.{
3615 .tag = switch (members.trailing_comma) {3615 .tag = switch (members.trailing_comma) {
3616 true => .TaggedUnionEnumTagComma,3616 true => .tagged_union_enum_tag_comma,
3617 false => .TaggedUnionEnumTag,3617 false => .tagged_union_enum_tag,
3618 },3618 },
3619 .main_token = main_token,3619 .main_token = main_token,
3620 .data = .{3620 .data = .{
...@@ -3631,8 +3631,8 @@ const Parser = struct {...@@ -3631,8 +3631,8 @@ const Parser = struct {
3631 if (members.len <= 2) {3631 if (members.len <= 2) {
3632 return p.addNode(.{3632 return p.addNode(.{
3633 .tag = switch (members.trailing_comma) {3633 .tag = switch (members.trailing_comma) {
3634 true => .TaggedUnionTwoComma,3634 true => .tagged_union_two_comma,
3635 false => .TaggedUnionTwo,3635 false => .tagged_union_two,
3636 },3636 },
3637 .main_token = main_token,3637 .main_token = main_token,
3638 .data = .{3638 .data = .{
...@@ -3644,8 +3644,8 @@ const Parser = struct {...@@ -3644,8 +3644,8 @@ const Parser = struct {
3644 const span = try members.toSpan(p);3644 const span = try members.toSpan(p);
3645 return p.addNode(.{3645 return p.addNode(.{
3646 .tag = switch (members.trailing_comma) {3646 .tag = switch (members.trailing_comma) {
3647 true => .TaggedUnionComma,3647 true => .tagged_union_comma,
3648 false => .TaggedUnion,3648 false => .tagged_union,
3649 },3649 },
3650 .main_token = main_token,3650 .main_token = main_token,
3651 .data = .{3651 .data = .{
...@@ -3673,8 +3673,8 @@ const Parser = struct {...@@ -3673,8 +3673,8 @@ const Parser = struct {
3673 if (members.len <= 2) {3673 if (members.len <= 2) {
3674 return p.addNode(.{3674 return p.addNode(.{
3675 .tag = switch (members.trailing_comma) {3675 .tag = switch (members.trailing_comma) {
3676 true => .ContainerDeclTwoComma,3676 true => .container_decl_two_comma,
3677 false => .ContainerDeclTwo,3677 false => .container_decl_two,
3678 },3678 },
3679 .main_token = main_token,3679 .main_token = main_token,
3680 .data = .{3680 .data = .{
...@@ -3686,8 +3686,8 @@ const Parser = struct {...@@ -3686,8 +3686,8 @@ const Parser = struct {
3686 const span = try members.toSpan(p);3686 const span = try members.toSpan(p);
3687 return p.addNode(.{3687 return p.addNode(.{
3688 .tag = switch (members.trailing_comma) {3688 .tag = switch (members.trailing_comma) {
3689 true => .ContainerDeclComma,3689 true => .container_decl_comma,
3690 false => .ContainerDecl,3690 false => .container_decl,
3691 },3691 },
3692 .main_token = main_token,3692 .main_token = main_token,
3693 .data = .{3693 .data = .{
...@@ -3700,8 +3700,8 @@ const Parser = struct {...@@ -3700,8 +3700,8 @@ const Parser = struct {
3700 const span = try members.toSpan(p);3700 const span = try members.toSpan(p);
3701 return p.addNode(.{3701 return p.addNode(.{
3702 .tag = switch (members.trailing_comma) {3702 .tag = switch (members.trailing_comma) {
3703 true => .ContainerDeclArgComma,3703 true => .container_decl_arg_comma,
3704 false => .ContainerDeclArg,3704 false => .container_decl_arg,
3705 },3705 },
3706 .main_token = main_token,3706 .main_token = main_token,
3707 .data = .{3707 .data = .{
...@@ -3860,7 +3860,7 @@ const Parser = struct {...@@ -3860,7 +3860,7 @@ const Parser = struct {
3860 });3860 });
3861 // Pretend this was an identifier so we can continue parsing.3861 // Pretend this was an identifier so we can continue parsing.
3862 return p.addNode(.{3862 return p.addNode(.{
3863 .tag = .Identifier,3863 .tag = .identifier,
3864 .main_token = builtin_token,3864 .main_token = builtin_token,
3865 .data = .{3865 .data = .{
3866 .lhs = undefined,3866 .lhs = undefined,
...@@ -3870,7 +3870,7 @@ const Parser = struct {...@@ -3870,7 +3870,7 @@ const Parser = struct {
3870 };3870 };
3871 if (p.eatToken(.r_paren)) |_| {3871 if (p.eatToken(.r_paren)) |_| {
3872 return p.addNode(.{3872 return p.addNode(.{
3873 .tag = .BuiltinCallTwo,3873 .tag = .builtin_call_two,
3874 .main_token = builtin_token,3874 .main_token = builtin_token,
3875 .data = .{3875 .data = .{
3876 .lhs = 0,3876 .lhs = 0,
...@@ -3883,7 +3883,7 @@ const Parser = struct {...@@ -3883,7 +3883,7 @@ const Parser = struct {
3883 .comma => {3883 .comma => {
3884 if (p.eatToken(.r_paren)) |_| {3884 if (p.eatToken(.r_paren)) |_| {
3885 return p.addNode(.{3885 return p.addNode(.{
3886 .tag = .BuiltinCallTwoComma,3886 .tag = .builtin_call_two_comma,
3887 .main_token = builtin_token,3887 .main_token = builtin_token,
3888 .data = .{3888 .data = .{
3889 .lhs = param_one,3889 .lhs = param_one,
...@@ -3893,7 +3893,7 @@ const Parser = struct {...@@ -3893,7 +3893,7 @@ const Parser = struct {
3893 }3893 }
3894 },3894 },
3895 .r_paren => return p.addNode(.{3895 .r_paren => return p.addNode(.{
3896 .tag = .BuiltinCallTwo,3896 .tag = .builtin_call_two,
3897 .main_token = builtin_token,3897 .main_token = builtin_token,
3898 .data = .{3898 .data = .{
3899 .lhs = param_one,3899 .lhs = param_one,
...@@ -3914,7 +3914,7 @@ const Parser = struct {...@@ -3914,7 +3914,7 @@ const Parser = struct {
3914 .comma => {3914 .comma => {
3915 if (p.eatToken(.r_paren)) |_| {3915 if (p.eatToken(.r_paren)) |_| {
3916 return p.addNode(.{3916 return p.addNode(.{
3917 .tag = .BuiltinCallTwoComma,3917 .tag = .builtin_call_two_comma,
3918 .main_token = builtin_token,3918 .main_token = builtin_token,
3919 .data = .{3919 .data = .{
3920 .lhs = param_one,3920 .lhs = param_one,
...@@ -3924,7 +3924,7 @@ const Parser = struct {...@@ -3924,7 +3924,7 @@ const Parser = struct {
3924 }3924 }
3925 },3925 },
3926 .r_paren => return p.addNode(.{3926 .r_paren => return p.addNode(.{
3927 .tag = .BuiltinCallTwo,3927 .tag = .builtin_call_two,
3928 .main_token = builtin_token,3928 .main_token = builtin_token,
3929 .data = .{3929 .data = .{
3930 .lhs = param_one,3930 .lhs = param_one,
...@@ -3954,7 +3954,7 @@ const Parser = struct {...@@ -3954,7 +3954,7 @@ const Parser = struct {
3954 if (p.eatToken(.r_paren)) |_| {3954 if (p.eatToken(.r_paren)) |_| {
3955 const params = try p.listToSpan(list.items);3955 const params = try p.listToSpan(list.items);
3956 return p.addNode(.{3956 return p.addNode(.{
3957 .tag = .BuiltinCallComma,3957 .tag = .builtin_call_comma,
3958 .main_token = builtin_token,3958 .main_token = builtin_token,
3959 .data = .{3959 .data = .{
3960 .lhs = params.start,3960 .lhs = params.start,
...@@ -3967,7 +3967,7 @@ const Parser = struct {...@@ -3967,7 +3967,7 @@ const Parser = struct {
3967 .r_paren => {3967 .r_paren => {
3968 const params = try p.listToSpan(list.items);3968 const params = try p.listToSpan(list.items);
3969 return p.addNode(.{3969 return p.addNode(.{
3970 .tag = .BuiltinCall,3970 .tag = .builtin_call,
3971 .main_token = builtin_token,3971 .main_token = builtin_token,
3972 .data = .{3972 .data = .{
3973 .lhs = params.start,3973 .lhs = params.start,
...@@ -3993,7 +3993,7 @@ const Parser = struct {...@@ -3993,7 +3993,7 @@ const Parser = struct {
3993 .string_literal => {3993 .string_literal => {
3994 const main_token = p.nextToken();3994 const main_token = p.nextToken();
3995 return p.addNode(.{3995 return p.addNode(.{
3996 .tag = .StringLiteral,3996 .tag = .string_literal,
3997 .main_token = main_token,3997 .main_token = main_token,
3998 .data = .{3998 .data = .{
3999 .lhs = main_token,3999 .lhs = main_token,
...@@ -4007,7 +4007,7 @@ const Parser = struct {...@@ -4007,7 +4007,7 @@ const Parser = struct {
4007 p.tok_i += 1;4007 p.tok_i += 1;
4008 }4008 }
4009 return p.addNode(.{4009 return p.addNode(.{
4010 .tag = .StringLiteral,4010 .tag = .string_literal,
4011 .main_token = first_line,4011 .main_token = first_line,
4012 .data = .{4012 .data = .{
4013 .lhs = first_line,4013 .lhs = first_line,
...@@ -4029,7 +4029,7 @@ const Parser = struct {...@@ -4029,7 +4029,7 @@ const Parser = struct {
40294029
4030 fn expectIntegerLiteral(p: *Parser) !Node.Index {4030 fn expectIntegerLiteral(p: *Parser) !Node.Index {
4031 return p.addNode(.{4031 return p.addNode(.{
4032 .tag = .IntegerLiteral,4032 .tag = .integer_literal,
4033 .main_token = try p.expectToken(.integer_literal),4033 .main_token = try p.expectToken(.integer_literal),
4034 .data = .{4034 .data = .{
4035 .lhs = undefined,4035 .lhs = undefined,
...@@ -4050,7 +4050,7 @@ const Parser = struct {...@@ -4050,7 +4050,7 @@ const Parser = struct {
4050 if (then_expr == 0) return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });4050 if (then_expr == 0) return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });
40514051
4052 const else_token = p.eatToken(.keyword_else) orelse return p.addNode(.{4052 const else_token = p.eatToken(.keyword_else) orelse return p.addNode(.{
4053 .tag = .IfSimple,4053 .tag = .if_simple,
4054 .main_token = if_token,4054 .main_token = if_token,
4055 .data = .{4055 .data = .{
4056 .lhs = condition,4056 .lhs = condition,
...@@ -4062,7 +4062,7 @@ const Parser = struct {...@@ -4062,7 +4062,7 @@ const Parser = struct {
4062 if (else_expr == 0) return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });4062 if (else_expr == 0) return p.fail(.{ .InvalidToken = .{ .token = p.tok_i } });
40634063
4064 return p.addNode(.{4064 return p.addNode(.{
4065 .tag = .If,4065 .tag = .@"if",
4066 .main_token = if_token,4066 .main_token = if_token,
4067 .data = .{4067 .data = .{
4068 .lhs = condition,4068 .lhs = condition,
lib/std/zig/render.zig+228-228
...@@ -96,7 +96,7 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E...@@ -96,7 +96,7 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E
96 const datas = tree.nodes.items(.data);96 const datas = tree.nodes.items(.data);
97 try renderDocComments(ais, tree, tree.firstToken(decl));97 try renderDocComments(ais, tree, tree.firstToken(decl));
98 switch (tree.nodes.items(.tag)[decl]) {98 switch (tree.nodes.items(.tag)[decl]) {
99 .FnDecl => {99 .fn_decl => {
100 // Some examples:100 // Some examples:
101 // pub extern "foo" fn ...101 // pub extern "foo" fn ...
102 // export fn ...102 // export fn ...
...@@ -132,16 +132,16 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E...@@ -132,16 +132,16 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E
132 return renderToken(ais, tree, tree.lastToken(fn_proto) + 1, space); // semicolon132 return renderToken(ais, tree, tree.lastToken(fn_proto) + 1, space); // semicolon
133 }133 }
134 },134 },
135 .FnProtoSimple,135 .fn_proto_simple,
136 .FnProtoMulti,136 .fn_proto_multi,
137 .FnProtoOne,137 .fn_proto_one,
138 .FnProto,138 .fn_proto,
139 => {139 => {
140 try renderExpression(ais, tree, decl, .None);140 try renderExpression(ais, tree, decl, .None);
141 return renderToken(ais, tree, tree.lastToken(decl) + 1, space); // semicolon141 return renderToken(ais, tree, tree.lastToken(decl) + 1, space); // semicolon
142 },142 },
143143
144 .UsingNamespace => {144 .@"usingnamespace" => {
145 const main_token = main_tokens[decl];145 const main_token = main_tokens[decl];
146 const expr = datas[decl].lhs;146 const expr = datas[decl].lhs;
147 if (main_token > 0 and token_tags[main_token - 1] == .keyword_pub) {147 if (main_token > 0 and token_tags[main_token - 1] == .keyword_pub) {
...@@ -152,12 +152,12 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E...@@ -152,12 +152,12 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E
152 return renderToken(ais, tree, tree.lastToken(expr) + 1, space); // ;152 return renderToken(ais, tree, tree.lastToken(expr) + 1, space); // ;
153 },153 },
154154
155 .GlobalVarDecl => return renderVarDecl(ais, tree, tree.globalVarDecl(decl)),155 .global_var_decl => return renderVarDecl(ais, tree, tree.globalVarDecl(decl)),
156 .LocalVarDecl => return renderVarDecl(ais, tree, tree.localVarDecl(decl)),156 .local_var_decl => return renderVarDecl(ais, tree, tree.localVarDecl(decl)),
157 .SimpleVarDecl => return renderVarDecl(ais, tree, tree.simpleVarDecl(decl)),157 .simple_var_decl => return renderVarDecl(ais, tree, tree.simpleVarDecl(decl)),
158 .AlignedVarDecl => return renderVarDecl(ais, tree, tree.alignedVarDecl(decl)),158 .aligned_var_decl => return renderVarDecl(ais, tree, tree.alignedVarDecl(decl)),
159159
160 .TestDecl => {160 .test_decl => {
161 const test_token = main_tokens[decl];161 const test_token = main_tokens[decl];
162 try renderToken(ais, tree, test_token, .Space);162 try renderToken(ais, tree, test_token, .Space);
163 if (token_tags[test_token + 1] == .string_literal) {163 if (token_tags[test_token + 1] == .string_literal) {
...@@ -166,12 +166,12 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E...@@ -166,12 +166,12 @@ fn renderMember(ais: *Ais, tree: ast.Tree, decl: ast.Node.Index, space: Space) E
166 try renderExpression(ais, tree, datas[decl].rhs, space);166 try renderExpression(ais, tree, datas[decl].rhs, space);
167 },167 },
168168
169 .ContainerFieldInit => return renderContainerField(ais, tree, tree.containerFieldInit(decl), space),169 .container_field_init => return renderContainerField(ais, tree, tree.containerFieldInit(decl), space),
170 .ContainerFieldAlign => return renderContainerField(ais, tree, tree.containerFieldAlign(decl), space),170 .container_field_align => return renderContainerField(ais, tree, tree.containerFieldAlign(decl), space),
171 .ContainerField => return renderContainerField(ais, tree, tree.containerField(decl), space),171 .container_field => return renderContainerField(ais, tree, tree.containerField(decl), space),
172 .Comptime => return renderExpression(ais, tree, decl, space),172 .@"comptime" => return renderExpression(ais, tree, decl, space),
173173
174 .Root => unreachable,174 .root => unreachable,
175 else => unreachable,175 else => unreachable,
176 }176 }
177}177}
...@@ -182,29 +182,29 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -182,29 +182,29 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
182 const node_tags = tree.nodes.items(.tag);182 const node_tags = tree.nodes.items(.tag);
183 const datas = tree.nodes.items(.data);183 const datas = tree.nodes.items(.data);
184 switch (node_tags[node]) {184 switch (node_tags[node]) {
185 .Identifier,185 .identifier,
186 .IntegerLiteral,186 .integer_literal,
187 .FloatLiteral,187 .float_literal,
188 .StringLiteral,188 .string_literal,
189 .CharLiteral,189 .char_literal,
190 .TrueLiteral,190 .true_literal,
191 .FalseLiteral,191 .false_literal,
192 .NullLiteral,192 .null_literal,
193 .UnreachableLiteral,193 .unreachable_literal,
194 .UndefinedLiteral,194 .undefined_literal,
195 .AnyFrameLiteral,195 .anyframe_literal,
196 => return renderToken(ais, tree, main_tokens[node], space),196 => return renderToken(ais, tree, main_tokens[node], space),
197197
198 .ErrorValue => {198 .error_value => {
199 try renderToken(ais, tree, main_tokens[node], .None);199 try renderToken(ais, tree, main_tokens[node], .None);
200 try renderToken(ais, tree, main_tokens[node] + 1, .None);200 try renderToken(ais, tree, main_tokens[node] + 1, .None);
201 return renderToken(ais, tree, main_tokens[node] + 2, space);201 return renderToken(ais, tree, main_tokens[node] + 2, space);
202 },202 },
203203
204 .AnyType => return renderToken(ais, tree, main_tokens[node], space),204 .@"anytype" => return renderToken(ais, tree, main_tokens[node], space),
205205
206 .BlockTwo,206 .block_two,
207 .BlockTwoSemicolon,207 .block_two_semicolon,
208 => {208 => {
209 const statements = [2]ast.Node.Index{ datas[node].lhs, datas[node].rhs };209 const statements = [2]ast.Node.Index{ datas[node].lhs, datas[node].rhs };
210 if (datas[node].lhs == 0) {210 if (datas[node].lhs == 0) {
...@@ -215,14 +215,14 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -215,14 +215,14 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
215 return renderBlock(ais, tree, node, statements[0..2], space);215 return renderBlock(ais, tree, node, statements[0..2], space);
216 }216 }
217 },217 },
218 .Block,218 .block,
219 .BlockSemicolon,219 .block_semicolon,
220 => {220 => {
221 const statements = tree.extra_data[datas[node].lhs..datas[node].rhs];221 const statements = tree.extra_data[datas[node].lhs..datas[node].rhs];
222 return renderBlock(ais, tree, node, statements, space);222 return renderBlock(ais, tree, node, statements, space);
223 },223 },
224224
225 .ErrDefer => {225 .@"errdefer" => {
226 const defer_token = main_tokens[node];226 const defer_token = main_tokens[node];
227 const payload_token = datas[node].lhs;227 const payload_token = datas[node].lhs;
228 const expr = datas[node].rhs;228 const expr = datas[node].rhs;
...@@ -236,20 +236,20 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -236,20 +236,20 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
236 return renderExpression(ais, tree, expr, space);236 return renderExpression(ais, tree, expr, space);
237 },237 },
238238
239 .Defer => {239 .@"defer" => {
240 const defer_token = main_tokens[node];240 const defer_token = main_tokens[node];
241 const expr = datas[node].rhs;241 const expr = datas[node].rhs;
242 try renderToken(ais, tree, defer_token, .Space);242 try renderToken(ais, tree, defer_token, .Space);
243 return renderExpression(ais, tree, expr, space);243 return renderExpression(ais, tree, expr, space);
244 },244 },
245 .Comptime, .Nosuspend => {245 .@"comptime", .@"nosuspend" => {
246 const comptime_token = main_tokens[node];246 const comptime_token = main_tokens[node];
247 const block = datas[node].lhs;247 const block = datas[node].lhs;
248 try renderToken(ais, tree, comptime_token, .Space);248 try renderToken(ais, tree, comptime_token, .Space);
249 return renderExpression(ais, tree, block, space);249 return renderExpression(ais, tree, block, space);
250 },250 },
251251
252 .Suspend => {252 .@"suspend" => {
253 const suspend_token = main_tokens[node];253 const suspend_token = main_tokens[node];
254 const body = datas[node].lhs;254 const body = datas[node].lhs;
255 if (body != 0) {255 if (body != 0) {
...@@ -260,7 +260,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -260,7 +260,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
260 }260 }
261 },261 },
262262
263 .Catch => {263 .@"catch" => {
264 const main_token = main_tokens[node];264 const main_token = main_tokens[node];
265 const fallback_first = tree.firstToken(datas[node].rhs);265 const fallback_first = tree.firstToken(datas[node].rhs);
266266
...@@ -283,15 +283,15 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -283,15 +283,15 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
283 try renderExpression(ais, tree, datas[node].rhs, space); // fallback283 try renderExpression(ais, tree, datas[node].rhs, space); // fallback
284 },284 },
285285
286 .FieldAccess => {286 .field_access => {
287 const field_access = datas[node];287 const field_access = datas[node];
288 try renderExpression(ais, tree, field_access.lhs, .None);288 try renderExpression(ais, tree, field_access.lhs, .None);
289 try renderToken(ais, tree, main_tokens[node], .None);289 try renderToken(ais, tree, main_tokens[node], .None);
290 return renderToken(ais, tree, field_access.rhs, space);290 return renderToken(ais, tree, field_access.rhs, space);
291 },291 },
292292
293 .ErrorUnion,293 .error_union,
294 .SwitchRange,294 .switch_range,
295 => {295 => {
296 const infix = datas[node];296 const infix = datas[node];
297 try renderExpression(ais, tree, infix.lhs, .None);297 try renderExpression(ais, tree, infix.lhs, .None);
...@@ -299,45 +299,45 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -299,45 +299,45 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
299 return renderExpression(ais, tree, infix.rhs, space);299 return renderExpression(ais, tree, infix.rhs, space);
300 },300 },
301301
302 .Add,302 .add,
303 .AddWrap,303 .add_wrap,
304 .ArrayCat,304 .array_cat,
305 .ArrayMult,305 .array_mult,
306 .Assign,306 .assign,
307 .AssignBitAnd,307 .assign_bit_and,
308 .AssignBitOr,308 .assign_bit_or,
309 .AssignBitShiftLeft,309 .assign_bit_shift_left,
310 .AssignBitShiftRight,310 .assign_bit_shift_right,
311 .AssignBitXor,311 .assign_bit_xor,
312 .AssignDiv,312 .assign_div,
313 .AssignSub,313 .assign_sub,
314 .AssignSubWrap,314 .assign_sub_wrap,
315 .AssignMod,315 .assign_mod,
316 .AssignAdd,316 .assign_add,
317 .AssignAddWrap,317 .assign_add_wrap,
318 .AssignMul,318 .assign_mul,
319 .AssignMulWrap,319 .assign_mul_wrap,
320 .BangEqual,320 .bang_equal,
321 .BitAnd,321 .bit_and,
322 .BitOr,322 .bit_or,
323 .BitShiftLeft,323 .bit_shift_left,
324 .BitShiftRight,324 .bit_shift_right,
325 .BitXor,325 .bit_xor,
326 .BoolAnd,326 .bool_and,
327 .BoolOr,327 .bool_or,
328 .Div,328 .div,
329 .EqualEqual,329 .equal_equal,
330 .GreaterOrEqual,330 .greater_or_equal,
331 .GreaterThan,331 .greater_than,
332 .LessOrEqual,332 .less_or_equal,
333 .LessThan,333 .less_than,
334 .MergeErrorSets,334 .merge_error_sets,
335 .Mod,335 .mod,
336 .Mul,336 .mul,
337 .MulWrap,337 .mul_wrap,
338 .Sub,338 .sub,
339 .SubWrap,339 .sub_wrap,
340 .OrElse,340 .@"orelse",
341 => {341 => {
342 const infix = datas[node];342 const infix = datas[node];
343 try renderExpression(ais, tree, infix.lhs, .Space);343 try renderExpression(ais, tree, infix.lhs, .Space);
...@@ -353,75 +353,75 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -353,75 +353,75 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
353 return renderExpression(ais, tree, infix.rhs, space);353 return renderExpression(ais, tree, infix.rhs, space);
354 },354 },
355355
356 .BitNot,356 .bit_not,
357 .BoolNot,357 .bool_not,
358 .Negation,358 .negation,
359 .NegationWrap,359 .negation_wrap,
360 .OptionalType,360 .optional_type,
361 .AddressOf,361 .address_of,
362 => {362 => {
363 try renderToken(ais, tree, main_tokens[node], .None);363 try renderToken(ais, tree, main_tokens[node], .None);
364 return renderExpression(ais, tree, datas[node].lhs, space);364 return renderExpression(ais, tree, datas[node].lhs, space);
365 },365 },
366366
367 .Try,367 .@"try",
368 .Resume,368 .@"resume",
369 .Await,369 .@"await",
370 => {370 => {
371 try renderToken(ais, tree, main_tokens[node], .Space);371 try renderToken(ais, tree, main_tokens[node], .Space);
372 return renderExpression(ais, tree, datas[node].lhs, space);372 return renderExpression(ais, tree, datas[node].lhs, space);
373 },373 },
374374
375 .ArrayType => return renderArrayType(ais, tree, tree.arrayType(node), space),375 .array_type => return renderArrayType(ais, tree, tree.arrayType(node), space),
376 .ArrayTypeSentinel => return renderArrayType(ais, tree, tree.arrayTypeSentinel(node), space),376 .array_type_sentinel => return renderArrayType(ais, tree, tree.arrayTypeSentinel(node), space),
377377
378 .PtrTypeAligned => return renderPtrType(ais, tree, tree.ptrTypeAligned(node), space),378 .ptr_type_aligned => return renderPtrType(ais, tree, tree.ptrTypeAligned(node), space),
379 .PtrTypeSentinel => return renderPtrType(ais, tree, tree.ptrTypeSentinel(node), space),379 .ptr_type_sentinel => return renderPtrType(ais, tree, tree.ptrTypeSentinel(node), space),
380 .PtrType => return renderPtrType(ais, tree, tree.ptrType(node), space),380 .ptr_type => return renderPtrType(ais, tree, tree.ptrType(node), space),
381 .PtrTypeBitRange => return renderPtrType(ais, tree, tree.ptrTypeBitRange(node), space),381 .ptr_type_bit_range => return renderPtrType(ais, tree, tree.ptrTypeBitRange(node), space),
382382
383 .ArrayInitOne, .ArrayInitOneComma => {383 .array_init_one, .array_init_one_comma => {
384 var elements: [1]ast.Node.Index = undefined;384 var elements: [1]ast.Node.Index = undefined;
385 return renderArrayInit(ais, tree, tree.arrayInitOne(&elements, node), space);385 return renderArrayInit(ais, tree, tree.arrayInitOne(&elements, node), space);
386 },386 },
387 .ArrayInitDotTwo, .ArrayInitDotTwoComma => {387 .array_init_dot_two, .array_init_dot_two_comma => {
388 var elements: [2]ast.Node.Index = undefined;388 var elements: [2]ast.Node.Index = undefined;
389 return renderArrayInit(ais, tree, tree.arrayInitDotTwo(&elements, node), space);389 return renderArrayInit(ais, tree, tree.arrayInitDotTwo(&elements, node), space);
390 },390 },
391 .ArrayInitDot,391 .array_init_dot,
392 .ArrayInitDotComma,392 .array_init_dot_comma,
393 => return renderArrayInit(ais, tree, tree.arrayInitDot(node), space),393 => return renderArrayInit(ais, tree, tree.arrayInitDot(node), space),
394 .ArrayInit,394 .array_init,
395 .ArrayInitComma,395 .array_init_comma,
396 => return renderArrayInit(ais, tree, tree.arrayInit(node), space),396 => return renderArrayInit(ais, tree, tree.arrayInit(node), space),
397397
398 .StructInitOne, .StructInitOneComma => {398 .struct_init_one, .struct_init_one_comma => {
399 var fields: [1]ast.Node.Index = undefined;399 var fields: [1]ast.Node.Index = undefined;
400 return renderStructInit(ais, tree, tree.structInitOne(&fields, node), space);400 return renderStructInit(ais, tree, tree.structInitOne(&fields, node), space);
401 },401 },
402 .StructInitDotTwo, .StructInitDotTwoComma => {402 .struct_init_dot_two, .struct_init_dot_two_comma => {
403 var fields: [2]ast.Node.Index = undefined;403 var fields: [2]ast.Node.Index = undefined;
404 return renderStructInit(ais, tree, tree.structInitDotTwo(&fields, node), space);404 return renderStructInit(ais, tree, tree.structInitDotTwo(&fields, node), space);
405 },405 },
406 .StructInitDot,406 .struct_init_dot,
407 .StructInitDotComma,407 .struct_init_dot_comma,
408 => return renderStructInit(ais, tree, tree.structInitDot(node), space),408 => return renderStructInit(ais, tree, tree.structInitDot(node), space),
409 .StructInit,409 .struct_init,
410 .StructInitComma,410 .struct_init_comma,
411 => return renderStructInit(ais, tree, tree.structInit(node), space),411 => return renderStructInit(ais, tree, tree.structInit(node), space),
412412
413 .CallOne, .CallOneComma, .AsyncCallOne, .AsyncCallOneComma => {413 .call_one, .call_one_comma, .async_call_one, .async_call_one_comma => {
414 var params: [1]ast.Node.Index = undefined;414 var params: [1]ast.Node.Index = undefined;
415 return renderCall(ais, tree, tree.callOne(&params, node), space);415 return renderCall(ais, tree, tree.callOne(&params, node), space);
416 },416 },
417417
418 .Call,418 .call,
419 .CallComma,419 .call_comma,
420 .AsyncCall,420 .async_call,
421 .AsyncCallComma,421 .async_call_comma,
422 => return renderCall(ais, tree, tree.callFull(node), space),422 => return renderCall(ais, tree, tree.callFull(node), space),
423423
424 .ArrayAccess => {424 .array_access => {
425 const suffix = datas[node];425 const suffix = datas[node];
426 const lbracket = tree.firstToken(suffix.rhs) - 1;426 const lbracket = tree.firstToken(suffix.rhs) - 1;
427 const rbracket = tree.lastToken(suffix.rhs) + 1;427 const rbracket = tree.lastToken(suffix.rhs) + 1;
...@@ -431,22 +431,22 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -431,22 +431,22 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
431 return renderToken(ais, tree, rbracket, space); // ]431 return renderToken(ais, tree, rbracket, space); // ]
432 },432 },
433433
434 .SliceOpen => try renderSlice(ais, tree, tree.sliceOpen(node), space),434 .slice_open => try renderSlice(ais, tree, tree.sliceOpen(node), space),
435 .Slice => try renderSlice(ais, tree, tree.slice(node), space),435 .slice => try renderSlice(ais, tree, tree.slice(node), space),
436 .SliceSentinel => try renderSlice(ais, tree, tree.sliceSentinel(node), space),436 .slice_sentinel => try renderSlice(ais, tree, tree.sliceSentinel(node), space),
437437
438 .Deref => {438 .deref => {
439 try renderExpression(ais, tree, datas[node].lhs, .None);439 try renderExpression(ais, tree, datas[node].lhs, .None);
440 return renderToken(ais, tree, main_tokens[node], space);440 return renderToken(ais, tree, main_tokens[node], space);
441 },441 },
442442
443 .UnwrapOptional => {443 .unwrap_optional => {
444 try renderExpression(ais, tree, datas[node].lhs, .None);444 try renderExpression(ais, tree, datas[node].lhs, .None);
445 try renderToken(ais, tree, main_tokens[node], .None);445 try renderToken(ais, tree, main_tokens[node], .None);
446 return renderToken(ais, tree, datas[node].rhs, space);446 return renderToken(ais, tree, datas[node].rhs, space);
447 },447 },
448448
449 .Break => {449 .@"break" => {
450 const main_token = main_tokens[node];450 const main_token = main_tokens[node];
451 const label_token = datas[node].lhs;451 const label_token = datas[node].lhs;
452 const target = datas[node].rhs;452 const target = datas[node].rhs;
...@@ -467,7 +467,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -467,7 +467,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
467 }467 }
468 },468 },
469469
470 .Continue => {470 .@"continue" => {
471 const main_token = main_tokens[node];471 const main_token = main_tokens[node];
472 const label = datas[node].lhs;472 const label = datas[node].lhs;
473 if (label != 0) {473 if (label != 0) {
...@@ -479,7 +479,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -479,7 +479,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
479 }479 }
480 },480 },
481481
482 .Return => {482 .@"return" => {
483 if (datas[node].lhs != 0) {483 if (datas[node].lhs != 0) {
484 try renderToken(ais, tree, main_tokens[node], .Space);484 try renderToken(ais, tree, main_tokens[node], .Space);
485 try renderExpression(ais, tree, datas[node].lhs, space);485 try renderExpression(ais, tree, datas[node].lhs, space);
...@@ -488,7 +488,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -488,7 +488,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
488 }488 }
489 },489 },
490490
491 .GroupedExpression => {491 .grouped_expression => {
492 ais.pushIndentNextLine();492 ais.pushIndentNextLine();
493 try renderToken(ais, tree, main_tokens[node], .None); // lparen493 try renderToken(ais, tree, main_tokens[node], .None); // lparen
494 try renderExpression(ais, tree, datas[node].lhs, .None);494 try renderExpression(ais, tree, datas[node].lhs, .None);
...@@ -496,32 +496,32 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -496,32 +496,32 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
496 return renderToken(ais, tree, datas[node].rhs, space); // rparen496 return renderToken(ais, tree, datas[node].rhs, space); // rparen
497 },497 },
498498
499 .ContainerDecl,499 .container_decl,
500 .ContainerDeclComma,500 .container_decl_comma,
501 => return renderContainerDecl(ais, tree, tree.containerDecl(node), space),501 => return renderContainerDecl(ais, tree, tree.containerDecl(node), space),
502502
503 .ContainerDeclTwo, .ContainerDeclTwoComma => {503 .container_decl_two, .container_decl_two_comma => {
504 var buffer: [2]ast.Node.Index = undefined;504 var buffer: [2]ast.Node.Index = undefined;
505 return renderContainerDecl(ais, tree, tree.containerDeclTwo(&buffer, node), space);505 return renderContainerDecl(ais, tree, tree.containerDeclTwo(&buffer, node), space);
506 },506 },
507 .ContainerDeclArg,507 .container_decl_arg,
508 .ContainerDeclArgComma,508 .container_decl_arg_comma,
509 => return renderContainerDecl(ais, tree, tree.containerDeclArg(node), space),509 => return renderContainerDecl(ais, tree, tree.containerDeclArg(node), space),
510510
511 .TaggedUnion,511 .tagged_union,
512 .TaggedUnionComma,512 .tagged_union_comma,
513 => return renderContainerDecl(ais, tree, tree.taggedUnion(node), space),513 => return renderContainerDecl(ais, tree, tree.taggedUnion(node), space),
514514
515 .TaggedUnionTwo, .TaggedUnionTwoComma => {515 .tagged_union_two, .tagged_union_two_comma => {
516 var buffer: [2]ast.Node.Index = undefined;516 var buffer: [2]ast.Node.Index = undefined;
517 return renderContainerDecl(ais, tree, tree.taggedUnionTwo(&buffer, node), space);517 return renderContainerDecl(ais, tree, tree.taggedUnionTwo(&buffer, node), space);
518 },518 },
519 .TaggedUnionEnumTag,519 .tagged_union_enum_tag,
520 .TaggedUnionEnumTagComma,520 .tagged_union_enum_tag_comma,
521 => return renderContainerDecl(ais, tree, tree.taggedUnionEnumTag(node), space),521 => return renderContainerDecl(ais, tree, tree.taggedUnionEnumTag(node), space),
522522
523 // TODO: handle comments properly523 // TODO: handle comments properly
524 .ErrorSetDecl => {524 .error_set_decl => {
525 const error_token = main_tokens[node];525 const error_token = main_tokens[node];
526 const lbrace = error_token + 1;526 const lbrace = error_token + 1;
527 const rbrace = datas[node].rhs;527 const rbrace = datas[node].rhs;
...@@ -569,7 +569,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -569,7 +569,7 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
569 }569 }
570 },570 },
571571
572 .BuiltinCallTwo, .BuiltinCallTwoComma => {572 .builtin_call_two, .builtin_call_two_comma => {
573 if (datas[node].lhs == 0) {573 if (datas[node].lhs == 0) {
574 const params = [_]ast.Node.Index{};574 const params = [_]ast.Node.Index{};
575 return renderBuiltinCall(ais, tree, main_tokens[node], &params, space);575 return renderBuiltinCall(ais, tree, main_tokens[node], &params, space);
...@@ -581,23 +581,23 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -581,23 +581,23 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
581 return renderBuiltinCall(ais, tree, main_tokens[node], &params, space);581 return renderBuiltinCall(ais, tree, main_tokens[node], &params, space);
582 }582 }
583 },583 },
584 .BuiltinCall, .BuiltinCallComma => {584 .builtin_call, .builtin_call_comma => {
585 const params = tree.extra_data[datas[node].lhs..datas[node].rhs];585 const params = tree.extra_data[datas[node].lhs..datas[node].rhs];
586 return renderBuiltinCall(ais, tree, main_tokens[node], params, space);586 return renderBuiltinCall(ais, tree, main_tokens[node], params, space);
587 },587 },
588588
589 .FnProtoSimple => {589 .fn_proto_simple => {
590 var params: [1]ast.Node.Index = undefined;590 var params: [1]ast.Node.Index = undefined;
591 return renderFnProto(ais, tree, tree.fnProtoSimple(&params, node), space);591 return renderFnProto(ais, tree, tree.fnProtoSimple(&params, node), space);
592 },592 },
593 .FnProtoMulti => return renderFnProto(ais, tree, tree.fnProtoMulti(node), space),593 .fn_proto_multi => return renderFnProto(ais, tree, tree.fnProtoMulti(node), space),
594 .FnProtoOne => {594 .fn_proto_one => {
595 var params: [1]ast.Node.Index = undefined;595 var params: [1]ast.Node.Index = undefined;
596 return renderFnProto(ais, tree, tree.fnProtoOne(&params, node), space);596 return renderFnProto(ais, tree, tree.fnProtoOne(&params, node), space);
597 },597 },
598 .FnProto => return renderFnProto(ais, tree, tree.fnProto(node), space),598 .fn_proto => return renderFnProto(ais, tree, tree.fnProto(node), space),
599599
600 .AnyFrameType => {600 .anyframe_type => {
601 const main_token = main_tokens[node];601 const main_token = main_tokens[node];
602 if (datas[node].rhs != 0) {602 if (datas[node].rhs != 0) {
603 try renderToken(ais, tree, main_token, .None); // anyframe603 try renderToken(ais, tree, main_token, .None); // anyframe
...@@ -608,8 +608,8 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -608,8 +608,8 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
608 }608 }
609 },609 },
610610
611 .Switch,611 .@"switch",
612 .SwitchComma,612 .switch_comma,
613 => {613 => {
614 const switch_token = main_tokens[node];614 const switch_token = main_tokens[node];
615 const condition = datas[node].lhs;615 const condition = datas[node].lhs;
...@@ -635,39 +635,39 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac...@@ -635,39 +635,39 @@ fn renderExpression(ais: *Ais, tree: ast.Tree, node: ast.Node.Index, space: Spac
635 return renderToken(ais, tree, tree.lastToken(node), space); // rbrace635 return renderToken(ais, tree, tree.lastToken(node), space); // rbrace
636 },636 },
637637
638 .SwitchCaseOne => return renderSwitchCase(ais, tree, tree.switchCaseOne(node), space),638 .switch_case_one => return renderSwitchCase(ais, tree, tree.switchCaseOne(node), space),
639 .SwitchCase => return renderSwitchCase(ais, tree, tree.switchCase(node), space),639 .switch_case => return renderSwitchCase(ais, tree, tree.switchCase(node), space),
640640
641 .WhileSimple => return renderWhile(ais, tree, tree.whileSimple(node), space),641 .while_simple => return renderWhile(ais, tree, tree.whileSimple(node), space),
642 .WhileCont => return renderWhile(ais, tree, tree.whileCont(node), space),642 .while_cont => return renderWhile(ais, tree, tree.whileCont(node), space),
643 .While => return renderWhile(ais, tree, tree.whileFull(node), space),643 .@"while" => return renderWhile(ais, tree, tree.whileFull(node), space),
644 .ForSimple => return renderWhile(ais, tree, tree.forSimple(node), space),644 .for_simple => return renderWhile(ais, tree, tree.forSimple(node), space),
645 .For => return renderWhile(ais, tree, tree.forFull(node), space),645 .@"for" => return renderWhile(ais, tree, tree.forFull(node), space),
646646
647 .IfSimple => return renderIf(ais, tree, tree.ifSimple(node), space),647 .if_simple => return renderIf(ais, tree, tree.ifSimple(node), space),
648 .If => return renderIf(ais, tree, tree.ifFull(node), space),648 .@"if" => return renderIf(ais, tree, tree.ifFull(node), space),
649649
650 .AsmSimple => return renderAsm(ais, tree, tree.asmSimple(node), space),650 .asm_simple => return renderAsm(ais, tree, tree.asmSimple(node), space),
651 .Asm => return renderAsm(ais, tree, tree.asmFull(node), space),651 .@"asm" => return renderAsm(ais, tree, tree.asmFull(node), space),
652652
653 .EnumLiteral => {653 .enum_literal => {
654 try renderToken(ais, tree, main_tokens[node] - 1, .None); // .654 try renderToken(ais, tree, main_tokens[node] - 1, .None); // .
655 return renderToken(ais, tree, main_tokens[node], space); // name655 return renderToken(ais, tree, main_tokens[node], space); // name
656 },656 },
657657
658 .FnDecl => unreachable,658 .fn_decl => unreachable,
659 .ContainerField => unreachable,659 .container_field => unreachable,
660 .ContainerFieldInit => unreachable,660 .container_field_init => unreachable,
661 .ContainerFieldAlign => unreachable,661 .container_field_align => unreachable,
662 .Root => unreachable,662 .root => unreachable,
663 .GlobalVarDecl => unreachable,663 .global_var_decl => unreachable,
664 .LocalVarDecl => unreachable,664 .local_var_decl => unreachable,
665 .SimpleVarDecl => unreachable,665 .simple_var_decl => unreachable,
666 .AlignedVarDecl => unreachable,666 .aligned_var_decl => unreachable,
667 .UsingNamespace => unreachable,667 .@"usingnamespace" => unreachable,
668 .TestDecl => unreachable,668 .test_decl => unreachable,
669 .AsmOutput => unreachable,669 .asm_output => unreachable,
670 .AsmInput => unreachable,670 .asm_input => unreachable,
671 }671 }
672}672}
673673
...@@ -814,7 +814,7 @@ fn renderAsmOutput(...@@ -814,7 +814,7 @@ fn renderAsmOutput(
814 const node_tags = tree.nodes.items(.tag);814 const node_tags = tree.nodes.items(.tag);
815 const main_tokens = tree.nodes.items(.main_token);815 const main_tokens = tree.nodes.items(.main_token);
816 const datas = tree.nodes.items(.data);816 const datas = tree.nodes.items(.data);
817 assert(node_tags[asm_output] == .AsmOutput);817 assert(node_tags[asm_output] == .asm_output);
818 const symbolic_name = main_tokens[asm_output];818 const symbolic_name = main_tokens[asm_output];
819819
820 try renderToken(ais, tree, symbolic_name - 1, .None); // lbracket820 try renderToken(ais, tree, symbolic_name - 1, .None); // lbracket
...@@ -842,7 +842,7 @@ fn renderAsmInput(...@@ -842,7 +842,7 @@ fn renderAsmInput(
842 const node_tags = tree.nodes.items(.tag);842 const node_tags = tree.nodes.items(.tag);
843 const main_tokens = tree.nodes.items(.main_token);843 const main_tokens = tree.nodes.items(.main_token);
844 const datas = tree.nodes.items(.data);844 const datas = tree.nodes.items(.data);
845 assert(node_tags[asm_input] == .AsmInput);845 assert(node_tags[asm_input] == .asm_input);
846 const symbolic_name = main_tokens[asm_input];846 const symbolic_name = main_tokens[asm_input];
847847
848 try renderToken(ais, tree, symbolic_name - 1, .None); // lbracket848 try renderToken(ais, tree, symbolic_name - 1, .None); // lbracket
...@@ -1516,10 +1516,10 @@ fn renderBlock(...@@ -1516,10 +1516,10 @@ fn renderBlock(
1516 try renderToken(ais, tree, lbrace, .Newline);1516 try renderToken(ais, tree, lbrace, .Newline);
1517 for (statements) |stmt, i| {1517 for (statements) |stmt, i| {
1518 switch (node_tags[stmt]) {1518 switch (node_tags[stmt]) {
1519 .GlobalVarDecl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),1519 .global_var_decl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),
1520 .LocalVarDecl => try renderVarDecl(ais, tree, tree.localVarDecl(stmt)),1520 .local_var_decl => try renderVarDecl(ais, tree, tree.localVarDecl(stmt)),
1521 .SimpleVarDecl => try renderVarDecl(ais, tree, tree.simpleVarDecl(stmt)),1521 .simple_var_decl => try renderVarDecl(ais, tree, tree.simpleVarDecl(stmt)),
1522 .AlignedVarDecl => try renderVarDecl(ais, tree, tree.alignedVarDecl(stmt)),1522 .aligned_var_decl => try renderVarDecl(ais, tree, tree.alignedVarDecl(stmt)),
1523 else => try renderExpression(ais, tree, stmt, .Semicolon),1523 else => try renderExpression(ais, tree, stmt, .Semicolon),
1524 }1524 }
1525 }1525 }
...@@ -1867,7 +1867,7 @@ fn renderCall(...@@ -1867,7 +1867,7 @@ fn renderCall(
1867 try renderExpression(ais, tree, param_node, Space.None);1867 try renderExpression(ais, tree, param_node, Space.None);
18681868
1869 // Unindent the comma for multiline string literals1869 // Unindent the comma for multiline string literals
1870 const is_multiline_string = node_tags[param_node] == .StringLiteral and1870 const is_multiline_string = node_tags[param_node] == .string_literal and
1871 token_tags[main_tokens[param_node]] == .multiline_string_literal_line;1871 token_tags[main_tokens[param_node]] == .multiline_string_literal_line;
1872 if (is_multiline_string) ais.popIndent();1872 if (is_multiline_string) ais.popIndent();
18731873
...@@ -2031,19 +2031,19 @@ fn renderDocComments(ais: *Ais, tree: ast.Tree, end_token: ast.TokenIndex) Error...@@ -2031,19 +2031,19 @@ fn renderDocComments(ais: *Ais, tree: ast.Tree, end_token: ast.TokenIndex) Error
20312031
2032fn nodeIsBlock(tag: ast.Node.Tag) bool {2032fn nodeIsBlock(tag: ast.Node.Tag) bool {
2033 return switch (tag) {2033 return switch (tag) {
2034 .Block,2034 .block,
2035 .BlockSemicolon,2035 .block_semicolon,
2036 .BlockTwo,2036 .block_two,
2037 .BlockTwoSemicolon,2037 .block_two_semicolon,
2038 .If,2038 .@"if",
2039 .IfSimple,2039 .if_simple,
2040 .For,2040 .@"for",
2041 .ForSimple,2041 .for_simple,
2042 .While,2042 .@"while",
2043 .WhileSimple,2043 .while_simple,
2044 .WhileCont,2044 .while_cont,
2045 .Switch,2045 .@"switch",
2046 .SwitchComma,2046 .switch_comma,
2047 => true,2047 => true,
2048 else => false,2048 else => false,
2049 };2049 };
...@@ -2051,47 +2051,47 @@ fn nodeIsBlock(tag: ast.Node.Tag) bool {...@@ -2051,47 +2051,47 @@ fn nodeIsBlock(tag: ast.Node.Tag) bool {
20512051
2052fn nodeCausesSliceOpSpace(tag: ast.Node.Tag) bool {2052fn nodeCausesSliceOpSpace(tag: ast.Node.Tag) bool {
2053 return switch (tag) {2053 return switch (tag) {
2054 .Catch,2054 .@"catch",
2055 .Add,2055 .add,
2056 .AddWrap,2056 .add_wrap,
2057 .ArrayCat,2057 .array_cat,
2058 .ArrayMult,2058 .array_mult,
2059 .Assign,2059 .assign,
2060 .AssignBitAnd,2060 .assign_bit_and,
2061 .AssignBitOr,2061 .assign_bit_or,
2062 .AssignBitShiftLeft,2062 .assign_bit_shift_left,
2063 .AssignBitShiftRight,2063 .assign_bit_shift_right,
2064 .AssignBitXor,2064 .assign_bit_xor,
2065 .AssignDiv,2065 .assign_div,
2066 .AssignSub,2066 .assign_sub,
2067 .AssignSubWrap,2067 .assign_sub_wrap,
2068 .AssignMod,2068 .assign_mod,
2069 .AssignAdd,2069 .assign_add,
2070 .AssignAddWrap,2070 .assign_add_wrap,
2071 .AssignMul,2071 .assign_mul,
2072 .AssignMulWrap,2072 .assign_mul_wrap,
2073 .BangEqual,2073 .bang_equal,
2074 .BitAnd,2074 .bit_and,
2075 .BitOr,2075 .bit_or,
2076 .BitShiftLeft,2076 .bit_shift_left,
2077 .BitShiftRight,2077 .bit_shift_right,
2078 .BitXor,2078 .bit_xor,
2079 .BoolAnd,2079 .bool_and,
2080 .BoolOr,2080 .bool_or,
2081 .Div,2081 .div,
2082 .EqualEqual,2082 .equal_equal,
2083 .ErrorUnion,2083 .error_union,
2084 .GreaterOrEqual,2084 .greater_or_equal,
2085 .GreaterThan,2085 .greater_than,
2086 .LessOrEqual,2086 .less_or_equal,
2087 .LessThan,2087 .less_than,
2088 .MergeErrorSets,2088 .merge_error_sets,
2089 .Mod,2089 .mod,
2090 .Mul,2090 .mul,
2091 .MulWrap,2091 .mul_wrap,
2092 .Sub,2092 .sub,
2093 .SubWrap,2093 .sub_wrap,
2094 .OrElse,2094 .@"orelse",
2095 => true,2095 => true,
20962096
2097 else => false,2097 else => false,