Skip to content

Commit

Permalink
parser: make function parameters mode optional
Browse files Browse the repository at this point in the history
Partially fixes #21
  • Loading branch information
jkbz64 committed Dec 4, 2023
1 parent 8e3eb02 commit e0e4244
Show file tree
Hide file tree
Showing 4 changed files with 21,601 additions and 21,485 deletions.
7 changes: 6 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,12 @@ module.exports = grammar({
),
function_parameter_mode: ($) => choice(kw("INPUT"), kw("OUTPUT")),
function_parameter: ($) =>
seq($.function_parameter_mode, $.identifier, kw("AS"), $.primitive_type),
seq(
optional($.function_parameter_mode),
$.identifier,
kw("AS"),
$.primitive_type
),

function_statement: ($) =>
seq(
Expand Down
12 changes: 10 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3015,8 +3015,16 @@
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "function_parameter_mode"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "function_parameter_mode"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
Expand Down
Loading

0 comments on commit e0e4244

Please sign in to comment.