Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/lua/injections.scm')
-rw-r--r--runtime/queries/lua/injections.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/runtime/queries/lua/injections.scm b/runtime/queries/lua/injections.scm
index fca94d58..8f8c174a 100644
--- a/runtime/queries/lua/injections.scm
+++ b/runtime/queries/lua/injections.scm
@@ -1,3 +1,29 @@
((comment) @injection.content
(#set! injection.language "comment")
(#set! injection.include-children))
+
+; string.match("123", "%d+")
+(function_call
+ (dot_index_expression
+ field: (identifier) @_method
+ (#any-of? @_method "find" "match" "gmatch" "gsub"))
+ arguments: (arguments
+ .
+ (_)
+ .
+ (string
+ content: (string_content) @injection.content
+ (#set! injection.language "luap")
+ (#set! injection.include-children))))
+
+; ("123"):match("%d+")
+(function_call
+ (method_index_expression
+ method: (identifier) @_method
+ (#any-of? @_method "find" "match" "gmatch" "gsub"))
+ arguments: (arguments
+ .
+ (string
+ content: (string_content) @injection.content
+ (#set! injection.language "luap")
+ (#set! injection.include-children))))