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

Commit 7b436e1

Browse files
authored
grammar: guard clause following pattern in lambda (#6)
1 parent 51a9026 commit 7b436e1

File tree

5 files changed

+19264
-17954
lines changed

5 files changed

+19264
-17954
lines changed

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ module.exports = grammar({
494494
lambda_clause: ($) =>
495495
seq(
496496
field("arguments", args($.pattern)),
497+
opt($.guard_clause),
497498
ARROW,
498499
field("body", sepBy(COMMA, $.expression))
499500
),

src/grammar.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,6 +2900,18 @@
29002900
}
29012901
}
29022902
},
2903+
{
2904+
"type": "CHOICE",
2905+
"members": [
2906+
{
2907+
"type": "SYMBOL",
2908+
"name": "guard_clause"
2909+
},
2910+
{
2911+
"type": "BLANK"
2912+
}
2913+
]
2914+
},
29032915
{
29042916
"type": "STRING",
29052917
"value": "->"

src/node-types.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4813,6 +4813,16 @@
48134813
}
48144814
]
48154815
}
4816+
},
4817+
"children": {
4818+
"multiple": false,
4819+
"required": false,
4820+
"types": [
4821+
{
4822+
"type": "guard_clause",
4823+
"named": true
4824+
}
4825+
]
48164826
}
48174827
},
48184828
{

0 commit comments

Comments
 (0)