Discussion:
Pending updates to Perl lexer for versions 5.20 and 5.18
(too old to reply)
KHMan
2014-06-06 02:35:26 UTC
Permalink
Hi all,

A brief update. I am looking to update the Perl lexer for Perl
5.20 and 5.18 in the near future. Perl 5.20 has just been
released. I will post a ticket to SF later but the following are
what I've found that needs work on. No big breakage AFAIK.

Perl 5.18
=========

Nothing to do. The closest thing to highlighting breakage is the
following substitution which is now illegal in 5.18:

# Stricter parsing of substitution replacement

%_=(_,"Just another ");
$_="Perl hacker,\n";
s//_}->{_/e;print

I think I'll just leave this be for now...

Perl 5.20
=========

Breakage mainly to do with subroutine prototypes due to
introduction of subroutine signatures (currently experimental).
Like this:

sub foo ($left, $right) { # mandatory positional parameters
return $left + $right;
}

And so on. Some minor breakage like this:

sub foo ($thing, @) { # nameless slurpy parameter
print $thing;
}

The @ is an array placeholder for slurping additional parameters
to foo, so it should be highlighted as an array. Ditto for %.

Subroutine signatures overrides subroutine prototypes when enabled
but the latter can be used via addition of an attribute:

sub foo :prototype($) { $_[0] }

Ouch. The attribute also allows whitespace around it and the
colon. There are also other attributes, e.g. lvalue.

Subroutine prototypes now also allows whitespace in them. This
breaks the current proto scanner.

sub foo ( $ $ ) {}

There is also some kind of experimental Postfix dereferencing thingy:

$sref->$*; # same as ${ $sref } # interpolates
$aref->@*; # same as @{ $aref } # interpolates
$href->%*; # same as %{ $href }
$cref->&*; # same as &{ $cref }
$gref->**; # same as *{ $gref }
$aref->$#*; # same as $#{ $aref }

Wha... I'll also leave this bit be for now...
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...