feat(lua): add luap injections

This commit is contained in:
Amaan Qureshi 2023-03-03 05:35:20 -05:00
parent c9d7918901
commit 25f99a270a

View file

@ -19,4 +19,30 @@
;; highlight string as query if starts with `;; query`
((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
; string.match("123", "%d+")
(function_call
(dot_index_expression
field: (identifier) @_method
(#any-of? @_method "find" "match"))
arguments: (arguments (_) . (string content: _ @luap)))
(function_call
(dot_index_expression
field: (identifier) @_method
(#eq? @_method "gmatch" "gsub"))
arguments: (arguments (_) (string content: _ @luap)))
; ("123"):match("%d+")
(function_call
(method_index_expression
method: (identifier) @_method
(#any-of? @_method "find" "match"))
arguments: (arguments . (string content: _ @luap)))
(function_call
(method_index_expression
method: (identifier) @_method
(#any-of? @_method "gmatch" "gsub"))
arguments: (arguments (string content: _ @luap)))
(comment) @comment