| ... | @@ -538,6 +538,7 @@ pub const Tree = struct { | ... | @@ -538,6 +538,7 @@ pub const Tree = struct { |
| 538 | .ArrayType, | 538 | .ArrayType, |
| 539 | .SwitchCaseOne, | 539 | .SwitchCaseOne, |
| 540 | .SwitchCase, | 540 | .SwitchCase, |
| | 541 | .SwitchRange, |
| 541 | => n = datas[n].rhs, | 542 | => n = datas[n].rhs, |
| 542 | | 543 | |
| 543 | .FieldAccess, | 544 | .FieldAccess, |
| ... | @@ -580,8 +581,21 @@ pub const Tree = struct { | ... | @@ -580,8 +581,21 @@ pub const Tree = struct { |
| 580 | } | 581 | } |
| 581 | n = tree.extra_data[params.end - 1]; // last parameter | 582 | n = tree.extra_data[params.end - 1]; // last parameter |
| 582 | }, | 583 | }, |
| 583 | .CallComma, .AsyncCallComma => { | 584 | .TaggedUnionEnumTag => { |
| 584 | end_offset += 2; // for the comma+rparen | 585 | const members = tree.extraData(datas[n].rhs, Node.SubRange); |
| | 586 | if (members.end - members.start == 0) { |
| | 587 | end_offset += 4; // for the rparen + rparen + lbrace + rbrace |
| | 588 | n = datas[n].lhs; |
| | 589 | } else { |
| | 590 | end_offset += 1; // for the rbrace |
| | 591 | n = tree.extra_data[members.end - 1]; // last parameter |
| | 592 | } |
| | 593 | }, |
| | 594 | .CallComma, |
| | 595 | .AsyncCallComma, |
| | 596 | .TaggedUnionEnumTagComma, |
| | 597 | => { |
| | 598 | end_offset += 2; // for the comma + rparen/rbrace |
| 585 | const params = tree.extraData(datas[n].rhs, Node.SubRange); | 599 | const params = tree.extraData(datas[n].rhs, Node.SubRange); |
| 586 | assert(params.end > params.start); | 600 | assert(params.end > params.start); |
| 587 | n = tree.extra_data[params.end - 1]; // last parameter | 601 | n = tree.extra_data[params.end - 1]; // last parameter |
| ... | @@ -942,10 +956,6 @@ pub const Tree = struct { | ... | @@ -942,10 +956,6 @@ pub const Tree = struct { |
| 942 | const extra = tree.extraData(datas[n].rhs, Node.ArrayTypeSentinel); | 956 | const extra = tree.extraData(datas[n].rhs, Node.ArrayTypeSentinel); |
| 943 | n = extra.elem_type; | 957 | n = extra.elem_type; |
| 944 | }, | 958 | }, |
| 945 | | | |
| 946 | .TaggedUnionEnumTag => unreachable, // TODO | | |
| 947 | .TaggedUnionEnumTagComma => unreachable, // TODO | | |
| 948 | .SwitchRange => unreachable, // TODO | | |
| 949 | }; | 959 | }; |
| 950 | } | 960 | } |
| 951 | | 961 | |