Function: idlwave-skip-label-or-case
idlwave-skip-label-or-case is a byte-compiled function defined in
idlwave.el.gz.
Signature
(idlwave-skip-label-or-case)
Documentation
Skip label or case statement element.
Returns position after label. If there is no label point is not moved and nil is returned.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-skip-label-or-case ()
"Skip label or case statement element.
Returns position after label.
If there is no label point is not moved and nil is returned."
;; Case expressions and labels are terminated by a colon.
;; So we find the first colon in the line and make sure
;; - no `?' is before it (might be a ? b : c)
;; - it is not in a comment
;; - not in a string constant
;; - not in parenthesis (like a[0:3])
;; - not followed by another ":" in explicit class, ala a->b::c
;; As many in this mode, this function is heuristic and not an exact
;; parser.
(let* ((start (point))
(eos (save-excursion (idlwave-end-of-statement) (point)))
(end (idlwave-find-key ":" 1 'nomark eos)))
(if (and end
(= (nth 0 (parse-partial-sexp start end)) 0)
(not (string-search "?" (buffer-substring start end)))
(not (string-match "^::" (buffer-substring end eos))))
(progn
(forward-char)
(point))
(goto-char start)
nil)))