[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode 155abadb6a 124/253: Improve highlighting of numb
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/raku-mode 155abadb6a 124/253: Improve highlighting of numbers |
Date: |
Sat, 29 Jan 2022 08:28:48 -0500 (EST) |
branch: elpa/raku-mode
commit 155abadb6af96e584d416747c0a949ebe91be294
Author: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Commit: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Improve highlighting of numbers
It was erroneously highlighting "10." in "10..1" as a number.
It was also not highlighting numbers with multiple underscores in them,
like "1_000_000".
---
perl6-font-lock.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index d828f21f08..eb715ee84a 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -230,11 +230,16 @@
(number
. ,(rx
(group-n 1
- (opt (1+ digit) (opt "_" (1+ digit)))
- (opt ".")
- (1+ digit))
+ (or (and (1+ digit)
+ (0+ (and "_" (1+ digit)))
+ (opt "."
+ (1+ digit)
+ (0+ (and "_" (1+ digit)))))
+ (and "."
+ (1+ digit)
+ (0+ (and "_" (1+ digit))))))
(opt (group-n 2 (any "Ee"))
- (group-n 3 (opt "-") (1+ digit) (opt "_" (1+ digit))))
+ (group-n 3 (opt "-") (1+ digit) (0+ "_" (1+ digit))))
(opt (group-n 4 "i"))))
(base-number
. ,(rx symbol-start
@@ -626,7 +631,7 @@ LIMIT can be used to bound the search."
(opt "::"))
0 'perl6-identifier)
;; numbers
- (,(perl6-rx number)
+ (,(perl6-rx (or bol (regex "[^[:digit:]]")) number)
(1 'perl6-number)
(2 'perl6-number-addition nil t)
(3 'perl6-number nil t)
- [nongnu] elpa/raku-mode 98e3cbfabf 053/253: Always use a limit with `looking-back', (continued)
- [nongnu] elpa/raku-mode 98e3cbfabf 053/253: Always use a limit with `looking-back', ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 024ef71927 064/253: Highlight type constraints, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 9ca9a0caa7 082/253: Highlight identifiers containing underscore, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode c93daf2353 096/253: Avoid highlighting X::Foo and X:: as cross-metaoperators, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 94ba374818 117/253: Realign code, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e4a86350be 111/253: Fix tests in light of recent changes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 9ca2944f8f 100/253: Highlight :!foo correctly, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 1d2f63b715 083/253: Highlight [RSXZ] on their own, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 7e60f137ce 095/253: Fix highlighting of some reduce ops, like [<], ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode c91c403320 123/253: Fix highlighting of infix:<<lt>> and friends, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 155abadb6a 124/253: Improve highlighting of numbers,
ELPA Syncer <=
- [nongnu] elpa/raku-mode 1277ec749e 097/253: Fix highlighting of words in identifers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode d8c1ae4d87 089/253: Move context-checking into a function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode c5f3d072e5 120/253: Don't highlight string delimiters inside comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 19f4243934 125/253: Remove unnecessary check for syntactic context, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 6c97f87fd8 135/253: Correctly highlight ::*Foo::Bar, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 309720c98a 148/253: correct indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode c0b40f2ad5 140/253: Correctly highlight custom sub/grammar/etc names that clash with keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 89d6145859 149/253: use proper name for a multi sub or method, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode a594f53e09 141/253: Highlight with/orwith/without, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode a0cd586520 170/253: Following this advice http://stackoverflow.com/questions/26108655/error-updating-emacs-packages-failed-to-download-gnu-archive, ELPA Syncer, 2022/01/29