[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[TSVN] some more autocompletion rules

From: Duncan Booth <duncan.booth_at_suttoncourtenay.org.uk>
Date: 2005-02-17 12:09:16 CET

Here are a couple of regular expressions to match function definitions in
Javascript and Python. The javascript one will also come up with a lot of
empty strings which I hope isn't a problem, but there are a lot of ways to
define functions in Javascript (I haven't attempted to match all of them).

.js = (?:(?:prototype\.|this\.)(\w+)\s*=\s*)?function\s*(?:(\w*)\s*)\(

The only complexity about the Python one is that class or def needs to be
the first word one the line (possibly after whitespace), and without
turning on MULTILINE mode there doesn't seem to be an easy way to match
that:

(MULTILINE) .py .pyw = ^\s*(?:class|def)\s+(\w+)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Feb 17 13:13:17 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.