Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Only allow expressions on if/unless/elsif statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugopl committed Dec 5, 2024
1 parent 48f40c1 commit a9c7418
Show file tree
Hide file tree
Showing 4 changed files with 15,716 additions and 15,920 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,23 @@ module.exports = grammar({

if: $ => seq(
'if',
field('condition', $._statement),
field('condition', $._expression),
choice($._terminator, field('consequence', $.then)),
field('alternative', optional(choice($.else, $.elsif))),
'end',
),

unless: $ => seq(
'unless',
field('condition', $._statement),
field('condition', $._expression),
choice($._terminator, field('consequence', $.then)),
field('alternative', optional(choice($.else, $.elsif))),
'end',
),

elsif: $ => seq(
'elsif',
field('condition', $._statement),
field('condition', $._expression),
choice($._terminator, field('consequence', $.then)),
field('alternative', optional(choice($.else, $.elsif))),
),
Expand Down
6 changes: 3 additions & 3 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 0 additions & 132 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a9c7418

Please sign in to comment.