Skip to content

Commit

Permalink
parser: band-aid repeat_tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbz64 committed Apr 16, 2024
1 parent 8e6ad7b commit a2c7af6
Show file tree
Hide file tree
Showing 4 changed files with 91,042 additions and 88,131 deletions.
3 changes: 3 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ module.exports = grammar({

while_phrase: ($) => seq(kw("WHILE"), field("condition", $._expression)),

repeat_tuning: ($) => choice(seq(kw("WITH"), kw("FRAME"), $.identifier)),

repeat_statement: ($) =>
seq(
optional($.label),
Expand All @@ -379,6 +381,7 @@ module.exports = grammar({
optional($.on_error_phrase),
optional($.on_quit_phrase),
optional($.on_stop_phrase),
repeat($.repeat_tuning),
":",
optional($.body),
$._block_terminator
Expand Down
53 changes: 53 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2840,6 +2840,52 @@
}
]
},
"repeat_tuning": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "[wW][iI][tT][hH]"
}
}
},
"named": false,
"value": "WITH"
},
{
"type": "ALIAS",
"content": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "[fF][rR][aA][mM][eE]"
}
}
},
"named": false,
"value": "FRAME"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
]
},
"repeat_statement": {
"type": "SEQ",
"members": [
Expand Down Expand Up @@ -2931,6 +2977,13 @@
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "repeat_tuning"
}
},
{
"type": "STRING",
"value": ":"
Expand Down
23 changes: 23 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,10 @@
"type": "on_stop_phrase",
"named": true
},
{
"type": "repeat_tuning",
"named": true
},
{
"type": "to_phrase",
"named": true
Expand All @@ -2617,6 +2621,21 @@
]
}
},
{
"type": "repeat_tuning",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
},
{
"type": "return_statement",
"named": true,
Expand Down Expand Up @@ -3992,6 +4011,10 @@
"type": "WHILE",
"named": false
},
{
"type": "WITH",
"named": false
},
{
"type": "WORD-INDEX",
"named": false
Expand Down
Loading

0 comments on commit a2c7af6

Please sign in to comment.