mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(polar): add initial Polar parser and queries
This commit is contained in:
parent
2ba5ec1846
commit
e9558243f3
3 changed files with 86 additions and 0 deletions
2
SUPPORTED_LANGUAGES.md
generated
2
SUPPORTED_LANGUAGES.md
generated
|
|
@ -211,6 +211,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka
|
|||
[po](https://github.com/tree-sitter-grammars/tree-sitter-po) | unstable | `HF J ` | @amaanq
|
||||
[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | unstable | `H ` | @RabbiVeesh, @LeoNerd
|
||||
[poe_filter](https://github.com/tree-sitter-grammars/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ ` | @ObserverOfTime
|
||||
[polar](https://github.com/osohq/tree-sitter-polar)[^polar] | unstable | `H ` | @arusahni
|
||||
[pony](https://github.com/tree-sitter-grammars/tree-sitter-pony) | unstable | `HFIJL` | @amaanq, @mfelsche
|
||||
[powershell](https://github.com/airbus-cert/tree-sitter-powershell) | unstable | `HFIJL` | @L2jLiga
|
||||
[printf](https://github.com/tree-sitter-grammars/tree-sitter-printf) | unstable | `H ` | @ObserverOfTime
|
||||
|
|
@ -356,6 +357,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka
|
|||
[^php]: PHP with embedded HTML
|
||||
[^php_only]: PHP without embedded HTML
|
||||
[^poe_filter]: Path of Exile item filter
|
||||
[^polar]: Polar Authorization Language for Oso Cloud
|
||||
[^properties]: Java properties files
|
||||
[^query]: Tree-sitter query language
|
||||
[^sflog]: Salesforce debug log
|
||||
|
|
|
|||
|
|
@ -1640,6 +1640,15 @@ return {
|
|||
readme_note = 'Path of Exile item filter',
|
||||
tier = 2,
|
||||
},
|
||||
polar = {
|
||||
install_info = {
|
||||
url = 'https://github.com/osohq/tree-sitter-polar',
|
||||
revision = 'b44da606fd7e095f2a17bfea49085635f2a6c3fb',
|
||||
},
|
||||
maintainers = { '@arusahni' },
|
||||
tier = 2,
|
||||
readme_note = 'Polar Authorization Language for Oso Cloud',
|
||||
},
|
||||
pony = {
|
||||
install_info = {
|
||||
revision = '73ff874ae4c9e9b45462673cbc0a1e350e2522a7',
|
||||
|
|
|
|||
75
runtime/queries/polar/highlights.scm
Normal file
75
runtime/queries/polar/highlights.scm
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
; highlights.scm
|
||||
[
|
||||
"cut"
|
||||
"or"
|
||||
"debug"
|
||||
"print"
|
||||
"in"
|
||||
"forall"
|
||||
"if"
|
||||
"and"
|
||||
"of"
|
||||
"not"
|
||||
"matches"
|
||||
"type"
|
||||
"on"
|
||||
"global"
|
||||
] @keyword
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
(namespaced_identifier) @variable
|
||||
|
||||
(string) @string
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
(number) @number
|
||||
|
||||
(resource_block
|
||||
name: (namespaced_identifier) @type.definition)
|
||||
|
||||
(resource_type) @constructor
|
||||
|
||||
(operator) @operator
|
||||
|
||||
(rule_functor
|
||||
name: (namespaced_identifier) @function)
|
||||
|
||||
(rule_functor
|
||||
parameters: (_)*
|
||||
(specializer
|
||||
name: (namespaced_identifier) @variable.parameter))
|
||||
|
||||
(rule_functor
|
||||
parameters: (_)*
|
||||
(specializer
|
||||
type: (namespaced_identifier) @type))
|
||||
|
||||
(rule_expression_functor
|
||||
name: (namespaced_identifier) @function.call)
|
||||
|
||||
(rule_expression_functor
|
||||
parameters: (identifier) @variable)
|
||||
|
||||
(dict_field
|
||||
value: (namespaced_identifier) @type)
|
||||
|
||||
(object_literal
|
||||
name: (namespaced_identifier) @type)
|
||||
|
||||
(comment) @comment
|
||||
|
||||
; test stuff
|
||||
(test_header
|
||||
"test" @module)
|
||||
|
||||
(test_header
|
||||
name: (string) @label)
|
||||
|
||||
(test_setup
|
||||
"setup" @module)
|
||||
|
||||
(test_setup
|
||||
(test_fact
|
||||
name: (namespaced_identifier) @function))
|
||||
Loading…
Add table
Add a link
Reference in a new issue