feat(fga): add FGA grammar

FGA is the DSL for [OpenFGA](https://openfga.dev/) authorization models
- a zanzibar-like Role-Based Access Control system.
This commit is contained in:
Matouš Dzivjak 2025-07-08 09:07:51 +02:00
parent 0d32ec3c3e
commit 5ca72f9b30
No known key found for this signature in database
3 changed files with 59 additions and 0 deletions

View file

@ -80,6 +80,7 @@ ecma (queries only)[^ecma] | unstable | `HFIJL` | | @steelsojka
[facility](https://github.com/FacilityApi/tree-sitter-facility) | unstable | `HFIJ ` | | @bryankenote
[faust](https://github.com/khiner/tree-sitter-faust) | unstable | `H  J ` | | @khiner
[fennel](https://github.com/alexmozaidze/tree-sitter-fennel) | unstable | `HF JL` | | @alexmozaidze
[fga](https://github.com/matoous/tree-sitter-fga) | unstable | `H    ` | | @matoous
[fidl](https://github.com/google/tree-sitter-fidl) | unstable | `HF J ` | | @chaopeng
[firrtl](https://github.com/tree-sitter-grammars/tree-sitter-firrtl) | unstable | `HFIJL` | | @amaanq
[fish](https://github.com/ram02z/tree-sitter-fish) | unstable | `HFIJL` | | @ram02z

View file

@ -550,6 +550,14 @@ return {
maintainers = { '@alexmozaidze' },
tier = 2,
},
fga = {
install_info = {
revision = '44bfe4e15dc11969f1a23e5f0fa9d8e961268721',
url = 'https://github.com/matoous/tree-sitter-fga',
},
maintainers = { '@matoous' },
tier = 2,
},
fidl = {
install_info = {
revision = '0a8910f293268e27ff554357c229ba172b0eaed2',

View file

@ -0,0 +1,50 @@
(call_expression
function: (identifier) @function)
(call_expression
function: (selector_expression
field: (identifier) @function.method))
((type_identifier) @type.builtin
(#match? @type.builtin "^(string|int|map|uint|list|timestamp|bool|duration|double|ipaddress)$"))
(condition_declaration
name: (identifier) @function)
(version) @number
[
"*"
"/"
"%"
">>"
"<<"
"&"
"&^"
] @operator
[
"+"
"-"
"|"
"^"
] @operator
[
"or"
"and"
"but not"
] @operator
[
"model"
"schema"
"type"
"relations"
"define"
"from"
] @keyword
"condition" @keyword.function
(comment) @comment