Skip to content

Commit

Permalink
Support calls with more than 2 arguments
Browse files Browse the repository at this point in the history
This closes sourcegraph/tree-sitter-jsonnet#5

test plan:
make test
  • Loading branch information
pad authored and tjdevries committed Dec 11, 2022
1 parent 0475a50 commit f4e2d85
Show file tree
Hide file tree
Showing 5 changed files with 3,623 additions and 3,519 deletions.
6 changes: 3 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ module.exports = grammar({
choice(
seq(
$.expr,
optional(seq(",", $.expr)),
optional(seq(",", $.named_argument)),
repeat(seq(",", $.expr)),
repeat(seq(",", $.named_argument)),
optional(",")
),
seq(
$.named_argument,
optional(seq(",", $.named_argument)),
repeat(seq(",", $.named_argument)),
optional(",")
)
),
Expand Down
99 changes: 42 additions & 57 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1311,46 +1311,36 @@
"name": "expr"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "expr"
}
]
},
{
"type": "BLANK"
}
]
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "expr"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "named_argument"
}
]
},
{
"type": "BLANK"
}
]
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "named_argument"
}
]
}
},
{
"type": "CHOICE",
Expand All @@ -1374,25 +1364,20 @@
"name": "named_argument"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "named_argument"
}
]
},
{
"type": "BLANK"
}
]
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "named_argument"
}
]
}
},
{
"type": "CHOICE",
Expand Down
Loading

0 comments on commit f4e2d85

Please sign in to comment.