MadcapJake / language-perl6fe

»ö« Atom Perl 6 Support - Forgotten Edition »ö«
https://github.com/perl6/atom-language-perl6
Other
16 stars 3 forks source link

'/' As a metaoperator breaks syntax highlighting #34

Open zoffixznet opened 8 years ago

zoffixznet commented 8 years ago

Issue Description

When division operator is used as a metaoperator ([/]) the stuff that follows it has broken syntax highlighting. Possibly because it gets interpreted as a regex start.

Example Code

grammar Ratifier {
    token TOP {
        [ <digits> '.' <digits> <.ws> <succ> ]+
    }
    token digits { \d+ }
    token succ   { <?> }
}

say [/] 1, 2, 3, 4;
my $x = 42;

class RatifierActions {
    has @!digits;
    method digits ($/) { @!digits.push: +$/ }
    method succ ($) {
        say "@!digits.join('.') can be written as {([/] @!digits).Rat}";
    }
}

Ratifier.parse: '2.55 ', actions => RatifierActions.new;

Picture

untitled