@ -1,3 +1,28 @@
; 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
[
[
"="
"="
"^^"
"^^"
@ -28,6 +53,18 @@
"&"
"&"
"->"
"->"
"*"
"*"
"-="
"+="
"*="
"/="
"%="
"|="
"&="
"^="
">>="
"<<="
"--"
"++"
] @operator
] @operator
[
[
@ -42,35 +79,63 @@
[
[
","
","
"."
"."
";"
] @punctuation . delimiter
] @punctuation . delimiter
; Constants
; Strings and others literal types
( access_class ) @constant . builtin
[
[
( access_class )
( address )
( address )
( bitmask )
( bitmask )
( file_handle )
( file_handle )
( frequency )
( integer )
( time )
( hll_number_literal )
] @constant . builtin
] @constant . numeric. integer
[
[
( float )
( float )
( frequency )
( percentage )
( percentage )
( time )
] @constant . numeric . float
] @constant . numeric . float
( integer ) @constant . numeric . integer
[
( string )
( character ) @constant . character
( hll_string_literal )
] @string
; Strings
( hll_escape_sequence ) @constant . character . escape
( string ) @string
( path ) @string . special . path
( path ) @string . special . path
( symbol ) @string . special . symbol
( symbol ) @string . special . symbol
[
( 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 )
; Returns
; Returns
(
(
( command_expression
( command_expression
@ -83,11 +148,13 @@
( # match? @keyword . return "^[rR][eE][tT][uU][rR][nN]$" )
( # match? @keyword . return "^[rR][eE][tT][uU][rR][nN]$" )
)
)
; Subroutine calls
; Subroutine calls
( subroutine_call_expression
( subroutine_call_expression
command: ( identifier ) @keyword
command: ( identifier ) @keyword
subroutine: ( identifier ) @function )
subroutine: ( identifier ) @function )
; Subroutine blocks
; Subroutine blocks
( subroutine_block
( subroutine_block
command: ( identifier ) @keyword
command: ( identifier ) @keyword
@ -97,15 +164,17 @@
label: ( identifier ) @function
label: ( identifier ) @function
( block ) )
( block ) )
; Parameter declarations
; Parameter declarations
( parameter_declaration
( parameter_declaration
command: ( identifier ) @keyword
command: ( identifier ) @keyword
( identifier ) ? @constant . builtin
( identifier ) ? @constant . builtin
macro: ( macro ) @variable . parameter )
macro: ( macro ) @variable . parameter )
; Variables, constants and labels
; Variables, constants and labels
( macro ) @variable
( macro ) @variable . builtin
( internal_c_variable) @variable
( trace32_hll_variable) @variable . builtin
(
(
( command_expression
( command_expression
@ -116,17 +185,28 @@
( labeled_expression
( labeled_expression
label: ( identifier ) @label )
label: ( identifier ) @label )
( option_expression
( identifier ) @constant . builtin )
( format_expression
( identifier ) @constant . builtin )
(
(
( argument_list ( identifier ) @constant . builtin )
( argument_list ( identifier ) @constant . builtin )
( # match? @constant . builtin "^[%/][a-zA-Z][a-zA-Z0-9.]*$" )
( # match? @constant . builtin "^[%/][a-zA-Z][a-zA-Z0-9.]*$" )
)
)
( argument_list
( argument_list
( identifier ) @constant )
( identifier ) @constant . builtin )
; Commands
; Commands
( command_expression command: ( identifier ) @keyword )
( command_expression command: ( identifier ) @keyword )
( macro_definition command: ( identifier ) @keyword )
( macro_definition command: ( identifier ) @keyword )
( call_expression
function: ( identifier ) @function . builtin )
; Control flow
; Control flow
( if_block
( if_block
command: ( identifier ) @keyword . control . conditional . if )
command: ( identifier ) @keyword . control . conditional . if )
@ -138,8 +218,10 @@
( repeat_block
( repeat_block
command: ( identifier ) @keyword . control . loop )
command: ( identifier ) @keyword . control . loop )
( call_expression
function: ( identifier ) @function )
( type_identifier ) @type
; HLL variables
( identifier ) @variable
( hll_field_identifier ) @variable . other . member
( comment ) @comment
( comment ) @comment