Emacs cperl-mode Perl6+MX::Declare news
I recently invested some tuits to rebase my Perl6 enhancements in Emacs cperl-mode to the latest version 6.2 that Ilya Zakharevich provides on his homepage.
After wading through tears and blood (well, it was more about different levels of fatigue) I felt strong enough to also finally merge "the other big branch"(tm) that Jonathan Rockway maintains for MooseX::Declare syntax enhancements.
The result is yet another branch mxd-perl6-merge on github. The leading version is ilyaz' (including useless whitespace left as is), then Perl6 adaptions, then MX::Declare which in turn also made some things more clever for the Perl6 changes.
If you ever tried one of the cperl-mode hacks for Perl6 or MooseX::Declare, please switch to this merge. It should work the same or even better for you. If not, report it to me.
I'd been glancing at the Git logs from time to time but haven't really checked this out until now. Is the intent to make something that's one mode for Perl5 + Moose + MooseX::Declare + Perl6?
From trying it out that seems to be the case. It renders all of the above. Obviously the Perl 6 part is much better, but I noticed a bunch of regressions on Perl 5 syntax that seemingly have to do with broken precedence rules.
E.g. on Hailo.pm it'll highlight
use Any::Moose
as ifAny
is a type keyword,qw( unless first last )
will highlightunless
andlast
as keywords. Regex highlighting seems to be completely broken (no special colors at all) etc.But this is a very interesting development. It's great that someone is doing a proper cperl-mode for modern Perl code and Perl 6. Where would you prefer bug reports for it to be sent?
Thanks for trying it.
My goal lately is indeed a version that works for the Perl "families", i.e., both modern Perl5 plus Perl6 and en passant probably also variants like Perlito and NQP.
I have some conditionals to influence when absolutely needed, like the whitespace after sigils which make interpreting subsequent braces very different. Some artifacts I decided to just live with them like keywords mostly from Perl6; but maybe it's worth to handle them special (my tuits are the only boundary).
I need to investigate where it broke your stuff, very often it's my Perl6 patches. If you (or others reading this) are on spare cycles and want to help narrow it down, then feel free to compare the latest on each of those branches: mx-declare, perl6-pugs, upstream-releases, mxd-perl6-merge - all on github.
And yes, I prefer bug reports, I just don't know where. I could upload to cpan and then use RT, but not sure, because cperl-mode originally belongs to IlyaZ. Does github provide reporting facilities beside the wiki? Suggestions welcome...
Using the GitHub issue tracker would be one option.
Regarding where it broke, it's fine in the mx-declare branch, which is what I usually run.
Strange that I never found this issue tracker...
I entered your issues there.
Very cool. This is almost getting me motivated enough to write code to enable/disable certain highlighting features based on the actual code that's being edited -- no "use MooseX::Declare", no "class" highlighting; no "use 5.010", no "say" and "given/when", etc. I haven't figured out a good way to do this yet, but it's clear that it's needed :)