]> git.eshelyaron.com Git - emacs.git/commit
Move more of Eshell range handling to the parser phase
authorJim Porter <jporterbugs@gmail.com>
Mon, 21 Oct 2024 01:01:10 +0000 (18:01 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 8 Nov 2024 13:30:37 +0000 (14:30 +0100)
commite6da81c7fd8a667ba9231b6670dfac3684dd86f9
tree67bc781729090e186209f4e1d853024545242907
parentbf2e0e293cff3fcc64441533c2650b280c954212
Move more of Eshell range handling to the parser phase

* lisp/eshell/esh-util.el (eshell-range): New struct.
(eshell--range-string-p, eshell--string-to-range): New functions.

* lisp/eshell/esh-arg.el (eshell-parse-integer)
(eshell-parse-range-token): New functions...
(eshell-parse-argument-hook): ... add them.
(eshell--after-range-token-regexp): New defsubst.
(eshell-concat-1): Don't remove the 'number' property; we use that when
handling range arguments.
(eshell--range-token): New constant.
(eshell-unmark-range-token): New function.

* lisp/eshell/esh-var.el (eshell-parse-index): Update implementation to
use parsed range argument.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-indices):
Test range index using variables.

(cherry picked from commit ed9ea57e57a915e743100591d7a71d44a4b4c0e9)
lisp/eshell/esh-arg.el
lisp/eshell/esh-util.el
lisp/eshell/esh-var.el
test/lisp/eshell/esh-var-tests.el