From 1bbdcab3acdcff659f88a512b4ae7cc10166e8f9 Mon Sep 17 00:00:00 2001 From: Techarix <19954306+Techatrix@users.noreply.github.com> Date: Wed, 10 May 2023 15:05:29 +0200 Subject: [PATCH] fix semantic token generation crash on continue expression --- src/features/semantic_tokens.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/features/semantic_tokens.zig b/src/features/semantic_tokens.zig index bce2cf7..d030535 100644 --- a/src/features/semantic_tokens.zig +++ b/src/features/semantic_tokens.zig @@ -701,14 +701,17 @@ fn writeNodeTokens(builder: *Builder, node: Ast.Node.Index) error{OutOfMemory}!v .grouped_expression => { try callWriteNodeTokens(allocator, .{ builder, node_data[node].lhs }); }, - .@"break", - .@"continue", - => { + .@"break" => { try writeToken(builder, main_token, .keyword); if (node_data[node].lhs != 0) try writeToken(builder, node_data[node].lhs, .label); 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" => { try writeToken(builder, main_token, .keyword); try callWriteNodeTokens(allocator, .{ builder, node_data[node].lhs });