fn fullSwitchCaseComponents(tree: Ast, info: full.SwitchCase.Components, node: Node.Index) full.SwitchCase tree: Astinfo: full.SwitchCase.Componentsnode: Node.Index2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205fn fullSwitchCaseComponents(tree: Ast, info: full.SwitchCase.Components, node: Node.Index) full.SwitchCase {
var result: full.SwitchCase = .{
.ast = info,
.payload_token = null,
.inline_token = null,
};
if (tree.tokenTag(info.arrow_token + 1) == .pipe) {
result.payload_token = info.arrow_token + 2;
}
result.inline_token = switch (tree.nodeTag(node)) {
.switch_case_inline, .switch_case_inline_one => if (result.ast.values.len == 0)
info.arrow_token - 2
else
tree.firstToken(result.ast.values[0]) - 1,
else => null,
};
return result;
}