mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 08:50:11 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
79
runtime/queries/bash/injections.scm
Normal file
79
runtime/queries/bash/injections.scm
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((regex) @injection.content
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
((heredoc_redirect
|
||||
(heredoc_body) @injection.content
|
||||
(heredoc_end) @injection.language)
|
||||
(#downcase! @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"))
|
||||
|
||||
((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"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue