Skip to content

Commit

Permalink
parser: add prompt_for_statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbz64 committed Apr 19, 2024
1 parent cd3dd67 commit 6f8c82b
Show file tree
Hide file tree
Showing 4 changed files with 119,243 additions and 117,231 deletions.
11 changes: 11 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,16 @@ module.exports = grammar({
)
),

prompt_for_statement: ($) =>
seq(
kw("PROMPT-FOR"),
choice($.identifier, $.qualified_name),
optional(kw("EDITING")),
":",
optional($.body),
$._block_terminator
),

// Supertypes
_expression: ($) =>
choice(
Expand Down Expand Up @@ -1206,6 +1216,7 @@ module.exports = grammar({
$.class_statement,
$.interface_statement,
$.on_statement,
$.prompt_for_statement,
$.abl_statement,
prec.left(PREC.EXTRA, $.label)
),
Expand Down
82 changes: 82 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -11368,6 +11368,84 @@
}
]
},
"prompt_for_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "[pP][rR][oO][mM][pP][tT][--][fF][oO][rR]"
}
}
},
"named": false,
"value": "PROMPT-FOR"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "qualified_name"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "[eE][dD][iI][tT][iI][nN][gG]"
}
}
},
"named": false,
"value": "EDITING"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ":"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "body"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_block_terminator"
}
]
},
"_expression": {
"type": "CHOICE",
"members": [
Expand Down Expand Up @@ -11580,6 +11658,10 @@
"type": "SYMBOL",
"name": "on_statement"
},
{
"type": "SYMBOL",
"name": "prompt_for_statement"
},
{
"type": "SYMBOL",
"name": "abl_statement"
Expand Down
31 changes: 31 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@
"type": "procedure_statement",
"named": true
},
{
"type": "prompt_for_statement",
"named": true
},
{
"type": "query_definition",
"named": true
Expand Down Expand Up @@ -2398,6 +2402,25 @@
]
}
},
{
"type": "prompt_for_statement",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "body",
"named": true
},
{
"type": "identifier",
"named": true
}
]
}
},
{
"type": "property_definition",
"named": true,
Expand Down Expand Up @@ -3455,6 +3478,10 @@
"type": "ECHO",
"named": false
},
{
"type": "EDITING",
"named": false
},
{
"type": "ELSE",
"named": false
Expand Down Expand Up @@ -3795,6 +3822,10 @@
"type": "PROCEDURE",
"named": false
},
{
"type": "PROMPT-FOR",
"named": false
},
{
"type": "PROPATH",
"named": false
Expand Down
Loading

0 comments on commit 6f8c82b

Please sign in to comment.