emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/num3-mode 6ee69df054 1/2: Remove unnecessary ‘(in …)’


From: Michał Nazarewicz
Subject: [elpa] externals/num3-mode 6ee69df054 1/2: Remove unnecessary ‘(in …)’ forms in regex definition
Date: Fri, 26 Aug 2022 12:34:51 -0400 (EDT)

branch: externals/num3-mode
commit 6ee69df054648bf45a87dfa4ff21b652d7aa158e
Author: Michal Nazarewicz <mina86@mina86.com>
Commit: Michal Nazarewicz <mina86@mina86.com>

    Remove unnecessary ‘(in …)’  forms in regex definition
    
    * num3-mode.el (num3--number-re): replace ‘(in char-class)’ by
    ‘char-class’ which simplifies the forms slightly.
---
 num3-mode.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/num3-mode.el b/num3-mode.el
index fa5cab41bd..667b3de928 100644
--- a/num3-mode.el
+++ b/num3-mode.el
@@ -111,14 +111,14 @@ the (place where) decimal point (would be) is."
   (rx
    (or
     ;; ‘#x1234’
-    (seq ?# (in "xX") (submatch-n 1 (+ (in hex)))) ; 1 - hexadecimal integer
+    (seq ?# (in "xX") (submatch-n 1 (+ hex)))      ; 1 - hexadecimal integer
     ;; ‘0x1234’ or ‘0x1234.5678p±9’.  Hexadecimal floating point numbers
     ;; require exponent to be present.  ‘0x1234.5678’ are two separate
     ;; numbers with a dot between them.
-    (seq ?0 (in "xX") (submatch-n 1 (* (in hex)))  ; 1 - hexadecimal integer
-         (? ?. (submatch-n 4 (+ (in hex)))         ; 4 - hexadecimal fraction
+    (seq ?0 (in "xX") (submatch-n 1 (* hex))       ; 1 - hexadecimal integer
+         (? ?. (submatch-n 4 (+ hex))              ; 4 - hexadecimal fraction
             (in "pP") (? (in "-+"))
-            (submatch-n 2 (+ (in num)))))          ; 2 - decimal int (power)
+            (submatch-n 2 (+ num))))               ; 2 - decimal int (power)
     ;; ‘0b1010’ or ‘#b1010’.  Binary numbers use the same group as hexadecimal
     ;; numbers as they also use grouping of four when highlighted.  Note that
     ;; this group must be before we match unprefixed hexadecimal numbers.
@@ -138,13 +138,13 @@ the (place where) decimal point (would be) is."
     ;;   being caught by previous cases.
     (submatch-n 1                                  ; 1 - hexadecimal integer
                 word-boundary
-                (or (seq (+ (in num)) (in "a-fA-F"))
-                    (seq (+ (in "a-fA-F")) (in num)))
-                (* (in hex))
+                (or (seq (+ num) (in "a-fA-F"))
+                    (seq (+ (in "a-fA-F")) num))
+                (* hex)
                 word-boundary)
     ;; ‘1234’
-    (submatch-n 2 (+ (in num)))                    ; 2 - decimal integer
-    (seq ?. (submatch-n 3 (+ (in num)))))))        ; 3 - decimal fraction
+    (submatch-n 2 (+ num))                         ; 2 - decimal integer
+    (seq ?. (submatch-n 3 (+ num))))))             ; 3 - decimal fraction
 
 (defun num3--matcher (lim)
   "Function used as a font-lock-keywoard handler used in `num3-mode'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]