From 42bef1d59230e82a99a625cb934a85496b47231f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 8 Apr 2024 21:31:38 +0100 Subject: [PATCH] Add punctuations highlighting --- queries/highlights.scm | 16 ++++++++++++++++ test/highlight/punctuation.bp | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 test/highlight/punctuation.bp diff --git a/queries/highlights.scm b/queries/highlights.scm index 9541314..9eae8a0 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -9,6 +9,22 @@ (integer_literal ("-") @operator) ; }}} +; Punctuation {{{ +[ + "," + ":" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket +; }}} + ; Literal {{{ (boolean_literal) @boolean diff --git a/test/highlight/punctuation.bp b/test/highlight/punctuation.bp new file mode 100644 index 0000000..bc00194 --- /dev/null +++ b/test/highlight/punctuation.bp @@ -0,0 +1,15 @@ +foo ( + // <- punctuation.bracket + bar = [ + //^ punctuation.bracket + { + // <- punctuation.bracket + key: "value", + // ^ punctuation.delimiter + // ^ punctuation.delimiter + }, + // <- punctuation.bracket + ] + // <- punctuation.bracket +) +// <- punctuation.bracket