Skip to content

Commit

Permalink
improve caveat parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Feb 8, 2024
1 parent e51aa00 commit b894c02
Show file tree
Hide file tree
Showing 5 changed files with 745 additions and 736 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ module.exports = grammar({
optional(','),
)),

caveat_expr: $ => $.identifier,
caveat_expr: _ => /[^{}](.*)/,
},
});
4 changes: 2 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@
}
},
"caveat_expr": {
"type": "SYMBOL",
"name": "identifier"
"type": "PATTERN",
"value": "[^{}](.*)"
}
},
"extras": [
Expand Down
23 changes: 4 additions & 19 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,6 @@
}
}
},
{
"type": "caveat_expr",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
},
{
"type": "computed_userset",
"named": true,
Expand Down Expand Up @@ -471,6 +456,10 @@
"type": "caveat",
"named": false
},
{
"type": "caveat_expr",
"named": true
},
{
"type": "cel_type_identifier",
"named": true
Expand All @@ -495,10 +484,6 @@
"type": "func_identifier",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "method_identifier",
"named": true
Expand Down
Loading

0 comments on commit b894c02

Please sign in to comment.