100 lines
1.8 KiB
Scheme
100 lines
1.8 KiB
Scheme
; Waltzing Template Highlights
|
|
|
|
; Comments
|
|
(template_comment) @comment
|
|
(html_comment) @comment
|
|
|
|
; Keywords - using @keyword for all
|
|
"@use" @keyword
|
|
"@import" @keyword
|
|
"@struct" @keyword
|
|
"@enum" @keyword
|
|
"@func" @keyword
|
|
"@if" @keyword
|
|
"@for" @keyword
|
|
"@match" @keyword
|
|
"@break" @keyword
|
|
"@continue" @keyword
|
|
"else" @keyword
|
|
"if" @keyword
|
|
"let" @keyword
|
|
"in" @keyword
|
|
"as" @keyword
|
|
"mut" @keyword
|
|
"safe" @keyword
|
|
|
|
; Types
|
|
(primitive_type) @type
|
|
(struct_definition (identifier) @type)
|
|
(enum_definition (identifier) @type)
|
|
(generic_params (identifier) @type)
|
|
(generic_type (rust_path) @type)
|
|
|
|
; Functions
|
|
(function_definition (identifier) @function)
|
|
(function_path) @function
|
|
(method_call (identifier) @function)
|
|
|
|
; Parameters
|
|
(parameter (identifier) @variable)
|
|
|
|
; Properties
|
|
(struct_field (identifier) @property)
|
|
(field_access (identifier) @property)
|
|
(field_pattern (identifier) @property)
|
|
|
|
; Constructors
|
|
(enum_variant (identifier) @constructor)
|
|
|
|
; Strings
|
|
(string_literal) @string
|
|
(char_literal) @string
|
|
(attribute_value) @string
|
|
|
|
; Numbers
|
|
(integer_literal) @number
|
|
(float_literal) @number
|
|
|
|
; Booleans
|
|
(boolean_literal) @boolean
|
|
|
|
; Operators
|
|
(binary_operator) @operator
|
|
(unary_operator) @operator
|
|
"=>" @operator
|
|
"=" @operator
|
|
|
|
; Punctuation
|
|
"{" @punctuation.bracket
|
|
"}" @punctuation.bracket
|
|
"(" @punctuation.bracket
|
|
")" @punctuation.bracket
|
|
"[" @punctuation.bracket
|
|
"]" @punctuation.bracket
|
|
"," @punctuation.delimiter
|
|
":" @punctuation.delimiter
|
|
";" @punctuation.delimiter
|
|
|
|
; Tags
|
|
(tag_name) @tag
|
|
"<@" @tag
|
|
"</@" @tag
|
|
|
|
; Attributes
|
|
(attribute_name) @attribute
|
|
(attribute (identifier) @attribute)
|
|
|
|
; Module paths
|
|
(use_statement (rust_path) @type)
|
|
(rust_path) @variable
|
|
|
|
; Escape
|
|
(escape_sequence) @escape
|
|
(escape_at) @escape
|
|
|
|
; Embedded
|
|
(language_name) @label
|
|
|
|
; Variables (fallback)
|
|
(identifier) @variable
|