Skip to content

Commit

Permalink
Add condition node
Browse files Browse the repository at this point in the history
  • Loading branch information
smoeding committed Apr 26, 2024
1 parent 9ba3558 commit 67bf22a
Show file tree
Hide file tree
Showing 5 changed files with 515 additions and 1,133 deletions.
7 changes: 3 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,23 +330,22 @@ module.exports = grammar({

// If

//if_expression: $ => seq('if', $._if_part),
if: $ => seq(
'if',
$._expression,
alias($._expression, $.condition),
$.block,
repeat($.elsif),
optional($.else),
),

elsif: $ => seq('elsif', $._expression, $.block),
elsif: $ => seq('elsif', alias($._expression, $.condition), $.block),
else: $ => seq('else', $.block),

// Unless

unless: $ => seq(
'unless',
$._expression,
alias($._expression, $.condition),
$.block,
optional($.else),
),
Expand Down
Loading

0 comments on commit 67bf22a

Please sign in to comment.