From c7b71c85e69c8b1bcec2bdd718d7a91929af28d7 Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Sat, 12 Oct 2024 11:59:21 +0200 Subject: [PATCH] Allow _ in numbers The spec is quite clear that underscores may be used pretty much anywhere inside of (and even at the end) of a number. A simpler form of this is to simply accept underscores whenever we accept numbers, which is what this commit implements. --- bqn-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bqn-mode.el b/bqn-mode.el index af8b037..bf9c8c6 100644 --- a/bqn-mode.el +++ b/bqn-mode.el @@ -2496,7 +2496,7 @@ https://mlochbaum.github.io/BQN/help/index.html.") ("_𝕣\\|β€’?\\_<_[A-Za-z][A-Z_a-z0-9Ο€βˆžΒ―]*\\_>" . 'bqn-one-modifier) ("[π”½π”Ύπ•Žπ•π•Š]\\|β€’?\\_<[A-Z][A-Z_a-z0-9Ο€βˆžΒ―]*\\_>" . 'bqn-function) ("[π•—π•˜π•¨π•©π•€π•£]\\|β€’?\\_<[a-z][A-Z_a-z0-9Ο€βˆžΒ―]*\\_>" . 'bqn-subject) ;TODO had single β€’ --- why? - ("\\_<Β―?\\(\\([0-9]+\\.\\)?[0-9]+\\(eΒ―?[0-9]+\\)?\\|Ο€\\|∞\\)\\(iΒ―?\\(\\([0-9]+\\.\\)?[0-9]+\\(eΒ―?[0-9]+\\)?\\|Ο€\\|∞\\)\\)?\\_>" + ("\\_<Β―?\\(\\([0-9][0-9_]*\\.\\)?[0-9][0-9_]*\\(eΒ―?[0-9_]+\\)?\\|Ο€\\|∞\\)\\(iΒ―?\\(\\([0-9_]+\\.\\)?[0-9_]+\\(eΒ―?[0-9_]+\\)?\\|Ο€\\|∞\\)\\)?\\_>" . ,(if (facep 'font-lock-number-face) ''font-lock-number-face ''font-lock-constant-face)) ;; *after* numbers have been parsed: ("\\." . ,(if (facep 'font-lock-punctuation-face) ''font-lock-punctuation-face ''default))