Git Product home page Git Product logo

atom-language's Introduction

Atom Raku Support - »ö« Official Edition!

apm package travis

A colorful, thoughtful, and helpful language grammar for Raku! See here for questions about usage.

A screenshot of an funnified Raku file

Integration

This package has integration with the Atom script package. With both this package and the script package you can execute highlighted Raku code or the whole document, even if it hasn't been saved using a keyboard shortcut.

What Makes This The Fun Edition?

Raku is optimized for fun. ― Audrey Tang

  • This package was designed to work with Fira Code ligatures

  • Much more syntax highlighted (numbers, operators, interpolation, traits, better strings)

  • Some day we hope this package will also contain support for many popular atom packages that have service hooks like autocomplete+ and linter

See something? Say something!

See something highlighted incorrectly? See something LTA (Less Than Awesome)? Please report it on the issue tracker. Any issue no matter how small should be reported. It is our hope that this is not only the best Raku highlighter for Atom, but the best highlighter for Atom out there.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for a tutorial on writing Atom syntax grammars and more information!

Potential Future Features

Integration with Autocomplete+, linter or other packages are possible future features. See Contributing if you want to help!

How do I use this?

This language grammar should automatically highlight .raku, .rakumod, .rakutest, .rakudoc, .nqp and legacy .p6, .pod6, .pm6 files. The language grammar will also detect files whose first line includes use v6, a shebang whose last term before any whitespace is raku , =begin pod, or my class.

If you are having issues, the language-perl package is probably taking precedence. To remedy this you can:

  • Click the language name in the status-bar (Ctrl+Shift+L) and select Raku

  • If you want to permanently change the preferences for a file type, add the following to your config.cson (EditConfig):

    "*":
      core:
        customFileTypes:
          'source.raku': [
            'p6'
            'pm6'
            # Add pm and t if you want auto choose this highlighter for .pm or .t
            # files.
            'pm'
            't'
          ]

Please be aware that if you do not include the t extension above, your t files will be highlighted with the language-perl highlighter unless the first line contains use v6;.

License

MIT © All contributors

atom-language's People

Contributors

2colours avatar jj avatar madcapjake avatar samcv avatar sumanstats avatar threadless-screw avatar tyil avatar vmg avatar zoffixznet avatar zostay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-language's Issues

`::` delimiters in class names are highlighted the same as the class

It is fine that they are tagged as part of the class name, but we need to additionally tag the :: themselves or they will end up being highlighted the same as the actual words in the name.

Example Code

my class X::Str::Sprintf::Directives::BadType { ... };

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

[Pod6] Tags don't highlight spanned lines

They work fine when they're on the same line, but when on separate lines they don't highlight.

Example Code

=begin pod
approach is the use of Unicode properties. They are called in the form C<<
<:property> >>, where C<property> 

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

Regexes in S/// s/// operators not highlighted

I'm on v1.11.2

The regexes in S/// and s/// operators seem to be not highlighted, or (like the <before>) highlighted differently.

Note that these operators can take adverbs (like S:g///) and there are some other forms for them (I always forms for them (like say S{foo} = {} given "foobar"; or say S ♥foo♥bar♥ with "foobar")

Example Code

 /<before \s+>/;
S/<before \s+>//;
s/<before \s+>//;

 /\s+\s+\s+\s+/;
S/\s+\s+\s+\s+//;
s/\s+\s+\s+\s+//;

Picture [optional]

z

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

multi sub highlights incorrectly

The sub part highlights as if it were the sub's name

Example Code

multi sub mkdir(Int:D $mode, *@dirnames --> List)
multi sub mkdir($path, $mode = 0o777 --> Bool)
method    mkdir(IO::Path:D: $mode = 0o777 --> Bool)

Picture [optional]

screenshot_20161222_124038

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

Angle bracket delimited keys in interpolated strings don't highlight

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

say "The capital of France is: %capitals<France>"

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

\\ in regex breaks highlights

I'm on 1.13.3.

Seems to be caused by \\ in regex (seems to not be broken on GitHub... unsure why)

Example Code

sub MAIN ( Str $app, Str :$w = 'lib,bin') {
    my @watchlist = $w.split: /<!after \\> \,/;
    s/\\\,/,/ for @watchlist;

    say "Attempting to boot up the app";
    my $p = bootup-app $app;
    react {
        whenever watch-recursive(@watchlist.grep: *.IO.e) -> $e {
            say "Change detected [$e.path(), $e.event()]. Restarting app";
            $p.kill;
            $p = bootup-app $app;
        }
    }
}

Picture [optional]

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests
    z

Private methods not highlighted correctly

I'm using v1.9.5

Issue Description

method !blah doesn't get highlighted. Making it public or making it a multi avoids the issue.

Example Code

    multi method stderr(Proc::Async:D: :$enc) {
        self!wrap-decoder:
            self!supply('stderr', $!stderr_supply, $!stderr_type, Chars).Supply,
            $enc
    }

    method !wrap-decoder(Supply:D $bin-supply, $enc) {
        Rakudo::Internals.BYTE_SUPPLY_DECODER($bin-supply, $enc // $!enc)
    }

    method !capture(\callbacks,\std,\the-supply) {
        my $promise = Promise.new;
        my $vow = $promise.vow;
        my $ss = Rakudo::Internals::SupplySequencer.new(
            on-data-ready => -> \data { the-supply.emit(data) },
            on-completed  => -> { the-supply.done(); $vow.keep(the-supply) },
            on-error      => -> \err { the-supply.quit(err); $vow.keep((the-supply,err)) });
        nqp::bindkey(callbacks,
            std ~ '_bytes' ,
            -> Mu \seq, Mu \data, Mu \err { $ss.process(seq, data, err) });
        $promise;
    }

Picture

untitled

in .match, single quoted things inside regex ruin highlighting

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

.match(/^.*  $subname/) # fine
.match(/^.* '/' $subname/) # nope

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Fancy-pants symbols in token:sym<> break highlights

I'm on 1.13.8

The token with :sym<💬> breaks highlights of code that follows it. I also notice that writing it as

token statement:sym<💬> {
   <sym> <.ws> <EXPR>
}

instead of all on one line as token statement:sym<💬> { <sym> <.ws> <EXPR> } avoids the issue.

EDIT: but I notice that even in multi-line version, putting a comment inside of it doesn't highlight the comment as the comment

Example Code

    proto token statement {*}
    token statement:sym<EXPR> { <EXPR> }
    token statement:sym<💬> { <sym> <.ws> <EXPR> }
    token statement:sym<fuc> { <sym> }

    proto token sign {*}
    token sign:sym<> { '−'  }
    token sign:sym<+> { '+'? }

    proto token value {*}
    token value:sym<string> { <?["']> <quote_EXPR: ':q'> }
    token value:sym<integer> { <sign> $<num>=\d+ }
    token value:sym<float>   { <sign> $<num>=[\d+ '.' \d+] }

Picture [optional]

z

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Two variables in a row don't allow dashes in the name

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

$reverse-solidus$reverse-solidus

Picture [optional]

screenshot_20170110_183239

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Syntax Highlighting on lines with < and > is wrong

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Syntax Highlighting on lines with < is wrong
on the web page the characters after a "<" up to the next ">" are in a single "span" and have a "string" class

Example Code

on https://docs.perl6.org/syntax/loop
(loop ( my $i = 0; $i++ < 3;) { $i * 2 }).say; #-> "(2 4 6)"

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

image

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests
  • Needs further fixes

Regex capture marker breaks highlights

I'm on v1.11.2

Opening regex capture marker breaks highlights until closing capture marker is seen, when used in a regex given to a method called with .foo() form, even though everything's fine when .foo: form call is used.

Example Code

say 'foo'.subst( / 'fo' <( 'o' /, 'x');
say "Hi"; # Opps broken highlights now )> # fixed now


say 'foo'.subst: / 'fo' <( 'o' /, 'x';
# Doesn't happen with this method call form tho

Picture [optional]

z

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Putting a sign on a factional number without whole part makes it not highlight as number

Putting a +, -, or U+2212 minus on a factional number without whole part makes it not highlight as number

Example Code

    is-deeply pb( '.42', 10),  .42, 'fractional without whole part';
    is-deeply pb('+.42', 10),  .42, 'fractional without whole part with +';
    is-deeply pb('-.42', 10), -.42, 'fractional without whole part with -';
    is-deeply pb('−.42', 10), -.42, 'fractional without whole part with U+2212';

Picture [optional]

untitled

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

Supplier type is not highlighted

See above.

Supplier # not highlighted
Supply # highlighted

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

.head and .chrs are not highlighted

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Would be nice if options were highlighted

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

=begin code :allow< B R >
    sub demo {
        B<say> 'Hello R<name>';
    }
=end code

Picture [optional]

screenshot_20161217_194037

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

In regex ^ doesn't highlight if followed by `.`

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

/^./ # nope
/^ ./ # shows up fine

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Arbitrary regex delimiters need tests.

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

m/ ^ this <[a]> /
m% ^ this <[a]>/

Picture [optional]

screenshot_20161219_120305

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

.max and :exists don't highlight

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

@array.max;
%hash{$key}:exists;

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

[Pod6] « » delimiters for tags do not work.

=begin pod
C«test» # valid (but not working)
C<<test>> # also valid (working)
C<test> # valid (working)

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

Method Calls at the end of a quoted string can run on

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

"$o.n()".s( ) ]);

Picture [optional]

screenshot_20161217_224238

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

qq:to heredocs don't highlight variables

See title.

Example Code

my $file =
    qq:to/END/;
    use v6;
    use Test;
    plan @array.elems();

    END

Picture [optional]

screenshot_20161223_141341

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Quotes in extended routine colonpairs mess up highlighting

P.S.: Found this one in roast. At the end of that file even if I place extra quotes into comments the highlighting is still messed up. Not sure if that's simply a fail in my attempt of unbreaking it or if there's something else that's messing them up

Example Code

sub circumfix:<x y> {} # this comment is good
sub circumfix:<w "> {} # this comment is not highlighted right
say 'hello " world'; # the `"` in the string fixes the messup

Picture [optional]

untitled

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

`regex` keyword as part of a sub name breaks highlighting

I'm on v1.11.1

regex keyword as part of a sub name breaks highlighting (see picture at end).

Example Code

    method quote:sym<s>($/) {
        # We are emulating Str.subst/subst-mutate here, by calling match, assigning the result to
        # a temporary variable etc.

        # Build the regex.
        my $rx_block := $*SUBST_LHS_BLOCK;
        $rx_block.push(QAST::Stmts.new);
        my %sig_info := hash(parameters => []);

        ###################################################
        ###################################################
        ###################################################
        ###################################################
        #⟱⟱⟱⟱ glitch seems to start on the next line, right after word `regex`⟱⟱⟱⟱
        ###################################################
        ###################################################
        my $rx_coderef := regex_coderef($/, $*W.stub_code_object('Regex'),
            $<sibble><left>.ast, 'anon', '', %sig_info, $rx_block, :use_outer_match(1));

        # Quote needs to be closure-i-fied.
        my $infixish := $<sibble><infixish>;
        my $right;
        if !$infixish || $infixish.Str eq '=' {
            $right := WANTED($<sibble><right>.ast,'quote:s///');
        }
        else {
            $right := $infixish.ast;
            $right.push(QAST::Op.new(
                :op('assign'),
                QAST::Op.new( :op('p6scalarfromdesc'), QAST::Op.new( :op('null') ) ),
                QAST::Var.new( :name('$/'), :scope('lexical') )
            ));
            $right.push(WANTED($<sibble><right>.ast,'quote:s'));
        }
        my $rep_block := $*SUBST_RHS_BLOCK;
        $rep_block.push(QAST::Stmts.new($right, :node($<sibble><right>)));
        $*W.cur_lexpad()[0].push($rep_block);
        my $closure := block_closure(reference_to_code_object(
            $*W.create_simple_code_object($rep_block, 'Code'),
            $rep_block));

        # self.match($rx_coderef, |%options);
        my $past := QAST::Op.new( :node($/), :op('callmethod'), :name('match'),
            WANTED(QAST::Var.new( :name('$_'), :scope('lexical') ),'s'),
            $rx_coderef
        );
        self.handle_and_check_adverbs($/, %SUBST_ALLOWED_ADVERBS, 'substitution', $past);
        if $/[0] {
            $past.push(QAST::IVal.new(:named('samespace'), :value(1)));
        }

        my $samespace := +$/[0];
        my $sigspace := $samespace;
        my $samecase := 0;
        my $samemark := 0;
        my $global   := 0;
        for $<rx_adverbs>.ast {
            if $_.named eq 'samecase' || $_.named eq 'ii' {
                $samecase := 1;
            }
            elsif $_.named eq 'samemark' || $_.named eq 'mm' {
                $samemark := 1;
            }
            elsif $_.named eq 'global' || $_.named eq 'g' {
                $global := 1;
            }
            elsif $_.named eq 'samespace' || $_.named eq 'ss' {
                $samespace := 1;
                $sigspace := 1;
            }
            elsif $_.named eq 'sigspace' || $_.named eq 's' {
                $sigspace := 1;
            }
        }

        my $result        := $past.unique('subst_result');
        my $global_result := $past.unique('subst_global_result');
        my $List          := $*W.find_symbol(['List']);

        my $apply_matches := QAST::Op.new( :op('callmethod'), :name('dispatch:<!>'),
            QAST::Op.new( :op('callmethod'),  :name('Str'),
                WANTED(QAST::Var.new( :name('$_'), :scope('lexical') ),'s/apply') ),
            QAST::SVal.new( :value('APPLY-MATCHES') ),
            QAST::WVal.new( :value($*W.find_symbol(['Str'])) ),
            QAST::Var.new( :name($result), :scope('local') ),
            $closure,
            QAST::Var.new( :name('$/'), :scope('lexical') ), # caller dollar slash
            QAST::IVal.new( :value(1) ),                     # set dollar slash
            QAST::IVal.new( :value($sigspace) ),
            QAST::IVal.new( :value($samespace) ),
            QAST::IVal.new( :value($samecase) ),
            QAST::IVal.new( :value($samemark) ),
        );

        $past := QAST::Op.new( :op('locallifetime'), :node($/),
            QAST::Stmt.new(

                # my $result;
                QAST::Var.new( :name($result), :scope('local'), :decl('var') ),

                # $result := self.match(...
                QAST::Op.new( :op('bind'),
                    QAST::Var.new( :name($result), :scope('local') ),
                    $past
                ),

                QAST::Op.new( :op('p6store'),
                    QAST::Var.new( :name('$/'), :scope('lexical') ),
                    QAST::Var.new( :name($result), :scope('local') ),
                ),

                # It matched something. Either a single item or a list of matches.
                QAST::Op.new( :op('if'),
                    QAST::Op.new( :op('unless'),# :name('&infix:<||>'),
                        QAST::Op.new( :op('istype'),
                            QAST::Var.new( :name($result), :scope('local') ),
                            QAST::WVal.new( :value($*W.find_symbol(['Match'])) )
                        ),
                        QAST::Op.new( :op('if'),
                            QAST::Op.new( :op('istype'),
                                QAST::Var.new( :name($result), :scope('local') ),
                                QAST::WVal.new( :value($*W.find_symbol(['Positional'])) )
                            ),
                            QAST::Op.new( :op('callmethod'), :name('elems'),
                                QAST::Var.new( :name($result), :scope('local') )
                            )
                        )
                    ),

                    QAST::Op.new( :op('call'), :name('&infix:<=>'),
                        WANTED(QAST::Var.new( :name($<sym> eq 's' ?? '$_' !! '$/'), :scope('lexical') ),'s/assign'),
                        $apply_matches
                    ),
                    ( $<sym> eq 'S'
                        ?? QAST::Op.new( :op('p6store'),
                                QAST::Var.new( :name('$/'), :scope('lexical') ),
                                WANTED(QAST::Var.new( :name('$_'), :scope('lexical') ),'S'),
                           )
                        !! QAST::Stmt.new()
                    ),
                ),

                # It will return a list of matches when we match globally, and a single
                # match otherwise.
                $<sym> eq 's' ?? (
                    $global ??
                    QAST::Op.new( :op('p6store'),
                        QAST::Var.new( :name('$/'), :scope('lexical') ),
                        QAST::Stmts.new(
                            QAST::Op.new( :op('bind'),
                                QAST::Var.new( :name($global_result), :scope('local'), :decl('var') ),
                                QAST::Op.new( :op('callmethod'), :name('CREATE'),
                                    QAST::WVal.new( :value($List) )
                                )
                            ),
                            QAST::Op.new( :op('bindattr'),
                                QAST::Var.new( :name($global_result), :scope('local') ),
                                QAST::WVal.new( :value($List) ),
                                QAST::SVal.new( :value('$!reified') ),
                                QAST::Op.new( :op('getattr'),
                                    QAST::Var.new( :name($result), :scope('local') ),
                                    QAST::WVal.new( :value($List) ),
                                    QAST::SVal.new( :value('$!reified') )
                                )
                            ),
                            QAST::Var.new( :name($global_result), :scope('local') )
                        )
                    ) !! QAST::Stmt.new()
                ) !! QAST::Stmt.new(),

                # The result of this operation.
                QAST::Var.new( :name('$/'), :scope('lexical') )
            ),
        );
        $past.annotate('is_S', $<sym> eq 'S');
        make WANTED($past, 's///');  # never carp about s/// in sink context
    }

Picture [optional]

untitled

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

« » angle bracket word quoting does not highlight.

Describe what you see, what you want to see, and perhaps some linkage to docs, synopses, or irclog chatter.

Example Code

«a b c» # no highlight
<a b c> # highlight

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

Variables don't highlight correctly if they contain any non-ASCII characters

Variables don't highlight correctly if they contain any non-ASCII characters. Pic attached. Screen shot using Atom editor with Perl 6 FE v1.13.1, One Dark theme.

Example Code

$ΔxAB
$ABΔx
$S𝐼
@n⃗

Picture [optional]

atom-highlight

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Methods are sometimes highlighted as keywords

As the subject says, methods are sometimes highlighted as keywords. See these lines taken from https://docs.perl6.org/language/concurrency :

Example Code

my $p2 = Promise.new;
$p2.break('oh no');

my $promise1 = Promise.in(5);
my $promise2 = $promise1.then(-> $v { say $v.status; 'Second Result' });
say $promise2.result;

my $promise = Promise.start({ die "Broken Promise" });

try $promise2.result;

Note how .break and .start are highlighted differently from .in, .then, and .result -- and the same as try. This is easier to see on docs.perl6.org than on GitHub due to stylesheet differences.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Putting spaces around / division operator breaks highlights

Putting spaces around / division operator breaks highlights

Example Code

# This block is OK, because 1/4 ain't got spaces between the operator and the numbers
isa-ok(Rat.new(1,4), Rat, "Rat.new makes a Rat");
isa-ok(1/4, Rat, "/ makes a Rat");
isa-ok( 1.Int.Rat, Rat, "cast of Int makes a Rat");
isa-ok( 1.Num.Rat, Rat, "cast of Num makes a Rat");

# This one blows up because there are spaces between 1, /, and 4
isa-ok(Rat.new(1,4), Rat, "Rat.new makes a Rat");
isa-ok(1 / 4, Rat, "/ makes a Rat");
isa-ok( 1.Int.Rat, Rat, "cast of Int makes a Rat");
isa-ok( 1.Num.Rat, Rat, "cast of Num makes a Rat");

Picture [optional]

untitled

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Fully qualified method names not highlighted

Issue Description

I'm on v1.9.7

Fully qualified method names not highlighted. I expected them to be highlighted same as normal methods (or fancier).

.List::perl in the code below is not highlited.

Example Code

augment class List {
    multi method perl2(List:D:) {
        self.List::perl;
        self.perl;
    }
}

Picture

z

Negative 0* numbers not highlighted same as positive ones

I'm on v1.11.1

Negative 0* numbers not highlighted same as positive ones

Example Code

say  0xDEADBEEF;
say -0xDEADBEEF;
say  0b010;
say -0b010;
say  0o010;
say -0o010;

Picture [optional]

untitled

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

[Pod6] X< > is not highlighted.

Example Code

=begin pod
X<thing>
L<thing>

Picture [optional]

screenshot_20161217_151028

Leave this in. For internal use.

  • Fixed in Master
  • Has Tests
  • Passes Tests

==> creates two tokens

Causes problem with Fira Code ligatures and should make sure it is one token

Example Code

==>

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

:sym<> for protoregex actions methods not highlighted

  • Working in master

Taken from: MadcapJake/language-perl6fe#32

Issue Description

The :sym<> adverb is specially highlighted on tokens and rules when used inside regexes,
but it's highlighted as a normal name when used in the actions class. It would be useful to highlight it specially there as well:

Example Code

grammar Calculator {
    token TOP { <calc-op> }

    proto rule calc-op          {*}
          rule calc-op:sym<add> { <num> '+' <num> }
          rule calc-op:sym<sub> { <num> '-' <num> }

    token num { \d+ }
}

class Calculations {
    method TOP              ($/) { make $<calc-op>.made; }
    method calc-op:sym<add> ($/) { make [+] $<num>; }
    method calc-op:sym<sub> ($/) { make [-] $<num>; }
}

say Calculator.parse('2 + 3', actions => Calculations).made;

0763ff5a-3f78-11e6-9db2-7e76e9306390

Leave this in. For internal use.

  • Has Tests
  • Tests Pass

Lower smartquotes mess up highlighting

Example Code

my $s = sub ($a, $b) { $a + $b };
say $s.WHAT;        # (Sub) 
say $s(2, 5);       # 7 
 
sub postfix:<>($a){ say I love $a! }
42♥;
# OUTPUT«I love 42!␤»
sub postcircumfix:<⸨ ⸩>(Positional $a, Whatever){ say $a[0], '', $a[*-1] }
[1,2,3,4]⸨*⸩;
# OUTPUT«1…4␤»
constant term:<> = ""; # We don't want to quote "love", do we?
sub circumfix:<α ω>($a){ say $a is the beginning and the end. };
α♥ω;
# OUTPUT«♥ is the beginning and the end.␤»

Picture [optional]

untitled

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

`proto method foo` does not highlight

Had this happen with multi sub I think. Same thing as before. Need to fix it and write some tests so this does not break.

Example Code

proto method rename(|) { * }

Picture [optional]

Providing a picture means that if the issue is fixed and linguist updates to include the fix (linguist uses this package to highlight Perl 6 on GitHub), your issue will remain historically viewable.

Leave this in. For internal use.

  • Fixed in Master
  • Fixed in Release
  • Has Tests
  • Passes Tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.