Function: sqlind-maybe-case-statement

sqlind-maybe-case-statement is a natively compiled function defined in sql-indent.el.

Signature

(sqlind-maybe-case-statement)

Documentation

If (point) is on a case statement.

Source Code

;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
(defun sqlind-maybe-case-statement ()
  "If (point) is on a case statement."
  (when (looking-at "case")
    (save-excursion
      (sqlind-backward-syntactic-ws)
      (forward-word -1)
      (unless (looking-at "end")   ; we don't want to match an "end case" here
        (if (null sqlind-end-stmt-stack)
            (throw 'finished (list 'in-block 'case ""))
          (cl-destructuring-bind (pos kind _label)
              (pop sqlind-end-stmt-stack)
            (unless (or (not kind) (eq kind 'case))
              (throw 'finished
                (list 'syntax-error
                      "bad closing for case block" (point) pos)))))))))