2023-08-04 16:20:12 +02:00
|
|
|
; Operators in command and conditional HLL expressions
|
|
|
|
(hll_comma_expression
|
|
|
|
"," @operator)
|
|
|
|
|
|
|
|
(hll_conditional_expression
|
|
|
|
[
|
|
|
|
"?"
|
|
|
|
":"
|
|
|
|
] @operator)
|
|
|
|
|
|
|
|
|
|
|
|
; Keywords, punctuation and operators
|
|
|
|
[
|
|
|
|
"enum"
|
|
|
|
"struct"
|
|
|
|
"union"
|
|
|
|
] @keyword.storage.type
|
|
|
|
|
|
|
|
"sizeof" @keyword.operator
|
|
|
|
|
|
|
|
[
|
|
|
|
"const"
|
|
|
|
"volatile"
|
|
|
|
] @keyword.storage.modifier
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
[
|
|
|
|
"="
|
|
|
|
"^^"
|
|
|
|
"||"
|
|
|
|
"&&"
|
|
|
|
"+"
|
|
|
|
"-"
|
|
|
|
"*"
|
|
|
|
"/"
|
|
|
|
"%"
|
|
|
|
"|"
|
|
|
|
"^"
|
|
|
|
"=="
|
|
|
|
"!="
|
|
|
|
">"
|
|
|
|
">="
|
|
|
|
"<="
|
|
|
|
"<"
|
|
|
|
"<<"
|
|
|
|
">>"
|
|
|
|
".."
|
|
|
|
"--"
|
|
|
|
"++"
|
|
|
|
"+"
|
|
|
|
"-"
|
|
|
|
"~"
|
|
|
|
"!"
|
|
|
|
"&"
|
|
|
|
"->"
|
|
|
|
"*"
|
2023-08-04 16:20:12 +02:00
|
|
|
"-="
|
|
|
|
"+="
|
|
|
|
"*="
|
|
|
|
"/="
|
|
|
|
"%="
|
|
|
|
"|="
|
|
|
|
"&="
|
|
|
|
"^="
|
|
|
|
">>="
|
|
|
|
"<<="
|
|
|
|
"--"
|
|
|
|
"++"
|
2023-06-08 01:01:25 +02:00
|
|
|
] @operator
|
|
|
|
|
|
|
|
[
|
2023-08-04 16:20:12 +02:00
|
|
|
"("
|
|
|
|
")"
|
|
|
|
"{"
|
|
|
|
"}"
|
|
|
|
"["
|
|
|
|
"]"
|
2023-06-08 01:01:25 +02:00
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
[
|
|
|
|
","
|
|
|
|
"."
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
|
|
|
|
; Strings and others literal types
|
|
|
|
(access_class) @constant.builtin
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
[
|
|
|
|
(address)
|
|
|
|
(bitmask)
|
|
|
|
(file_handle)
|
2023-08-04 16:20:12 +02:00
|
|
|
(integer)
|
|
|
|
(hll_number_literal)
|
|
|
|
] @constant.numeric.integer
|
2023-06-08 01:01:25 +02:00
|
|
|
|
|
|
|
[
|
|
|
|
(float)
|
2023-08-04 16:20:12 +02:00
|
|
|
(frequency)
|
2023-06-08 01:01:25 +02:00
|
|
|
(percentage)
|
2023-08-04 16:20:12 +02:00
|
|
|
(time)
|
2023-06-08 01:01:25 +02:00
|
|
|
] @constant.numeric.float
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
[
|
|
|
|
(string)
|
|
|
|
(hll_string_literal)
|
|
|
|
] @string
|
2023-06-08 01:01:25 +02:00
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
(hll_escape_sequence) @constant.character.escape
|
2023-06-08 01:01:25 +02:00
|
|
|
|
|
|
|
(path) @string.special.path
|
|
|
|
(symbol) @string.special.symbol
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
[
|
|
|
|
(character)
|
|
|
|
(hll_char_literal)
|
|
|
|
] @constant.character
|
|
|
|
|
|
|
|
|
|
|
|
; Types in HLL expressions
|
|
|
|
[
|
|
|
|
(hll_type_identifier)
|
|
|
|
(hll_type_descriptor)
|
|
|
|
] @type
|
|
|
|
|
|
|
|
(hll_type_qualifier) @keyword.storage.modifier
|
|
|
|
|
|
|
|
(hll_primitive_type) @type.builtin
|
|
|
|
|
|
|
|
|
|
|
|
; HLL call expressions
|
|
|
|
(hll_call_expression
|
|
|
|
function: (hll_field_expression
|
|
|
|
field: (hll_field_identifier) @function))
|
|
|
|
|
|
|
|
(hll_call_expression
|
|
|
|
function: (identifier) @function)
|
|
|
|
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
; Returns
|
|
|
|
(
|
|
|
|
(command_expression
|
|
|
|
command: (identifier) @keyword.return)
|
|
|
|
(#match? @keyword.return "^[eE][nN][dD]([dD][oO])?$")
|
|
|
|
)
|
|
|
|
(
|
|
|
|
(command_expression
|
|
|
|
command: (identifier) @keyword.return)
|
|
|
|
(#match? @keyword.return "^[rR][eE][tT][uU][rR][nN]$")
|
|
|
|
)
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
; Subroutine calls
|
|
|
|
(subroutine_call_expression
|
|
|
|
command: (identifier) @keyword
|
|
|
|
subroutine: (identifier) @function)
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
; Subroutine blocks
|
|
|
|
(subroutine_block
|
|
|
|
command: (identifier) @keyword
|
|
|
|
subroutine: (identifier) @function)
|
|
|
|
|
|
|
|
(labeled_expression
|
|
|
|
label: (identifier) @function
|
|
|
|
(block))
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
; Parameter declarations
|
|
|
|
(parameter_declaration
|
|
|
|
command: (identifier) @keyword
|
|
|
|
(identifier)? @constant.builtin
|
|
|
|
macro: (macro) @variable.parameter)
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
; Variables, constants and labels
|
2023-08-04 16:20:12 +02:00
|
|
|
(macro) @variable.builtin
|
|
|
|
(trace32_hll_variable) @variable.builtin
|
2023-06-08 01:01:25 +02:00
|
|
|
|
|
|
|
(
|
|
|
|
(command_expression
|
|
|
|
command: (identifier) @keyword
|
|
|
|
arguments: (argument_list . (identifier) @label))
|
|
|
|
(#match? @keyword "^[gG][oO][tT][oO]$")
|
|
|
|
)
|
|
|
|
(labeled_expression
|
|
|
|
label: (identifier) @label)
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
(option_expression
|
|
|
|
(identifier) @constant.builtin)
|
|
|
|
|
|
|
|
(format_expression
|
|
|
|
(identifier) @constant.builtin)
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
(
|
2023-08-04 16:20:12 +02:00
|
|
|
(argument_list (identifier) @constant.builtin)
|
|
|
|
(#match? @constant.builtin "^[%/][a-zA-Z][a-zA-Z0-9.]*$")
|
2023-06-08 01:01:25 +02:00
|
|
|
)
|
|
|
|
(argument_list
|
2023-08-04 16:20:12 +02:00
|
|
|
(identifier) @constant.builtin)
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
|
|
|
|
; Commands
|
|
|
|
(command_expression command: (identifier) @keyword)
|
|
|
|
(macro_definition command: (identifier) @keyword)
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
(call_expression
|
|
|
|
function: (identifier) @function.builtin)
|
|
|
|
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
; Control flow
|
|
|
|
(if_block
|
|
|
|
command: (identifier) @keyword.control.conditional.if)
|
|
|
|
(else_block
|
|
|
|
command: (identifier) @keyword.control.control.else)
|
|
|
|
|
|
|
|
(while_block
|
|
|
|
command: (identifier) @keyword.control.repeat.while)
|
|
|
|
(repeat_block
|
|
|
|
command: (identifier) @keyword.control.loop)
|
|
|
|
|
|
|
|
|
2023-08-04 16:20:12 +02:00
|
|
|
; HLL variables
|
|
|
|
(identifier) @variable
|
|
|
|
(hll_field_identifier) @variable.other.member
|
|
|
|
|
|
|
|
|
2023-06-08 01:01:25 +02:00
|
|
|
(comment) @comment
|