Function: eshell-parse-integer

eshell-parse-integer is a byte-compiled function defined in esh-arg.el.gz.

Signature

(eshell-parse-integer)

Documentation

Parse an integer argument.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-arg.el.gz
(defun eshell-parse-integer ()
  "Parse an integer argument."
  (unless eshell-current-quoted
    (let ((prev-token (if eshell-arg-listified
                          (car (last eshell-current-argument))
                        eshell-current-argument)))
      (when (and (memq prev-token `(nil ,eshell--range-token))
                 (looking-at eshell-integer-regexp)
                 (or (eshell-arg-delimiter (match-end 0))
                     (save-excursion
                       (goto-char (match-end 0))
                       (looking-at-p (rx "..")))))
        (goto-char (match-end 0))
        (let ((str (match-string 0)))
          (add-text-properties 0 (length str) '(number t) str)
          str)))))