Sunday, April 24, 2011

Parrot support on Exuberant Ctags

Parrot and Ctags


As you know, parrot itself has very common editors support. Some common settings, syntax, color scheme and even tags file can generated with running "make" on parrot_src/editor directory.
$ make vi-tags
$ make vi
But, unfortunately, that tags files can do resolve to c source files that make parrot itself, so any languages wrote in parrot features such like 'pir' doesn't understand how to works with it.

So, I added parrot.c to Exuberant Ctags and published on my github.

*This is a very basic support for parrot ctags, yet*
$ git clone git://github.com/lateau/exuberant-ctags.git
$ cd exuberant-ctags
$ ./configure
$ make -j
$ su -c 'make install'     # install if you want
$ ./ctags --list-languages
...
parrot
...
$./ctags --list-kinds=parrot
s subroutine
r rule
t token
Supported files:
*.pir
*.pasm
*.pg
Kinds:
s subroutine
r rule
t token
Usage:
$ cd rakudo
$ ctags -R -exclude=.git --lang-map=parrot:+.pir.pasm.pg

How to use with tlist.vim


You can also enable TagList in vim. Just add bellow code to taglist.vim around line 430.
" parrot
s:tlist_def_parrot_settings = \
   'parrot;s:subroutine;r:rule;t:token'