mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-20 20:30:05 -04:00
feat: add luau
This commit is contained in:
parent
2ce3c9080c
commit
cde306813d
8 changed files with 364 additions and 0 deletions
39
queries/luau/injections.scm
Normal file
39
queries/luau/injections.scm
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
((function_call
|
||||
name: [
|
||||
(identifier) @_cdef_identifier
|
||||
(_ _ (identifier) @_cdef_identifier)
|
||||
]
|
||||
arguments: (arguments (string content: _ @c)))
|
||||
(#eq? @_cdef_identifier "cdef"))
|
||||
|
||||
((comment) @luadoc
|
||||
(#lua-match? @luadoc "[-][-][-][%s]*@")
|
||||
(#offset! @luadoc 0 3 0 0))
|
||||
|
||||
; string.match("123", "%d+")
|
||||
(function_call
|
||||
(dot_index_expression
|
||||
field: (identifier) @_method
|
||||
(#any-of? @_method "find" "format" "match"))
|
||||
arguments: (arguments (_) . (string content: _ @luap)))
|
||||
|
||||
(function_call
|
||||
(dot_index_expression
|
||||
field: (identifier) @_method
|
||||
(#any-of? @_method "gmatch" "gsub"))
|
||||
arguments: (arguments (_) (string content: _ @luap)))
|
||||
|
||||
; ("123"):match("%d+")
|
||||
(function_call
|
||||
(method_index_expression
|
||||
method: (identifier) @_method
|
||||
(#any-of? @_method "find" "format" "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
|
||||
Loading…
Add table
Add a link
Reference in a new issue