Raku / atom-language

Atom/Github Raku Syntax Highlighting Support 🦋
Other
24 stars 11 forks source link

Q// highlight ignores adverbs #54

Open zoffixznet opened 7 years ago

zoffixznet commented 7 years ago

Don't know if this is too much to ask from a syntax highlighter, but I notice the Q// highlighting ignores the specified adverbs. So if you specify :s and :c, code blocks and scalars are still highlighted as regular strings. Makes it hard to spot them in a large heredoc.

Example Code

say Q:c/foo {"h" ~ "i"} bar/;
say qq /foo {"h" ~ "i"} bar/;

my $foo = 42;
say Q:s/foo $foo bar/;
say qq /foo $foo bar/;

Picture [optional]

untitled

Leave this in. For internal use.

zoffixznet commented 7 years ago

A related issue: embedded heredoc closing delimiter closes the first heredoc:

sub page ($routines) {
    Q:c:to/END/
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Perl 6 Routine Map</title>

<div class="container">
    <table id="routines"> {
        join "\n", $routines.map: qq:to/END/
        <tr>
        END
    }
    </table>
</div>

<script src="/packed/app-ee94204ae3189f6634650ad1ab13c95b.min.js"></script>
END
}

untitled


Even if the delimiter simply starts with the other's heredoc's delimiter: untitled

samcv commented 7 years ago

I only just recently got qq heredocs highlighting some variables. We can leave this ticket here, and apply it to the Q adverbs when I work on the qq heredocs again (was kinda difficult to get variables to highlight).