mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 22:10:01 -04:00
feat(injections): add printf format strings
This commit is contained in:
parent
2160b26453
commit
947c43052c
14 changed files with 184 additions and 20 deletions
|
|
@ -19,6 +19,20 @@
|
|||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "regex")))
|
||||
|
||||
|
||||
((comment) @injection.content
|
||||
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
||||
(#set! injection.language "re2c"))
|
||||
|
||||
((call_expression
|
||||
function: (selector_expression field: (field_identifier) @_method)
|
||||
arguments: (argument_list . (interpreted_string_literal) @injection.content))
|
||||
(#any-of? @_method "Printf" "Sprintf" "Fatalf" "Scanf")
|
||||
(#set! injection.language "printf"))
|
||||
|
||||
((call_expression
|
||||
function: (selector_expression field: (field_identifier) @_method)
|
||||
arguments: (argument_list (_) . (interpreted_string_literal) @injection.content))
|
||||
(#eq? @_method "Fprintf")
|
||||
(#set! injection.language "printf"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue