2021-01-06 14:25:43 -05:00
|
|
|
(macro_invocation
|
2024-03-21 20:44:35 +09:00
|
|
|
macro: [
|
|
|
|
|
(scoped_identifier
|
|
|
|
|
name: (_) @_macro_name)
|
|
|
|
|
(identifier) @_macro_name
|
|
|
|
|
]
|
2024-01-06 15:05:50 +09:00
|
|
|
(token_tree) @injection.content
|
2026-01-24 22:21:27 +01:00
|
|
|
(#not-any-of? @_macro_name "slint" "html" "json" "xml")
|
2024-01-24 12:11:12 +09:00
|
|
|
(#set! injection.language "rust")
|
|
|
|
|
(#set! injection.include-children))
|
2021-01-06 14:25:43 -05:00
|
|
|
|
2024-02-09 14:46:57 +01:00
|
|
|
(macro_invocation
|
2024-03-21 20:44:35 +09:00
|
|
|
macro: [
|
|
|
|
|
(scoped_identifier
|
2025-03-08 18:49:06 +01:00
|
|
|
name: (_) @injection.language)
|
|
|
|
|
(identifier) @injection.language
|
2024-03-21 20:44:35 +09:00
|
|
|
]
|
2024-02-09 14:46:57 +01:00
|
|
|
(token_tree) @injection.content
|
2026-01-24 22:21:27 +01:00
|
|
|
(#any-of? @injection.language "slint" "html" "json" "xml")
|
2024-02-09 14:46:57 +01:00
|
|
|
(#offset! @injection.content 0 1 0 -1)
|
|
|
|
|
(#set! injection.include-children))
|
|
|
|
|
|
2021-01-06 14:25:43 -05:00
|
|
|
(macro_definition
|
|
|
|
|
(macro_rule
|
2024-01-06 15:05:50 +09:00
|
|
|
left: (token_tree_pattern) @injection.content
|
2023-05-03 19:07:59 +09:00
|
|
|
(#set! injection.language "rust")))
|
2021-03-12 11:21:46 -05:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
(macro_definition
|
|
|
|
|
(macro_rule
|
|
|
|
|
right: (token_tree) @injection.content
|
|
|
|
|
(#set! injection.language "rust")))
|
|
|
|
|
|
|
|
|
|
([
|
2021-03-12 11:21:46 -05:00
|
|
|
(line_comment)
|
|
|
|
|
(block_comment)
|
2023-05-03 19:07:59 +09:00
|
|
|
] @injection.content
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! injection.language "comment"))
|
2021-06-20 21:20:50 +03:00
|
|
|
|
2021-12-13 20:59:19 +01:00
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (scoped_identifier
|
|
|
|
|
path: (identifier) @_regex
|
2025-03-08 20:06:05 +01:00
|
|
|
(#any-of? @_regex "Regex" "RegexBuilder")
|
2024-03-21 20:44:35 +09:00
|
|
|
name: (identifier) @_new
|
|
|
|
|
(#eq? @_new "new"))
|
|
|
|
|
arguments: (arguments
|
2024-10-23 21:18:39 -07:00
|
|
|
(raw_string_literal
|
|
|
|
|
(string_content) @injection.content))
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! injection.language "regex"))
|
2021-12-13 20:59:19 +01:00
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (scoped_identifier
|
|
|
|
|
path: (scoped_identifier
|
|
|
|
|
(identifier) @_regex
|
2025-03-08 20:06:05 +01:00
|
|
|
(#any-of? @_regex "Regex" "RegexBuilder") .)
|
2024-03-21 20:44:35 +09:00
|
|
|
name: (identifier) @_new
|
|
|
|
|
(#eq? @_new "new"))
|
|
|
|
|
arguments: (arguments
|
2024-10-23 21:18:39 -07:00
|
|
|
(raw_string_literal
|
|
|
|
|
(string_content) @injection.content))
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! injection.language "regex"))
|
2023-08-22 02:10:29 -04:00
|
|
|
|
2024-02-25 02:14:48 -05:00
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (scoped_identifier
|
|
|
|
|
path: (identifier) @_regex
|
|
|
|
|
(#any-of? @_regex "RegexSet" "RegexSetBuilder")
|
|
|
|
|
name: (identifier) @_new
|
|
|
|
|
(#eq? @_new "new"))
|
|
|
|
|
arguments: (arguments
|
|
|
|
|
(array_expression
|
2024-10-23 21:18:39 -07:00
|
|
|
(raw_string_literal
|
|
|
|
|
(string_content) @injection.content)))
|
2024-02-25 02:14:48 -05:00
|
|
|
(#set! injection.language "regex"))
|
|
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (scoped_identifier
|
|
|
|
|
path: (scoped_identifier
|
|
|
|
|
(identifier) @_regex
|
|
|
|
|
(#any-of? @_regex "RegexSet" "RegexSetBuilder") .)
|
|
|
|
|
name: (identifier) @_new
|
|
|
|
|
(#eq? @_new "new"))
|
|
|
|
|
arguments: (arguments
|
|
|
|
|
(array_expression
|
2024-10-23 21:18:39 -07:00
|
|
|
(raw_string_literal
|
|
|
|
|
(string_content) @injection.content)))
|
2024-02-25 02:14:48 -05:00
|
|
|
(#set! injection.language "regex"))
|
|
|
|
|
|
2023-08-22 02:10:29 -04:00
|
|
|
((block_comment) @injection.content
|
2023-08-25 05:02:58 -04:00
|
|
|
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
2023-08-22 02:10:29 -04:00
|
|
|
(#set! injection.language "re2c"))
|