"\\w\\|\\s_\\|\\s\"\\|\\s|"
"\\w\\|\\s_\\|\\s\""))
-(defun c-forward-over-token (&optional balanced)
+(defun c-forward-over-token (&optional balanced limit)
"Move forward over a token.
Return t if we moved, nil otherwise (i.e. we were at EOB, or a
non-token or BALANCED is non-nil and we can't move). If we
are at syntactic whitespace, move over this in place of a token.
If BALANCED is non-nil move over any balanced parens we are at, and never move
-out of an enclosing paren."
+out of an enclosing paren. LIMIT is the limit to where we might move to."
(let ((jump-syntax (if balanced
c-jump-syntax-balanced
c-jump-syntax-unbalanced))
- (here (point)))
+ (here (point))
+ (limit (or limit (point-max))))
(condition-case nil
(cond
((/= (point)
- (progn (c-forward-syntactic-ws) (point)))
+ (progn (c-forward-syntactic-ws limit) (point)))
;; If we're at whitespace, count this as the token.
t)
((eobp) nil)
((looking-at jump-syntax)
- (goto-char (scan-sexps (point) 1))
+ (goto-char (min limit (scan-sexps (point) 1)))
t)
((looking-at c-nonsymbol-token-regexp)
- (goto-char (match-end 0))
+ (goto-char (min (match-end 0) limit))
t)
((save-restriction
(widen)
t (if (c-lang-const c-opt-cpp-macro-define)
(concat (c-lang-const c-anchored-cpp-prefix)
(c-lang-const c-opt-cpp-macro-define)
- "[ \t]+\\(\\sw\\|_\\)+\\([^(a-zA-Z0-9_]\\|$\\)")))
+ "[ \t]+[a-zA-Z0-9_]+\\([^(a-zA-Z0-9_]\\|$\\)")))
(c-lang-defconst c-cpp-expr-directives
"List of cpp directives (without the prefix) that are followed by an
(let* ((lim1 (save-excursion
(and (c-beginning-of-macro)
(progn (c-end-of-macro) (point)))))
- (decl-res (c-forward-declarator)))
+ (lim+ (c-determine-+ve-limit 200))
+ (decl-res (c-forward-declarator lim+)))
(if (or (cadr (cddr (cddr decl-res))) ; We scanned an arglist.
(and (eq (char-after) ?\() ; Move over a non arglist (...).
(prog1 (c-go-list-forward)
(c-backward-syntactic-ws lim1)
(eq (char-before) ?\())
(c-fl-decl-end (1- (point))))
- (c-forward-over-token)
+ (c-forward-over-token nil lim+) ; The , or ) after the declarator.
(point))
(if (progn (c-forward-syntactic-ws)
(not (eobp)))