From bd527c84e64f8a30bb1ae8c4dd634d6deba20825 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 15 Jun 2022 15:25:11 -0500 Subject: erlang: highlight unary '#' as punctuation.bracket The '#' character may either be interpreted as a map when used like so: %% Example 1 #{a => b} Or as an operator which updates an existing map when the left-hand side is an expression: %% Example 2 MyMap#{a => b} This commit changes the highlight to `punctuation.bracket` when used as a character in a literal map (example 1) and keeps the `operator` highlight when used for updating (example 2). --- runtime/queries/erlang/highlights.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/queries/erlang/highlights.scm b/runtime/queries/erlang/highlights.scm index 94f1e9f5..ce84697b 100644 --- a/runtime/queries/erlang/highlights.scm +++ b/runtime/queries/erlang/highlights.scm @@ -92,7 +92,7 @@ (binary_operator operator: _ @operator) (unary_operator operator: _ @operator) -["/" ":" "#" "->"] @operator +["/" ":" "->"] @operator (tripledot) @comment.discard @@ -123,6 +123,6 @@ ; Punctuation ["," "." "-" ";"] @punctuation.delimiter -["(" ")" "{" "}" "[" "]" "<<" ">>"] @punctuation.bracket +["(" ")" "#" "{" "}" "[" "]" "<<" ">>"] @punctuation.bracket ; (ERROR) @error -- cgit v1.2.3-70-g09d2