Function: parseclj--take-value

parseclj--take-value is a byte-compiled function defined in parseclj-parser.el.

Signature

(parseclj--take-value STACK VALUE-P)

Documentation

Scan STACK until a value is found.

Return everything up to the value in reversed order (meaning the value comes first in the result).

STACK is the current parse stack to scan.

VALUE-P a predicate to distinguish reduced values from non-values (tokens and whitespace).

Source Code

;; Defined in ~/.emacs.d/elpa/parseclj-20261002.1230/parseclj-parser.el
(defun parseclj--take-value (stack value-p)
  "Scan STACK until a value is found.
Return everything up to the value in reversed order (meaning the value
comes first in the result).

STACK is the current parse stack to scan.

VALUE-P a predicate to distinguish reduced values from non-values (tokens
and whitespace)."
  (let ((result nil))
    (cl-block nil
      (while stack
        (cond
         ((parseclj-lex-token-p (car stack))
          (cl-return nil))

         ((funcall value-p (car stack))
          (cl-return (cons (car stack) result)))

         (t
          (push (pop stack) result)))))))