Add modules highlighting

Still debating whether modules should be highlighted as namespaces or as
function calls.
This commit is contained in:
Bruno BELANYI 2024-04-08 21:28:18 +01:00
parent 3e4879a593
commit a9ec312792
2 changed files with 28 additions and 0 deletions

View file

@ -24,6 +24,13 @@
; Declarations {{{ ; Declarations {{{
(identifier) @variable (identifier) @variable
(module
type: (identifier) @module)
(module
(property
field: (identifier) @variable.member))
; }}} ; }}}
; vim: sw=2 foldmethod=marker ; vim: sw=2 foldmethod=marker

21
test/highlight/modules.bp Normal file
View file

@ -0,0 +1,21 @@
foo {}
// <- module
foo ()
// <- module
foo {
// <- module
field: 12,
// <- variable.member
another_field: 27,
// <- variable.member
}
foo (
// <- module
field = 42,
// <- variable.member
done = false,
// <- variable.member
)