Function: antlr-skip-rule-postlude

antlr-skip-rule-postlude is a byte-compiled function defined in antlr-mode.el.gz.

Signature

(antlr-skip-rule-postlude SKIP-COMMENT)

Documentation

Skip the postlude of a definition, i.e. everything after ;.

Definitions are rules, grammar/class and v4 mode definition. If SKIP-COMMENT is non-nil, also skip the whitespace and comment after that part. See antlr-rule-postlude-skip-alist.

Point is assumed to be after the ;. Always return end position before trailing whitespaces and comments

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
(defun antlr-skip-rule-postlude (skip-comment)
  "Skip the postlude of a definition, i.e. everything after `;'.
Definitions are rules, grammar/class and v4 mode definition.  If
SKIP-COMMENT is non-nil, also skip the whitespace and comment
after that part.  See `antlr-rule-postlude-skip-alist'.

Point is assumed to be after the `;'.  Always return end position
before trailing whitespaces and comments"
  (let ((pos (point)))
    (antlr-c-forward-sws)
    (while (looking-at antlr-rule-postlude-skip-regexp)
      (if (match-end 1)
          (let ((skip (cdr (assoc (match-string-no-properties 1)
                                  antlr-rule-postlude-skip-alist))))
            (if (functionp (car skip))
                (setq pos (apply (car skip) (cdr skip)))
              (setq pos (antlr-skip-sexps (or (car skip) 1)))
              (when (and (cdr skip) (eq (char-after) ?\[))
                (setq pos (antlr-skip-sexps 1)))))
        (goto-char (match-end 0))       ; to end of @action / @scope::action
        (antlr-c-forward-sws)
        (setq pos (antlr-skip-sexps 1))))
    (if (eq (char-after) ?\{) (setq pos (antlr-skip-sexps 1))) ; v2
    (or skip-comment (goto-char pos))))