superwhiskers / raku.kak

raku syntax highlighting for kakoune
BSD Zero Clause License
5 stars 3 forks source link

improve quoting #1

Open dontlaugh opened 1 year ago

dontlaugh commented 1 year ago

Raku has nifty heredoc strings in the Quote sub language

my $friend = q:to/HELLO/;

cool
  dude

HELLO

sub hello() {
  say $friend;
}

hello 

The heredoc delimiters ("HELLO" in this case) can be arbitrary.

Full support for all of the interpolation styles will be complicated, but I think we can make a little improvement on our status quo with this highlighter rule.

add-highlighter -override shared/raku/heredoc_strings region \
  -match-capture '(?:q|qq|Q):to/([a-zA-Z]+)/' '([a-zA-Z]+)\h*' fill string
superwhiskers commented 1 year ago

alright. i'll add this when i get the time (within 3 days)

superwhiskers commented 1 year ago

or, if you'd like to, open a pull request

dontlaugh commented 1 year ago

I opened https://github.com/superwhiskers/raku.kak/pull/2

I'll keep hacking on other scenarios. I'm pretty into raku these days.

superwhiskers commented 1 year ago

alright. thanks

superwhiskers commented 1 year ago

this issue can track further improvements. i believe the reason i didn't bother with this was because covering all cases would be complex and i didn't plan on using them in the codebase i was working on. here's more info, though. i assume you've already been looking at this, however

https://docs.raku.org/language/quoting