Function: parse-time-tokenize

parse-time-tokenize is a byte-compiled function defined in parse-time.el.gz.

Signature

(parse-time-tokenize STRING)

Documentation

Tokenize STRING into substrings.

Each substring is a run of "valid" characters, i.e., lowercase letters, digits, plus or minus signs or colons.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/parse-time.el.gz
(defun parse-time-tokenize (string)
  "Tokenize STRING into substrings.
Each substring is a run of \"valid\" characters, i.e., lowercase
letters, digits, plus or minus signs or colons."
  (let ((start nil)
	(end (length string))
	(all-digits nil)
	(list ())
	(index 0)
	(c nil))
    (while (< index end)
      (while (and (< index end)		;Skip invalid characters.
		  (not (setq c (parse-time-string-chars (aref string index)))))
	(cl-incf index))
      (setq start index
            all-digits (eq c ?0))
      (while (and (< (cl-incf index) end)	;Scan valid characters.
		  (setq c (parse-time-string-chars (aref string index))))
	(setq all-digits (and all-digits (eq c ?0))))
      (if (<= index end)
	  (push (if all-digits (cl-parse-integer string :start start :end index)
		  (substring string start index))
		list)))
    (nreverse list)))