mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 18:00:07 -04:00
fix(julia): refactor some operators and punctuation
This commit is contained in:
parent
62ca703a0b
commit
9c7fa77f14
1 changed files with 21 additions and 16 deletions
|
|
@ -19,10 +19,9 @@
|
||||||
(identifier) @field .)
|
(identifier) @field .)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Function names
|
;;; Function names
|
||||||
|
|
||||||
;; definitions
|
;; Definitions
|
||||||
|
|
||||||
(function_definition
|
(function_definition
|
||||||
name: (identifier) @function)
|
name: (identifier) @function)
|
||||||
|
|
@ -57,9 +56,7 @@
|
||||||
(identifier) @parameter)
|
(identifier) @parameter)
|
||||||
|
|
||||||
(typed_parameter
|
(typed_parameter
|
||||||
parameter: (identifier) @parameter
|
parameter: (identifier)? @parameter
|
||||||
type: (_) @type)
|
|
||||||
(typed_parameter
|
|
||||||
type: (_) @type)
|
type: (_) @type)
|
||||||
|
|
||||||
(function_expression
|
(function_expression
|
||||||
|
|
@ -111,9 +108,9 @@
|
||||||
"local"
|
"local"
|
||||||
"macro"
|
"macro"
|
||||||
"struct"
|
"struct"
|
||||||
|
"end"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
"end" @keyword
|
|
||||||
|
|
||||||
(compound_statement
|
(compound_statement
|
||||||
["begin" "end"] @keyword)
|
["begin" "end"] @keyword)
|
||||||
|
|
@ -125,9 +122,9 @@
|
||||||
(if_statement
|
(if_statement
|
||||||
["if" "end"] @conditional)
|
["if" "end"] @conditional)
|
||||||
(elseif_clause
|
(elseif_clause
|
||||||
["elseif"] @conditional)
|
"elseif" @conditional)
|
||||||
(else_clause
|
(else_clause
|
||||||
["else"] @conditional)
|
"else" @conditional)
|
||||||
(if_clause
|
(if_clause
|
||||||
"if" @conditional) ; `if` clause in comprehensions
|
"if" @conditional) ; `if` clause in comprehensions
|
||||||
(ternary_expression
|
(ternary_expression
|
||||||
|
|
@ -167,8 +164,6 @@
|
||||||
["function" "end"] @keyword.function)
|
["function" "end"] @keyword.function)
|
||||||
(do_clause
|
(do_clause
|
||||||
["do" "end"] @keyword.function)
|
["do" "end"] @keyword.function)
|
||||||
(function_expression
|
|
||||||
"->" @keyword.function)
|
|
||||||
(return_statement
|
(return_statement
|
||||||
"return" @keyword.return)
|
"return" @keyword.return)
|
||||||
|
|
||||||
|
|
@ -180,25 +175,35 @@
|
||||||
|
|
||||||
;;; Operators & Punctuation
|
;;; Operators & Punctuation
|
||||||
|
|
||||||
(operator) @operator
|
[
|
||||||
|
"="
|
||||||
|
"∈"
|
||||||
|
(operator)
|
||||||
|
] @operator
|
||||||
|
|
||||||
(adjoint_expression "'" @operator)
|
(adjoint_expression "'" @operator)
|
||||||
(range_expression ":" @operator)
|
(range_expression ":" @operator)
|
||||||
(slurp_parameter "..." @operator)
|
|
||||||
(splat_expression "..." @operator)
|
|
||||||
|
|
||||||
((operator) @keyword.operator
|
((operator) @keyword.operator
|
||||||
(#any-of? @keyword.operator "in" "isa"))
|
(#any-of? @keyword.operator "in" "isa"))
|
||||||
|
|
||||||
(for_binding "in" @keyword.operator)
|
(for_binding "in" @keyword.operator)
|
||||||
(for_binding ["=" "∈"] @operator)
|
|
||||||
|
|
||||||
(where_clause "where" @keyword.operator)
|
(where_clause "where" @keyword.operator)
|
||||||
(where_expression "where" @keyword.operator)
|
(where_expression "where" @keyword.operator)
|
||||||
|
|
||||||
["." "::"] @operator
|
[
|
||||||
|
","
|
||||||
|
"."
|
||||||
|
";"
|
||||||
|
"::"
|
||||||
|
"->"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"..."
|
||||||
|
] @punctuation.special
|
||||||
|
|
||||||
["," ";"] @punctuation.delimiter
|
|
||||||
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue