Lo and behold, Google says there are about 858,800 results for a "actionscript ctags" search. (Bing says 45,800, which seems more reasonable but still really high.)
I associate ctags and vi with old school *nix hackers, and ActionScript with graphic designers that morph into Flash code monkeys. My picture of actionscript hackers ain't right, which gives me a good feeling about using ActionScript.
Anyway, it's pretty easy. Mixing some Makefile goo with some regular expressions, I get:
CTAGSLANGS=--langdef=as \ --langmap=as:.as \ --regex-as='/^(a-z0-9_]+)\([^\)]*\)[ \t]*/\1/f,function/i' \ --regex-as='/class[ \t]+([^ \t]+)[ \t]*$$/\1/c,class/i' ctags:: find . -name "*.as" | ctags -e - $(CTAGLANGS)Notes:
- the regular expressions are Posix extended (roughly egrep);
- the "kind" (e.g.,
f,function
) options can be seen by runningctags --list-kinds | less
at the command line; - the
i
flag says case-insensitive; - the
$$
(to match the end of a line) is required because we are inside a Makefile - these regex are specific to how I format my code.
public function getfoo() : void { }The function regex may catch more than I want, but the alternative is to write some C code and recompile ctags (so I can use the previous line as context), so I'll run with this for a while.
References
No comments:
Post a Comment