2024-01-06 15:05:50 +09:00
|
|
|
((function_call
|
|
|
|
|
(index
|
|
|
|
|
(identifier) @_cdef_identifier)
|
|
|
|
|
(arguments
|
|
|
|
|
(string) @injection.content))
|
2021-03-08 22:35:21 +00:00
|
|
|
(#eq? @_cdef_identifier "cdef")
|
2023-05-03 19:07:59 +09:00
|
|
|
(#lua-match? @injection.content "^[\"']")
|
|
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! injection.language "c"))
|
2021-09-21 20:41:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((function_call
|
|
|
|
|
(index
|
|
|
|
|
(identifier) @_cdef_identifier)
|
|
|
|
|
(arguments
|
|
|
|
|
(string) @injection.content))
|
2021-09-21 20:41:17 +02:00
|
|
|
(#eq? @_cdef_identifier "cdef")
|
2023-05-03 19:07:59 +09:00
|
|
|
(#lua-match? @injection.content "^%[%[")
|
|
|
|
|
(#offset! @injection.content 0 2 0 -2)
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! injection.language "c"))
|
2021-03-12 11:21:46 -05:00
|
|
|
|
2023-08-19 19:28:45 +03:00
|
|
|
; string.format('...')
|
|
|
|
|
((function_call
|
|
|
|
|
(index
|
|
|
|
|
(identifier) @_base
|
|
|
|
|
key: (identifier) @_entry)
|
2024-01-06 15:05:50 +09:00
|
|
|
(arguments
|
|
|
|
|
.
|
|
|
|
|
(string) @injection.content))
|
|
|
|
|
(#eq? @_base "string")
|
|
|
|
|
(#eq? @_entry "format")
|
|
|
|
|
(#set! injection.language "printf"))
|
2023-08-19 19:28:45 +03:00
|
|
|
|
|
|
|
|
; ('...'):format()
|
|
|
|
|
((function_call
|
2024-01-06 15:05:50 +09:00
|
|
|
(method_index
|
2024-06-04 06:39:27 +00:00
|
|
|
(parenthesized_expression
|
|
|
|
|
(string) @printf)
|
2023-08-19 19:28:45 +03:00
|
|
|
key: (identifier) @_func))
|
2024-01-06 15:05:50 +09:00
|
|
|
(#eq? @_func "format")
|
|
|
|
|
(#set! injection.language "printf"))
|
2023-08-19 19:28:45 +03:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
((comment) @injection.content
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! injection.language "comment"))
|