Merge pull request #1184 from Techatrix/fix-semantic-tokens-on-continue

fix semantic token generation crash on continue expression
This commit is contained in:
Lee Cannon 2023-05-11 12:36:04 -07:00 committed by GitHub
commit d0a9911a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -701,14 +701,17 @@ fn writeNodeTokens(builder: *Builder, node: Ast.Node.Index) error{OutOfMemory}!v
.grouped_expression => { .grouped_expression => {
try callWriteNodeTokens(allocator, .{ builder, node_data[node].lhs }); try callWriteNodeTokens(allocator, .{ builder, node_data[node].lhs });
}, },
.@"break", .@"break" => {
.@"continue",
=> {
try writeToken(builder, main_token, .keyword); try writeToken(builder, main_token, .keyword);
if (node_data[node].lhs != 0) if (node_data[node].lhs != 0)
try writeToken(builder, node_data[node].lhs, .label); try writeToken(builder, node_data[node].lhs, .label);
try callWriteNodeTokens(allocator, .{ builder, node_data[node].rhs }); try callWriteNodeTokens(allocator, .{ builder, node_data[node].rhs });
}, },
.@"continue" => {
try writeToken(builder, main_token, .keyword);
if (node_data[node].lhs != 0)
try writeToken(builder, node_data[node].lhs, .label);
},
.@"suspend", .@"return" => { .@"suspend", .@"return" => {
try writeToken(builder, main_token, .keyword); try writeToken(builder, main_token, .keyword);
try callWriteNodeTokens(allocator, .{ builder, node_data[node].lhs }); try callWriteNodeTokens(allocator, .{ builder, node_data[node].lhs });