aboutsummaryrefslogtreecommitdiffstats
path: root/queries/luau
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2023-12-21 15:31:40 -0800
committerChristian Clason <c.clason@uni-graz.at>2023-12-23 22:26:02 +0100
commit92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76 (patch)
tree6f40e1239ad4e37c7ec6646f139c2027abedd1d9 /queries/luau
parentUpdate parsers: elm, wing (diff)
downloadnvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.tar
nvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.tar.gz
nvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.tar.bz2
nvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.tar.lz
nvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.tar.xz
nvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.tar.zst
nvim-treesitter-92572c0dfd53b0e74bf436ef968ecc5b5a7e2b76.zip
feat: more `@string.regex` highlights
Diffstat (limited to 'queries/luau')
-rw-r--r--queries/luau/highlights.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/queries/luau/highlights.scm b/queries/luau/highlights.scm
index 7a6bc2e35..a175276a7 100644
--- a/queries/luau/highlights.scm
+++ b/queries/luau/highlights.scm
@@ -246,3 +246,29 @@
((comment) @comment.documentation
(#lua-match? @comment.documentation "^[-][-](%s?)@"))
+
+; string.match("123", "%d+")
+(function_call
+ (dot_index_expression
+ field: (identifier) @_method
+ (#any-of? @_method "find" "format" "match"))
+ arguments: (arguments (_) . (string content: _ @string.regex)))
+
+(function_call
+ (dot_index_expression
+ field: (identifier) @_method
+ (#any-of? @_method "gmatch" "gsub"))
+ arguments: (arguments (_) (string content: _ @string.regex)))
+
+; ("123"):match("%d+")
+(function_call
+ (method_index_expression
+ method: (identifier) @_method
+ (#any-of? @_method "find" "format" "match"))
+ arguments: (arguments . (string content: _ @string.regex)))
+
+(function_call
+ (method_index_expression
+ method: (identifier) @_method
+ (#any-of? @_method "gmatch" "gsub"))
+ arguments: (arguments (string content: _ @string.regex)))