Function: sqlind-good-if-candidate

sqlind-good-if-candidate is a natively compiled function defined in sql-indent.el.

Signature

(sqlind-good-if-candidate)

Documentation

Return non-nil if point is on an actual if statement.

We try to avoid false positives, like "end if" or the various
"drop STUFF if exists" variants.

Source Code

;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
(defun sqlind-good-if-candidate ()
  "Return non-nil if point is on an actual if statement.
We try to avoid false positives, like \"end if\" or the various
\"drop STUFF if exists\" variants."
  (and (looking-at "if")
       (save-excursion
         (sqlind-backward-syntactic-ws)
         (forward-word -1)
         ;; we don't want to match an "end if", and things like "drop index if
         ;; exists..." and "create index if not exist..."
         (not (looking-at "end\\|schema\\|table\\|view\\|index\\|constraint\\|type\\|trigger\\|procedure\\|function\\|routine\\|package\\|body\\|extension")))))