MadcapJake / language-perl6fe

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

Test functions #29

Closed hankache closed 8 years ago

hankache commented 8 years ago

test As shown in the screen shot, the test functions cmp-ok, can-ok and does-ok are not highlighted. In addition the function is is being highlighted as if it was a trait.

MadcapJake commented 8 years ago

I could make is highlight as a function when it's the first thing on a line (or preceded by an opening delimiter). I don't want to lose is being highlighted as a keyword when applying traits. Though perhaps it would look alright as a function. I'll do some experimenting.

MadcapJake commented 8 years ago

However, what if someone has their function declaration separated over a few lines:

sub foo(Str $a, Str $b, Int $c)
    is rw
    is export
{
    $a ~ $b + $c
}

That would highlight is as a function if I followed the heuristic described in my previous comment.

MadcapJake commented 8 years ago

@hankache after some consideration, I can't think of a good rule for when is is a trait_mod op and when it's a Test function. Let me know if you think of something that could work.