feat: more @string.regex highlights

This commit is contained in:
Riley Bruins 2023-12-21 15:31:40 -08:00 committed by Christian Clason
parent c4da794564
commit 92572c0dfd
3 changed files with 62 additions and 0 deletions

View file

@ -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)))