Padre::Plugin::Parrot - Experimental Padre plugin for Parrot
This Plugin provides several features
After installation you need to enable the plugin via the Plugin Manager of Padre. Once that is done there should be a menu option Plugins/Parrot with several submenus.
About is just some short explanation
The other menu options will count the number of characters in the current document using the current Perl 5 interpreter or PASM running on top of Parrot. Later we add other implementations running on top of Parrot.
The syntax highlighting provided by this module can be enabled on a perl file-type (actually mime-type) base in the Edit/Preferences/Mime-types dialog.
This whole plugin is quite experimental. So is the documentation. I hope the plugin can work with released and installed versions of Parrot as well but I have never tried that. Let me outline how I install the dependencies.
It is quite simple though it has several steps in it.
Later we'll make this more simple.
I start with Rakudo (the implementation of Perl 6 on Parrot).
$ cd $HOME $ mkdir work $ cd work $ git clone git://github.com/rakudo/rakudo.git $ cd rakudo $ perl Configure.pl --gen-parrot $ make
Configure PARROT_DIR to point to the root of parrot Configure RAKUDO_DIR to point to the directory where rakudo was checked out. (I have these in the .bashrc)
$ export PARROT_DIR=$HOME/work/rakudo/parrot $ export RAKUDO_DIR=$HOME/work/rakudo
Once this is done if you run Padre now you can enable Parrot/PGE highlighting of Perl 6 files via the Edit/Preferences/Mime-types dialog.
In order to support Ruby highlighting one needs to configure the CARDINAL_DIR environment variable to point to the place where the cardinal.pbc can be located.
$ cd $HOME/work $ git clone git://github.com/cardinal/cardinal.git $ export CARDINAL_DIR=$HOME/work/cardinal # add this also to .bashrc $ cd $PARROD_DIR $ mkdir languages $ cd language $ ln -s $CARDINAL_DIR $ cd cardinal $ perl Configure.pl $ make
Once this is done if you run Padre now you can enable Parrot/PGE highlighting of Ruby files via the Edit/Preferences/Mime-types dialog.
$ export LD_LIBRARY_PATH=$PARROT_DIR/blib/lib/
$ cd $PARROT_DIR/ext/Parrot-Embed/ ./Build realclean perl Build.PL ./Build ./Build test
The test will give a warning like this, but will pass:
Parrot VM: Can't stat no file here, code 2. error:imcc:syntax error, unexpected IDENTIFIER in file 'EVAL_2' line 1
Now if you run Padre and enable Padre::Plugin::Parrot it will have an embedded Parrot interpreter that can run code written in PIR. (See the Plugins/Parrot/Count Characters...) menu options.
https://trac.parrot.org/parrot/ticket/77 https://trac.parrot.org/parrot/ticket/74 https://trac.parrot.org/parrot/ticket/76 https://trac.parrot.org/parrot/ticket/79 https://trac.parrot.org/parrot/ticket/77
In order to add more syntax highlighters one needs to
make sure the relevant language can compile to a pbc file
add and entry to the @config variable.
add color codes to the missing tokens in Padre::Plugin::Parrot::ColorizeTask
Copyright 2008-2009 Gabor Szabo. http://szabgab.com/
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
Some text "docs/intro.pod" in $PARROT_DIR