[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c-mode imenu: Stack overflow in regexp matcher

From: Kim F. Storm
Subject: Re: c-mode imenu: Stack overflow in regexp matcher
Date: Wed, 07 Feb 2007 16:22:41 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> This will do it:
>> (goto-char (point-max))
>> (re-search-backward "^\\<[^()]*[^[:alnum:]_:<>~]")
>> It matches the whole of etc/splash.xpm from "static char..." right
>> through to the end, some 60000 odd characters later.
> Good, thanks.  Then now we have to find someone who knows what the regexp is
> supposed to match, so as to figure out how to rewrite it.


(defvar cc-imenu-c++-generic-expression

    ;; General function name regexp
       "^\\<"                                 ; line MUST start with word char
       "[^()]*"                               ; no parentheses before
       "[^" c-alnum "_:<>~]"                  ; match any non-identifier char
       "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name
       "\\([ \t\n]\\|\\\\\n\\)*("             ; see above, BUT the arg list
       "\\([ \t\n]\\|\\\\\n\\)*\\([^ \t\n(*][^)]*\\)?)" ; must not start
       "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]"    ; with an asterisk or parentheses
       ) 1)

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]