Function: treesit--simple-indent-eval
treesit--simple-indent-eval is a byte-compiled function defined in
treesit.el.gz.
Signature
(treesit--simple-indent-eval EXP)
Documentation
Evaluate EXP.
If EXP is an application and the function is a key in
treesit-simple-indent-presets, use the corresponding value as
the function.
Source Code
;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defun treesit--simple-indent-eval (exp)
"Evaluate EXP.
If EXP is an application and the function is a key in
`treesit-simple-indent-presets', use the corresponding value as
the function."
;; We don't want to match uncompiled lambdas, so make sure this cons
;; is not a function. We could move the condition functionp
;; forward, but better be explicit.
(cond ((and (consp exp) (not (functionp exp)))
(apply (treesit--simple-indent-eval (car exp))
(mapcar #'treesit--simple-indent-eval
(cdr exp))))
;; Presets override functions, so this condition comes before
;; `functionp'.
((alist-get exp treesit-simple-indent-presets))
((functionp exp) exp)
((symbolp exp)
(if (null exp)
exp
;; Matchers only return lambdas, anchors only return
;; integer, so we should never see a variable.
(signal 'treesit-indent-error
(list "Couldn't find the preset corresponding to expression"
exp))))
(t exp)))