Skip to content

Commit

Permalink
Fix immediate comment following if-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Beaglefoot committed Jan 27, 2024
1 parent dcf4ac4 commit be9e506
Show file tree
Hide file tree
Showing 4 changed files with 53,379 additions and 52,335 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ module.exports = grammar({
seq(
'if',
field('condition', seq('(', $._exp, ')')),
repeat($.comment),
choice($.block, $._statement, ';'),
optional(seq($._if_else_separator, repeat($.comment), $.else_clause))
)
Expand Down
7 changes: 7 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@
]
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "comment"
}
},
{
"type": "CHOICE",
"members": [
Expand Down
Loading

0 comments on commit be9e506

Please sign in to comment.