mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 16:00:02 -04:00
Add tree-sitter parser and queries for the Concerto Modelling Language (.cto files) by the Accord Project. Concerto is a schema language for defining data models used in smart legal contracts and business networks. Queries: - highlights.scm — full syntax highlighting - folds.scm — code folding for declaration bodies and block comments - locals.scm — scope, definition, and reference tracking - indents.scm — auto-indentation for declaration bodies Grammar source: https://github.com/accordproject/concerto-tree-sitter Language spec: https://concerto.accordproject.org Note: Neovim does not yet detect .cto files natively. Users need to add: vim.filetype.add({ extension = { cto = 'concerto' } })
85 lines
1.7 KiB
Scheme
85 lines
1.7 KiB
Scheme
; Concerto Language - Locals Queries
|
|
; ===================================
|
|
; Scopes
|
|
; ------
|
|
; Each declaration body creates a new scope
|
|
(concept_declaration) @local.scope
|
|
|
|
(asset_declaration) @local.scope
|
|
|
|
(participant_declaration) @local.scope
|
|
|
|
(transaction_declaration) @local.scope
|
|
|
|
(event_declaration) @local.scope
|
|
|
|
(enum_declaration) @local.scope
|
|
|
|
(map_declaration) @local.scope
|
|
|
|
; Definitions
|
|
; -----------
|
|
; Type declarations define types
|
|
(concept_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(asset_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(participant_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(transaction_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(event_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(enum_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(scalar_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
(map_declaration
|
|
name: (type_identifier) @local.definition)
|
|
|
|
; Property declarations define properties
|
|
(string_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(boolean_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(datetime_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(integer_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(long_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(double_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(object_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(relationship_field
|
|
name: (identifier) @local.definition)
|
|
|
|
(enum_property
|
|
name: (identifier) @local.definition)
|
|
|
|
; References
|
|
; ----------
|
|
; Type references
|
|
(extends_clause
|
|
(type_identifier) @local.reference)
|
|
|
|
(object_field
|
|
type: (type_identifier) @local.reference)
|
|
|
|
(relationship_field
|
|
type: (type_identifier) @local.reference)
|