From 7d6dce936a437800a4c37da53f75b84787d94879 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 8 Apr 2024 20:58:17 +0100 Subject: [PATCH] Account for '-' as an operator For syntax purposes it's part of the number, but it looks better when highlighted as an operator. --- queries/highlights.scm | 2 ++ test/highlight/litterals.bp | 2 +- test/highlight/operators.bp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/queries/highlights.scm b/queries/highlights.scm index 20424ec..af38e25 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -5,6 +5,8 @@ ; Operators {{{ (operator) @operator + +(integer_literal ("-") @operator) ; }}} ; Literal {{{ diff --git a/test/highlight/litterals.bp b/test/highlight/litterals.bp index 3f8131f..dfbdc71 100644 --- a/test/highlight/litterals.bp +++ b/test/highlight/litterals.bp @@ -2,7 +2,7 @@ foo = 0 // ^ number foo = -42 -// ^ number +// ^ number foo = true // ^ boolean diff --git a/test/highlight/operators.bp b/test/highlight/operators.bp index 33d9581..cfb75ac 100644 --- a/test/highlight/operators.bp +++ b/test/highlight/operators.bp @@ -5,4 +5,5 @@ foo += 1 // ^ operator foo = -1 + 2 +// ^ operator // ^ operator