fix(julia): treat :: as operator in type contexts

This patch captures `::` as `@operator` within
`(unary_typed_expression)` and `(typed_expression)`. These should be the
only two cases that the parser can emit when encountering `::` in the
source, but as a fallback it is still captured as `@punctuation` in all
other cases.

The reasons for capturing `::` as an operator are i) the close relation
with the other type-operators `<:` and `>:` and ii) the fact that it is
treated as an operator by the Julia parser, just like `<:` and `>:`.
This commit is contained in:
Fredrik Ekre 2024-11-22 16:51:33 +01:00 committed by Christian Clason
parent 94853ae932
commit 3f377c0739
2 changed files with 11 additions and 3 deletions

View file

@ -281,6 +281,14 @@
"::"
] @punctuation.delimiter
; Treat `::` as operator in type contexts, see
; https://github.com/nvim-treesitter/nvim-treesitter/pull/7392
(typed_expression
"::" @operator)
(unary_typed_expression
"::" @operator)
[
"("
")"