2024-01-06 15:05:50 +09:00
|
|
|
; Inject markdown in docstrings
|
2023-05-03 19:07:59 +09:00
|
|
|
((string_literal) @injection.content
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
[
|
2022-12-14 03:06:08 -05:00
|
|
|
(module_definition)
|
|
|
|
|
(abstract_definition)
|
|
|
|
|
(struct_definition)
|
|
|
|
|
(function_definition)
|
|
|
|
|
(assignment)
|
2023-07-05 18:14:04 -05:00
|
|
|
(const_statement)
|
2022-12-14 03:06:08 -05:00
|
|
|
]
|
2024-01-06 15:05:50 +09:00
|
|
|
(#lua-match? @injection.content "^\"\"\"")
|
|
|
|
|
(#set! injection.language "markdown")
|
|
|
|
|
(#offset! @injection.content 0 3 0 -3))
|
2021-03-12 11:21:46 -05:00
|
|
|
|
2023-05-03 19:07:59 +09:00
|
|
|
([
|
2022-04-15 10:30:46 +02:00
|
|
|
(line_comment)
|
2022-01-13 17:35:20 +01:00
|
|
|
(block_comment)
|
2024-01-06 15:05:50 +09:00
|
|
|
] @injection.content
|
|
|
|
|
(#set! injection.language "comment"))
|
2022-11-26 14:27:21 +02:00
|
|
|
|
|
|
|
|
((prefixed_string_literal
|
2024-01-06 15:05:50 +09:00
|
|
|
prefix: (identifier) @_prefix) @injection.content
|
|
|
|
|
(#eq? @_prefix "r")
|
|
|
|
|
(#set! injection.language "regex")
|
|
|
|
|
(#offset! @injection.content 0 2 0 -1))
|