nvim-treesitter/queries/bash/injections.scm

36 lines
923 B
Scheme
Raw Normal View History

((comment) @injection.content
(#set! injection.language "comment"))
2022-11-26 14:27:21 +02:00
2023-08-23 13:02:41 +03:00
((regex) @injection.content
(#set! injection.language "regex"))
2023-08-11 15:24:48 +03:00
2023-08-23 13:02:41 +03:00
((heredoc_redirect
(heredoc_body) @injection.content
2023-08-23 13:02:41 +03:00
(heredoc_end) @injection.language)
(#downcase! @injection.language))
; printf 'format'
((command
name: (command_name) @_command
. argument: [(string) (raw_string)] @injection.content)
(#eq? @_command "printf")
(#set! injection.language "printf"))
; printf -v var 'format'
((command
name: (command_name) @_command
argument: (word) @_arg
. (_) . argument: [(string) (raw_string)] @injection.content)
(#eq? @_command "printf")
(#eq? @_arg "-v")
(#set! injection.language "printf"))
; printf -- 'format'
((command
name: (command_name) @_command
argument: (word) @_arg
. argument: [(string) (raw_string)] @injection.content)
(#eq? @_command "printf")
(#eq? @_arg "--")
(#set! injection.language "printf"))