Skip to content

Commit

Permalink
fix: Lifting conditions grammar up to openfga
Browse files Browse the repository at this point in the history
  • Loading branch information
d-jeffery committed Nov 6, 2023
1 parent d45b009 commit 951fd32
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
28 changes: 1 addition & 27 deletions syntaxes/cel.injection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,7 @@
],
"repository": {
"condition": {
"begin": "(condition)\\s([_a-zA-Z][_a-zA-Z0-9]+)\\((.*)\\)\\s*{",
"beginCaptures": {
"1": {
"name": "keyword.condition.openfga"
},
"2": {
"name": "entity.name.function.condition.openfga"
},
"3": {
"patterns": [
{
"include": "#cel-prama"
}
]
}
},
"begin": "{",
"end": "}",
"patterns": [
{
Expand All @@ -35,17 +20,6 @@
]
}
]
},
"cel-prama": {
"match": "([_a-zA-Z][_a-zA-Z0-9]+)\\:\\s([_a-zA-Z][_a-zA-Z0-9]+),?",
"captures": {
"1": {
"name": "variable.parameter.name.condition.openfga"
},
"2": {
"name": "variable.parameter.type.condition.openfga"
}
}
}
}
}
29 changes: 29 additions & 0 deletions syntaxes/openfga.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,38 @@
},
{
"include": "#symbols"
},
{
"include": "#condition"
}
],
"repository": {
"condition": {
"match": "(condition)\\s([_a-zA-Z][_a-zA-Z0-9]+)\\((.*)\\)\\s*",
"captures": {
"1": {
"name": "keyword.condition.openfga"
},
"2": {
"name": "entity.name.function.condition.openfga"
},
"3": {
"patterns": [
{
"match": "([_a-zA-Z][_a-zA-Z0-9]+)\\:\\s([_a-zA-Z][_a-zA-Z0-9]+),?",
"captures": {
"1": {
"name": "variable.parameter.name.condition.openfga"
},
"2": {
"name": "variable.parameter.type.condition.openfga"
}
}
}
]
}
}
},
"comments": {
"patterns": [
{
Expand Down

0 comments on commit 951fd32

Please sign in to comment.