| ... | @@ -500,68 +500,72 @@ pub const Node = struct { | ... | @@ -500,68 +500,72 @@ pub const Node = struct { |
| 500 | var n = base; | 500 | var n = base; |
| 501 | while (true) { | 501 | while (true) { |
| 502 | switch (n.id) { | 502 | switch (n.id) { |
| 503 | Id.Root, | 503 | .Root, |
| 504 | Id.ContainerField, | 504 | .ContainerField, |
| 505 | Id.ParamDecl, | 505 | .ParamDecl, |
| 506 | Id.Block, | 506 | .Block, |
| 507 | Id.Payload, | 507 | .Payload, |
| 508 | Id.PointerPayload, | 508 | .PointerPayload, |
| 509 | Id.PointerIndexPayload, | 509 | .PointerIndexPayload, |
| 510 | Id.Switch, | 510 | .Switch, |
| 511 | Id.SwitchCase, | 511 | .SwitchCase, |
| 512 | Id.SwitchElse, | 512 | .SwitchElse, |
| 513 | Id.FieldInitializer, | 513 | .FieldInitializer, |
| 514 | Id.DocComment, | 514 | .DocComment, |
| 515 | Id.TestDecl, | 515 | .TestDecl, |
| 516 | => return false, | 516 | => return false, |
| 517 | Id.While => { | 517 | .While => { |
| 518 | const while_node = @fieldParentPtr(While, "base", n); | 518 | const while_node = @fieldParentPtr(While, "base", n); |
| 519 | if (while_node.@"else") |@"else"| { | 519 | if (while_node.@"else") |@"else"| { |
| 520 | n = &@"else".base; | 520 | n = &@"else".base; |
| 521 | continue; | 521 | continue; |
| 522 | } | 522 | } |
| 523 | | 523 | |
| 524 | return while_node.body.id != Id.Block; | 524 | return while_node.body.id != .Block; |
| 525 | }, | 525 | }, |
| 526 | Id.For => { | 526 | .For => { |
| 527 | const for_node = @fieldParentPtr(For, "base", n); | 527 | const for_node = @fieldParentPtr(For, "base", n); |
| 528 | if (for_node.@"else") |@"else"| { | 528 | if (for_node.@"else") |@"else"| { |
| 529 | n = &@"else".base; | 529 | n = &@"else".base; |
| 530 | continue; | 530 | continue; |
| 531 | } | 531 | } |
| 532 | | 532 | |
| 533 | return for_node.body.id != Id.Block; | 533 | return for_node.body.id != .Block; |
| 534 | }, | 534 | }, |
| 535 | Id.If => { | 535 | .If => { |
| 536 | const if_node = @fieldParentPtr(If, "base", n); | 536 | const if_node = @fieldParentPtr(If, "base", n); |
| 537 | if (if_node.@"else") |@"else"| { | 537 | if (if_node.@"else") |@"else"| { |
| 538 | n = &@"else".base; | 538 | n = &@"else".base; |
| 539 | continue; | 539 | continue; |
| 540 | } | 540 | } |
| 541 | | 541 | |
| 542 | return if_node.body.id != Id.Block; | 542 | return if_node.body.id != .Block; |
| 543 | }, | 543 | }, |
| 544 | Id.Else => { | 544 | .Else => { |
| 545 | const else_node = @fieldParentPtr(Else, "base", n); | 545 | const else_node = @fieldParentPtr(Else, "base", n); |
| 546 | n = else_node.body; | 546 | n = else_node.body; |
| 547 | continue; | 547 | continue; |
| 548 | }, | 548 | }, |
| 549 | Id.Defer => { | 549 | .Defer => { |
| 550 | const defer_node = @fieldParentPtr(Defer, "base", n); | 550 | const defer_node = @fieldParentPtr(Defer, "base", n); |
| 551 | return defer_node.expr.id != Id.Block; | 551 | return defer_node.expr.id != .Block; |
| 552 | }, | 552 | }, |
| 553 | Id.Comptime => { | 553 | .Comptime => { |
| 554 | const comptime_node = @fieldParentPtr(Comptime, "base", n); | 554 | const comptime_node = @fieldParentPtr(Comptime, "base", n); |
| 555 | return comptime_node.expr.id != Id.Block; | 555 | return comptime_node.expr.id != .Block; |
| 556 | }, | 556 | }, |
| 557 | Id.Suspend => { | 557 | .Suspend => { |
| 558 | const suspend_node = @fieldParentPtr(Suspend, "base", n); | 558 | const suspend_node = @fieldParentPtr(Suspend, "base", n); |
| 559 | if (suspend_node.body) |body| { | 559 | if (suspend_node.body) |body| { |
| 560 | return body.id != Id.Block; | 560 | return body.id != .Block; |
| 561 | } | 561 | } |
| 562 | | 562 | |
| 563 | return true; | 563 | return true; |
| 564 | }, | 564 | }, |
| | 565 | .Noasync => { |
| | 566 | const noasync_node = @fieldParentPtr(Noasync, "base", n); |
| | 567 | return noasync_node.expr.id != .Block; |
| | 568 | }, |
| 565 | else => return true, | 569 | else => return true, |
| 566 | } | 570 | } |
| 567 | } | 571 | } |