changeset 6006:dc6d45202fb9

(calendar-string-to-mayan-long-count): Don't assume that periods must end numbers. Look for digit runs explicitly.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Feb 1994 02:05:53 +0000
parents bf1c9fd5669b
children 4cd71c48281f
files lisp/calendar/cal-mayan.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-mayan.el	Sat Feb 19 00:01:46 1994 +0000
+++ b/lisp/calendar/cal-mayan.el	Sat Feb 19 02:05:53 1994 +0000
@@ -102,11 +102,12 @@
     (condition-case condition
         (progn
           (while (< cc c)
-            (let ((datum (read-from-string str cc)))
-              (if (not (integerp (car datum)))
-                  (signal 'invalid-read-syntax (car datum))
-                (setq rlc (cons (car datum) rlc))
-                (setq cc (cdr datum)))))
+	    (let* ((start (string-match "[0-9]+" str cc))
+		   (end (match-end 0))
+		   datum)
+	      (setq datum (read (substring str start end)))
+	      (setq rlc (cons datum rlc))
+	      (setq cc end)))
           (if (not (= (length rlc) 5)) (signal 'invalid-read-syntax nil)))
       (invalid-read-syntax nil))
     (reverse rlc)))