Skip to content

Commit

Permalink
Allow _ in numbers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slotThe authored and AndersonTorres committed Oct 12, 2024
1 parent 5fff77d commit c7b71c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bqn-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c7b71c8

Please sign in to comment.