Peter Thiemann <thiemann(a)informatik.uni-freiburg.de> writes:
Hello Ville,
you're author of the original JavaScript regexp. Any comments on
this? If not, I'll commit the stanza below along with an arbitrary
ChangeLog (M-: (yow 1) or something like this :-)).
2. The [ \t;{]* is not quite right because it picks up stuff
like "nudelfunction fireball"
Peter, in my opinion this is a perfect valid keyword which should be
respected in every language :-)
I looked at it again and came up with
(defvar fume-function-name-regexp-javascript
(concat
"^\\("
"\\|"
"\\([^/]\\|/[^/\\*]\\|/\\*\\([^\\*]\\|\\*[^/]\\)*\\*/\\)[ \t;{]"
"\\)"
"function[ \t]+"
"\\([a-zA-Z_\\$][a-zA-Z0-9_\\$]*\\)"
;; "[ \t\n]*("
)
"Expression to get JavaScript function names.")
This regexp also handles your case d by skipping over C-style comments.
It's still not perfect though: The function name should be followed by
an opening parenthesis as in the comment in last line of the regexp.
However, I did not get that to work right away.
Thanks,
norbert.