Function: smie-backward-sexp

smie-backward-sexp is a byte-compiled function defined in smie.el.gz.

Signature

(smie-backward-sexp &optional HALFSEXP)

Documentation

Skip over one sexp.

HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the first token we see is an operator, skip over its left-hand-side argument. HALFSEXP can also be a token, in which case we should skip the text assuming it is the left-hand-side argument of that token. Possible return values:
  (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
    is too high. LEFT-LEVEL is the left-level of TOKEN,
    POS is its start position in the buffer.
  (t POS TOKEN): same thing but for an open-paren or the beginning of buffer.
    Instead of t, the car can also be some other non-nil non-number value.
  (nil POS TOKEN): we skipped over a paren-like pair.
  nil: we skipped over an identifier, matched parentheses, ...

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/smie.el.gz
(defun smie-backward-sexp (&optional halfsexp)
  "Skip over one sexp.
HALFSEXP if non-nil, means skip over a partial sexp if needed.  I.e. if the
first token we see is an operator, skip over its left-hand-side argument.
HALFSEXP can also be a token, in which case we should skip the text
assuming it is the left-hand-side argument of that token.
Possible return values:
  (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
    is too high.  LEFT-LEVEL is the left-level of TOKEN,
    POS is its start position in the buffer.
  (t POS TOKEN): same thing but for an open-paren or the beginning of buffer.
    Instead of t, the `car' can also be some other non-nil non-number value.
  (nil POS TOKEN): we skipped over a paren-like pair.
  nil: we skipped over an identifier, matched parentheses, ..."
  (smie-next-sexp
   (indirect-function smie-backward-token-function)
   (lambda (n)
     (if (bobp)
         ;; Arguably backward-sexp should signal this error for us.
         (signal 'scan-error
                 (list "Beginning of buffer" (point) (point)))
       (backward-sexp n)))
   (indirect-function #'smie-op-left)
   (indirect-function #'smie-op-right)
   halfsexp))