atom / language-clojure

Clojure package for Atom
Other
49 stars 48 forks source link

Some valid numbers are highlighted incorrectly #89

Closed MrEbbinghaus closed 2 years ago

MrEbbinghaus commented 2 years ago

Prerequisites

Description

Some valid Clojure numbers are not correctly detected.

Steps to Reproduce

Have a look at GitHubs highlighting: All these Numbers are valid Clojure Numbers: You can find the reference here: https://clojure.org/reference/reader#_literals

; integer ; BigInt  ; octal   ; hex
00          42N     052       0x2a
42          0N      00N       0x0N

; radix.  ; radix BigInt
2r101010  2r101010N
8r52      8r52N
16r2a     16r2aN
36r16     36r16N

;; ratios  ;; floats
1/2        42.0
-1/2       -42.0
           42.

; BigDecimal ; with Exponent
42.0M        42.0E2
-42M         -42.0E+9
42.M         42E-0
42M          42.0E2M
             42E+9M

Screenshot from Atom: image

Proof, that these are valid numbers: image

Expected behavior: They should be highlighted correctly. Actual behavior: Does not highlight correctly Reproduces how often: 100%

Versions

Atom : 1.58.0 Electron: 9.4.4 Chrome : 83.0.4103.122 Node : 12.14.1

Related issues

https://github.com/BetterThanTomorrow/calva/issues/1378 https://github.com/highlightjs/highlight.js/pull/3397