138 lines
3.0 KiB
Scheme
138 lines
3.0 KiB
Scheme
((comment) @injection.content
|
|
(#set! injection.language "comment"))
|
|
|
|
((regex) @injection.content
|
|
(#set! injection.language "regex"))
|
|
|
|
(heredoc_redirect
|
|
(heredoc_body) @injection.content
|
|
(heredoc_end) @injection.language)
|
|
|
|
; printf 'format'
|
|
((command
|
|
name: (command_name) @_command
|
|
.
|
|
argument: [
|
|
(string) @injection.content
|
|
(concatenation
|
|
(string) @injection.content)
|
|
(raw_string) @injection.content
|
|
(concatenation
|
|
(raw_string) @injection.content)
|
|
])
|
|
(#eq? @_command "printf")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "printf"))
|
|
|
|
; printf -v var 'format'
|
|
((command
|
|
name: (command_name) @_command
|
|
argument: (word) @_arg
|
|
.
|
|
(_)
|
|
.
|
|
argument: [
|
|
(string) @injection.content
|
|
(concatenation
|
|
(string) @injection.content)
|
|
(raw_string) @injection.content
|
|
(concatenation
|
|
(raw_string) @injection.content)
|
|
])
|
|
(#eq? @_command "printf")
|
|
(#eq? @_arg "-v")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "printf"))
|
|
|
|
; printf -- 'format'
|
|
((command
|
|
name: (command_name) @_command
|
|
argument: (word) @_arg
|
|
.
|
|
argument: [
|
|
(string) @injection.content
|
|
(concatenation
|
|
(string) @injection.content)
|
|
(raw_string) @injection.content
|
|
(concatenation
|
|
(raw_string) @injection.content)
|
|
])
|
|
(#eq? @_command "printf")
|
|
(#eq? @_arg "--")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "printf"))
|
|
|
|
; jq 'filter'
|
|
((command
|
|
name: (command_name) @_command
|
|
.
|
|
argument: [
|
|
(string)
|
|
(raw_string)
|
|
] @injection.content)
|
|
(#eq? @_command "jq")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "jq"))
|
|
|
|
; jq -r 'filter'
|
|
((command
|
|
name: (command_name) @_command
|
|
argument: (word) @_arg
|
|
.
|
|
argument: [
|
|
(string)
|
|
(raw_string)
|
|
] @injection.content)
|
|
(#eq? @_command "jq")
|
|
(#any-of? @_arg "-c" "-e" "-r" "-M" "-R" "-s" "-n")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "jq"))
|
|
|
|
; jq --arg name value 'filter'
|
|
((command
|
|
name: (command_name) @_command
|
|
argument: (word) @_arg
|
|
.
|
|
(_)
|
|
.
|
|
(_)
|
|
.
|
|
argument: [
|
|
(string)
|
|
(raw_string)
|
|
] @injection.content)
|
|
(#eq? @_command "jq")
|
|
(#any-of? @_arg "--arg" "--argjson" "--slurpfile" "--rawfile")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "jq"))
|
|
|
|
((command
|
|
name: (command_name) @_command
|
|
.
|
|
argument: [
|
|
(string)
|
|
(raw_string)
|
|
] @injection.content)
|
|
(#eq? @_command "bind")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.language "readline"))
|
|
|
|
((command
|
|
name: (command_name) @_command
|
|
.
|
|
argument: [
|
|
(string)
|
|
(raw_string)
|
|
] @injection.content)
|
|
(#eq? @_command "trap")
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
(#set! injection.include-children)
|
|
(#set! injection.self))
|