c-syntactic-re-search-forward is a compiled Lisp function in `
(c-syntactic-re-search-forward REGEXP &optional BOUND NOERROR PAREN-LEVEL NOT-INSIDE-TOKEN LOOKBEHIND-SUBMATCH)
Like `re-search-forward', but only report matches that are found
in syntactically significant text. I.e. matches in comments, macros
or string literals are ignored. The start point is assumed to be
outside any comment, macro or string literal, or else the content of
that region is taken as syntactically significant text.
If PAREN-LEVEL is non-nil, an additional restriction is added to
ignore matches in nested paren sexps. The search will also not go
outside the current list sexp, which has the effect that if the point
should be moved to BOUND when no match is found (i.e. NOERROR is
neither nil nor t), then it will be at the closing paren if the end of
the current list sexp is encountered first.
If NOT-INSIDE-TOKEN is non-nil, matches in the middle of tokens are
ignored. Things like multicharacter operators and special symbols
(e.g. "`()" in Pike) are handled but currently not floating point
If LOOKBEHIND-SUBMATCH is non-nil, it's taken as a number of a
subexpression in REGEXP. The end of that submatch is used as the
position to check for syntactic significance. If LOOKBEHIND-SUBMATCH
isn't used or if that subexpression didn't match then the start
position of the whole match is used instead. The "look behind"
subexpression is never tested before the starting position, so it
might be a good idea to include \= as a match alternative in it.
Optimization note: Matches might be missed if the "look behind"
subexpression can match the end of nonwhite syntactic whitespace,
i.e. the end of comments or cpp directives. This since the function
skips over such things before resuming the search. It's on the other
hand not safe to assume that the "look behind" subexpression never
matches syntactic whitespace.
Bug: Unbalanced parens inside cpp directives are currently not handled
correctly (i.e. they don't get ignored as they should) when
PAREN-LEVEL is set.
Note that this function might do hidden buffer changes. See the
comment at the start of cc-engine.el for more info.