Add literals highlighting

This commit is contained in:
Bruno BELANYI 2024-04-08 20:47:55 +01:00
parent e2aa90e0f4
commit b9fd34c084
2 changed files with 32 additions and 0 deletions

View file

@ -3,4 +3,17 @@
(block_comment)
] @comment
; Literal {{{
(boolean_literal) @boolean
(integer_literal) @number
[
(raw_string_literal)
(interpreted_string_literal)
] @string
(escape_sequence) @string.escape
; }}}
; vim: sw=2 foldmethod=marker

View file

@ -0,0 +1,19 @@
foo = 0
// ^ number
foo = -42
// ^ number
foo = true
// ^ boolean
foo = "foo\nbar"
// ^ string
// ^ string.escape
// ^ string.escape
// ^ string
// ^ string
foo = `baz`
// ^ string
// ^ string