Skip to content

Commit b45dbdf

Browse files
committed
Octal & arbitrary radix integers
1 parent 40d7e4e commit b45dbdf

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Syntax has been significantly reworked.
99
- Properly highlight `entity.name` in `def*` forms only at second position, skipping all meta/comments
1010
- Quote & syntax quote highlight following form as `meta.quoted` and `meta.quoted.syntax`
1111
- Metadata highlights following form as `meta.metadata`
12-
- Allow reader-invisible forms like comma, newline, reader comment and meta almost everywhere between meaningful forms
12+
- Octal & arbitrary radix integers
1313

1414
Other changes:
1515

Clojure (Sublimed).sublime-syntax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ contexts:
234234
pop: 1
235235

236236
integer:
237-
- match: '{{wsb}}[+-]?(?:0x0|0x[1-9a-fA-F][0-9a-fA-F]*|0|[1-9][0-9]*)(N)?{{wse}}'
237+
- match: '{{wsb}}[+-]?(?:0[xX][0-9A-Fa-f]+|0[1-7]+|[1-9][0-9]*|[1-9][0-9]?[rR][0-9A-Za-z]+|0)(N)?{{wse}}'
238238
scope: constant.numeric.integer.clojure
239239
captures:
240240
1: punctuation.definition.integer.precision.clojure
@@ -549,7 +549,7 @@ contexts:
549549
pop: 2
550550

551551
deep_integer:
552-
- match: '{{wsb}}[+-]?(?:0x0|0x[1-9a-fA-F][0-9a-fA-F]*|0|[1-9][0-9]*)(N)?{{wse}}'
552+
- match: '{{wsb}}[+-]?(?:0[xX][0-9A-Fa-f]+|0[1-7]+|[1-9][0-9]*|[1-9][0-9]?[rR][0-9A-Za-z]+|0)(N)?{{wse}}'
553553
scope: constant.numeric.integer.clojure
554554
captures:
555555
1: punctuation.definition.integer.precision.clojure

test_syntax/syntax_test_clojure.cljc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,19 @@ string"
383383
; ^^ constant.numeric.integer
384384
; ^^ constant.numeric.integer
385385
; ^ punctuation.definition.integer.precision
386+
0123 -0123
387+
; ^^^^ constant.numeric.integer
388+
; ^^^^^ constant.numeric.integer
389+
0x0123 -0x123 0XFF
390+
; ^^^^^^ constant.numeric.integer
391+
; ^^^^^^ constant.numeric.integer
392+
; ^^^^ constant.numeric.integer
393+
36r0123abyz -32R0123ABYZ
394+
; ^^^^^^^^^^^ constant.numeric.integer
395+
; ^^^^^^^^^^^^ constant.numeric.integer
386396

387397
;; NOT INTEGERS
388-
01 1n ++1 --1 +N -N
398+
09 1n ++1 --1 +N -N
389399
; ^^^^^^^^^^^^^^^^^^^ -constant.numeric.integer
390400

391401

0 commit comments

Comments
 (0)