~ chicken-core (chicken-5) 547ca87cf551aeeb156491710d1af3f152242db2


commit 547ca87cf551aeeb156491710d1af3f152242db2
Author:     Peter Bex <peter.bex@xs4all.nl>
AuthorDate: Wed Jul 18 20:40:45 2012 +0200
Commit:     Christian Kellermann <ckeen@pestilenz.org>
CommitDate: Thu Jul 19 10:16:53 2012 +0200

    Fix irregex builtin "real" utility pattern to allow leading +/- sign. This fixes #888 (upstream changeset 3c51418853de)
    
    Signed-off-by: Christian Kellermann <ckeen@pestilenz.org>

diff --git a/NEWS b/NEWS
index 77e79999..01a3bf99 100644
--- a/NEWS
+++ b/NEWS
@@ -134,6 +134,7 @@
   - added "alist-update" ("data-structures" unit)
   - "irregex-replace" returns the original string instead of #f when the
     regex does not match
+  - irregex "real" built-in utility pattern now accepts a leading sign
   - added "change-directory*" ("posix" unit)
   - number parsing has been made more reliable and standards compliant
   - deprecated "none?", "always?" and "never?"
diff --git a/irregex-core.scm b/irregex-core.scm
index ebc35536..5b3e80ad 100644
--- a/irregex-core.scm
+++ b/irregex-core.scm
@@ -2261,7 +2261,9 @@
 
     ;; extended library patterns
     (integer . (seq (? (or #\+ #\-)) (+ numeric)))
-    (real . (seq (+ numeric) (? #\. (+ numeric)) (? (or #\e #\E) integer)))
+    (real . (seq (? (or #\+ #\-))
+                 (+ numeric) (? #\. (+ numeric))
+                 (? (or #\e #\E) integer)))
     ;; slightly more lax than R5RS, allow ->foo, etc.
     (symbol-initial . (or alpha ("!$%&*/:<=>?^_~")))
     (symbol-subsequent . (or symbol-initial digit ("+-.@")))
Trap