QUERY packages
Peter Thiemann <thiemann(a)informatik.uni-freiburg.de> writes:
Hello Peter,
thanks for your patch. I've got a question wrt it:
the regexp for JavaScript functions incorrectly picks up things that
look like functions inside of comments. For example it picks up the
function will from the following code snippet:
//when we select radio button in popup window
//this function will be initiated first
The patch below corrects this problem.
Yes, but are comments only allowed in the first column? I don't
really know the language's syntax :-/
I've tested with
,----[ hugo.js ]
| function a // should be function b
| /* hidden; { function c }
| function d will be seen */
| // another function e
|
| { function f }
`----
and came up with
(setq fume-function-name-regexp-javascript
"^\\([^/][^/\\*]\\)*[ \t;{]*function[ \t]+\\([a-zA-Z_\\$][a-zA-Z0-9_\\$]*\\)")
as the best solution. This also can't handle the case 'd', but that's
a shortcoming of the approach in general.
What do you think?
Thanks,
norbert.