Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
grammar: guard clause following pattern in lambda (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuxified committed Feb 8, 2021
1 parent 51a9026 commit 7b436e1
Show file tree
Hide file tree
Showing 5 changed files with 19,264 additions and 17,954 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ module.exports = grammar({
lambda_clause: ($) =>
seq(
field("arguments", args($.pattern)),
opt($.guard_clause),
ARROW,
field("body", sepBy(COMMA, $.expression))
),
Expand Down
12 changes: 12 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2900,6 +2900,18 @@
}
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "guard_clause"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "->"
Expand Down
10 changes: 10 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -4813,6 +4813,16 @@
}
]
}
},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "guard_clause",
"named": true
}
]
}
},
{
Expand Down
Loading

0 comments on commit 7b436e1

Please sign in to comment.