Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/fga/highlights.scm')
| -rw-r--r-- | runtime/queries/fga/highlights.scm | 133 |
1 files changed, 54 insertions, 79 deletions
diff --git a/runtime/queries/fga/highlights.scm b/runtime/queries/fga/highlights.scm index 402f6f4d..8fb2337e 100644 --- a/runtime/queries/fga/highlights.scm +++ b/runtime/queries/fga/highlights.scm @@ -1,97 +1,72 @@ -; Expressions +(condition_declaration + name: (identifier) @function) -(call_expression - function: (identifier) @function) +(condition_declaration + (param + name: (identifier) @variable.parameter)) -(call_expression - function: (selector_expression - field: (identifier) @function.method)) +(conditional + condition: (identifier) @function) +(type_declaration + name: (extended_identifier) @type) -; Type Definitions +(definition + relation: (extended_identifier) @variable) -(type_declaration (identifier) @type) +(indirect_relation + relation: (extended_identifier) @variable.other.member + tupleset: (extended_identifier) @variable) -(definition - relation: (identifier) @variable) +(relation_ref) @type +(all) @type +((simple_type_identifier) @type.builtin) -; Relation Definitions +((container_type_identifier) @type.builtin) -(relation_def (identifier) @variable.other.member) +(version) @constant.numeric +(int) @constant.numeric.integer +(uint) @constant.numeric.integer +(float) @constant.numeric.float -(direct_relationship (identifier) @type) -(direct_relationship (conditional (identifier) @function)) +(string) @string +(bytes) @string.special -(relation_ref - . (identifier) @type - (identifier) @variable.other.member) +(boolean) @constant.builtin.boolean +(null) @constant.builtin -(indirect_relation - . (identifier) @variable.other.member - (identifier) @variable) +(condition_body + (identifier) @variable) +(parenthesized_condition + (identifier) @variable) -; Condition Defintions +(bracket_condition + (identifier) @variable) -(condition_declaration - name: (identifier) @function) +(braced_condition + (identifier) @variable) -(condition_declaration (param (identifier) @variable.parameter)) - -(binary_expression (identifier) @variable) - -((type_identifier) @type.builtin - (#any-of? @type.builtin "string" "int" "map" "uint" "list" "timestamp" "bool" "duration" "double" "ipaddress")) - - -; Operators - -[ - "!=" - "%" - "&" - "&&" - "&^" - "*" - "+" - "-" - "/" - "<" - "<<" - "<=" - "==" - ">" - ">=" - ">>" - "^" - "|" - "||" -] @operator - -[ - "or" - "and" - "but not" - "from" - "with" -] @keyword.operator - -; Keywords - -[ - "model" - "schema" - "type" - "relations" - "define" -] @keyword - -[ - "condition" -] @keyword.function - -; Misc +(operator) @operator +(condition_operator) @operator + +(condition_body ["{" "}"] @punctuation.bracket) +(parenthesized_condition ["(" ")"] @punctuation.bracket) +(bracket_condition ["[" "]"] @punctuation.bracket) +(braced_condition ["{" "}"] @punctuation.bracket) + +(model) @keyword +(module "module" @keyword) +(schema "schema" @keyword) +(contents "contents" @keyword) +(relations "relations" @keyword) +(type_declaration "extend" @keyword) +(type_declaration "type" @keyword) +(definition "define" @keyword) + +(indirect_relation "from" @keyword.operator) +(conditional "with" @keyword.operator) +(condition_declaration "condition" @keyword.function) -(version) @constant.numeric (comment) @comment |