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 2cbac5115b
commit c698c15eb2
2 changed files with 28 additions and 0 deletions

View file

@ -24,6 +24,13 @@
; Declarations {{{
(identifier) @variable
(module
type: (identifier) @module)
(module
(property
field: (identifier) @variable.member))
; }}}
; 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
)