slang-ts-mode: pattern match scalar/vector types

This commit is contained in:
Janis 2024-12-30 15:41:18 +01:00
parent e25e208a8e
commit fd1f1033fa

View file

@ -1653,7 +1653,19 @@ delimiters < and >'s."
:language 'slang :language 'slang
:feature 'keyword :feature 'keyword
`([,@slang-ts-mode--keywords] @font-lock-keyword-face) `([,@slang-ts-mode--keywords] @font-lock-keyword-face)
;; ([,@slang-ts-mode--locations] @font-lock-builtin-face)
:language 'slang
:feature 'type
`(
((call_expression function: (identifier) @font-lock-type-face)
(:match ,(rx bos
(and (or "bool" "int" "uint" "float")
(or
(? (any "1" "2" "3" "4"))
(? (and (any "1" "2" "3" "4") "x" (any "1" "2" "3" "4")))))
eos) @font-lock-type-face))
((call_expression function: (identifier) @font-lock-function-call-face))
(type_identifier) @font-lock-type-face)
:language 'slang :language 'slang
:feature 'definition :feature 'definition
@ -1668,7 +1680,9 @@ delimiters < and >'s."
:language 'slang :language 'slang
:feature 'function :feature 'function
'((call_expression function: (identifier) @font-lock-function-call-face)) '((call_expression function: (identifier) @font-lock-function-call-face)
(call_expression function: (_ field: (field_identifier) @font-lock-function-call-face))
)
:language 'slang :language 'slang
:feature 'string :feature 'string
@ -1696,10 +1710,6 @@ delimiters < and >'s."
:feature 'number :feature 'number
'(((number_literal) @font-lock-number-face)) '(((number_literal) @font-lock-number-face))
:language 'slang
:feature 'type
'(((type_identifier) @font-lock-type-face))
:language 'slang :language 'slang
:feature 'property :feature 'property
'(((field_identifier) @font-lock-property-use-face)) '(((field_identifier) @font-lock-property-use-face))