Skip to content

Commit

Permalink
Fix tree-sitter grammar to support optional trailing semicolon after …
Browse files Browse the repository at this point in the history
…else block

Commit 183278c exposed the following
statement to the parser with a trailing semicolon:

            if (val > 50) {
                return green;
            } else if val > 40 {
                return yellow;
            } else {
                return blue;
            };
  • Loading branch information
tronical committed Apr 16, 2024
1 parent c2b3bbd commit 8a7bb0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editors/tree-sitter-slint/grammar.js
Expand Up @@ -95,7 +95,7 @@ module.exports = grammar({
choice(
seq($.assignment_block, optional(";")),
seq($.assignment_expr, optional(";")),
$.if_expr,
seq($.if_expr, optional(";")),
$.callback_event,
$.binding,
seq($.expression, optional(";")),
Expand Down

0 comments on commit 8a7bb0a

Please sign in to comment.