Update all 5 tree-sitter query files to cover the full grammar: highlights.scm: - Add highlights for new literals (binary, octal, date, bool, typed_int, wstring, char) - Add highlights for block names (organization_block, function_block, function, data_block, type_definition) - Add highlights for return_statement, goto_statement, title_statement - Add highlights for bit_access, method_callee - Add compound assignment operators (+=, -=, *=, /=, etc.) indents.scm: - Add function, type_definition, data_block to @indent.begin - Add all var_*_declaration variants to @indent.begin - Add struct_type to @indent.begin - Add END_FUNCTION, END_TYPE, END_DATA_BLOCK, END_STRUCT to @indent.end folds.scm: - Add function, type_definition, data_block to @fold - Add all var_*_declaration variants to @fold - Add struct_type to @fold locals.scm: - Add function, type_definition, data_block as @local.scope - Add all var_*_declaration variants as @local.scope - Add struct_type as @local.scope - Add block name definitions (@definition.function, @definition.class, @definition.type) - Narrow @reference to prefixed_identifier only (reduces noise) tags.scm: - Add function, data_block, type_definition tags - Add FB call references - Add region_statement as @definition.module
143 lines
2.5 KiB
Scheme
143 lines
2.5 KiB
Scheme
; SCL highlights
|
|
|
|
; Comments
|
|
(line_comment) @comment
|
|
(block_comment) @comment
|
|
(c_style_comment) @comment
|
|
|
|
; Literals
|
|
(number) @number
|
|
(hex_number) @number
|
|
(binary_number) @number
|
|
(octal_number) @number
|
|
(time_value) @number
|
|
(date_literal) @number
|
|
(bool_literal) @constant.builtin
|
|
(typed_int_literal) @number
|
|
(wstring_literal) @string
|
|
(char_literal) @character
|
|
(string) @string
|
|
|
|
; Prefix
|
|
(prefix) @punctuation.special
|
|
|
|
; Variables and identifiers
|
|
(identifier) @variable
|
|
|
|
; FB instance calls
|
|
(fb_call
|
|
instance: (prefixed_identifier
|
|
(identifier) @type))
|
|
(fb_call
|
|
instance: (identifier) @type)
|
|
|
|
; FB parameter names
|
|
(fb_parameter
|
|
name: (identifier) @property)
|
|
|
|
; Function call names
|
|
(function_call
|
|
(identifier) @function)
|
|
(function_call
|
|
(string) @function)
|
|
|
|
; Method call names
|
|
(method_callee
|
|
(identifier) @function)
|
|
|
|
; Variable declarations
|
|
(var_item
|
|
name: (identifier) @variable)
|
|
|
|
; Type references
|
|
(type
|
|
(identifier) @type)
|
|
(type_builtin) @type.builtin
|
|
|
|
; Keywords and operators
|
|
(keyword) @keyword
|
|
(constant) @constant.builtin
|
|
(operator) @operator
|
|
|
|
; Block names
|
|
(organization_block
|
|
name: (string) @type)
|
|
(function_block
|
|
name: (string) @type)
|
|
(function
|
|
name: (string) @function)
|
|
(data_block
|
|
name: (string) @type)
|
|
(type_definition
|
|
name: (string) @type)
|
|
|
|
; Access
|
|
(field_access
|
|
"."
|
|
(identifier) @property)
|
|
(array_access) @property
|
|
(bit_access) @property
|
|
|
|
; Attributes
|
|
(attribute_list) @attribute
|
|
(attribute) @attribute
|
|
(attribute_value) @string
|
|
|
|
; Statements
|
|
(assignment) @operator
|
|
(binary_expression) @operator
|
|
(unary_expression) @operator
|
|
(chained_assignment) @operator
|
|
|
|
; Function/FB calls
|
|
(function_call) @function.call
|
|
(fb_call) @function.call
|
|
|
|
; Control flow
|
|
(if_statement) @conditional
|
|
(elsif_clause) @conditional
|
|
(else_clause) @conditional
|
|
(case_statement) @conditional
|
|
(case_item) @conditional
|
|
|
|
(for_statement) @repeat
|
|
(while_statement) @repeat
|
|
(repeat_statement) @repeat
|
|
|
|
(return_statement) @keyword
|
|
(goto_statement) @keyword
|
|
|
|
; Title
|
|
(title_statement) @comment
|
|
|
|
; Punctuation
|
|
";" @punctuation.delimiter
|
|
":" @punctuation.delimiter
|
|
"," @punctuation.delimiter
|
|
"(" @punctuation.bracket
|
|
")" @punctuation.bracket
|
|
"[" @punctuation.bracket
|
|
"]" @punctuation.bracket
|
|
"." @punctuation.delimiter
|
|
|
|
; Operators
|
|
":=" @operator
|
|
"=>" @operator
|
|
"+=" @operator
|
|
"-=" @operator
|
|
"*=" @operator
|
|
"/=" @operator
|
|
"&=" @operator
|
|
"|=" @operator
|
|
"^=" @operator
|
|
"=" @operator
|
|
"<>" @operator
|
|
"<" @operator
|
|
">" @operator
|
|
"<=" @operator
|
|
">=" @operator
|
|
"+" @operator
|
|
"-" @operator
|
|
"*" @operator
|
|
"/" @operator
|