Skip to content

Commit

Permalink
support 'tailstrict' call annotation (Wilfred#8)
Browse files Browse the repository at this point in the history
* support 'tailstrict' call annotation

This is used in the standard jsonnet library (std.jsonnet)

test plan:
make test

* add node for tailstrict
  • Loading branch information
Yoann Padioleau authored Dec 12, 2022
1 parent f4e2d85 commit 44c0d58
Show file tree
Hide file tree
Showing 5 changed files with 4,373 additions and 4,134 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = grammar({
),
seq($.super, ".", $.id),
seq($.super, "[", $.expr, "]"),
seq($.expr, "(", optional($.args), ")"),
seq($.expr, "(", optional($.args), ")", optional($.tailstrict)),
$.id,
$.local_bind,
seq(
Expand Down Expand Up @@ -123,6 +123,7 @@ module.exports = grammar({
dollar: () => "$",
super: () => "super",
local: () => "local",
tailstrict: () => "tailstrict",

objinside: ($) =>
choice(
Expand Down
16 changes: 16 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,18 @@
{
"type": "STRING",
"value": ")"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "tailstrict"
},
{
"type": "BLANK"
}
]
}
]
},
Expand Down Expand Up @@ -766,6 +778,10 @@
"type": "STRING",
"value": "local"
},
"tailstrict": {
"type": "STRING",
"value": "tailstrict"
},
"objinside": {
"type": "CHOICE",
"members": [
Expand Down
8 changes: 8 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@
"type": "super",
"named": true
},
{
"type": "tailstrict",
"named": true
},
{
"type": "true",
"named": true
Expand Down Expand Up @@ -811,6 +815,10 @@
"type": "super",
"named": true
},
{
"type": "tailstrict",
"named": true
},
{
"type": "then",
"named": false
Expand Down
Loading

0 comments on commit 44c0d58

Please sign in to comment.