nvim-treesitter/queries/v/injections.scm
Phạm Huy Hoàng d198a75e2c
Fixup format (#5934)
* fix(format): newline between top-level field defs

* fixup: newline between node and comment

* fixup: optimize pattern
2024-01-20 18:47:56 +09:00

23 lines
637 B
Scheme

((comment) @injection.content
(#set! injection.language "comment"))
; asm_statement if asm ever highlighted :)
; #include <...>
((hash_statement) @injection.content
(#set! injection.language "c"))
; regex for the methods defined in `re` module
((call_expression
name:
(selector_expression
field:
(reference_expression
(identifier) @_re))
arguments:
(argument_list
(argument
(literal
(raw_string_literal) @injection.content
(#offset! @injection.content 0 2 0 -1)))))
(#any-of? @_re "regex_base" "regex_opt" "compile_opt")
(#set! injection.language "regex"))