bscan / RakuNavigator

Raku language support and language server
MIT License
50 stars 3 forks source link

The order of multiple Heredocs might be wrong in syntax #15

Closed clouds56 closed 1 year ago

clouds56 commented 1 year ago

According to the raku docs, this code should work

my ($first, $second) = qq:to/END1/, qq:to/END2/; 
  FIRST
  MULTILINE
  STRING
  END1
   SECOND
   MULTILINE
   STRING
   END2 
say $first;  # OUTPUT: «FIRST␤MULTILINE␤STRING␤»
say $second; # OUTPUT: «SECOND␤MULTILINE␤STRING␤»

while the syntax could only recognize (which could not compile)

my ($first, $second) = qq:to/END1/, qq:to/END2/; 
   SECOND
   MULTILINE
   STRING
   END2 
  FIRST
  MULTILINE
  STRING
  END1
say $first;  # OUTPUT: «FIRST␤MULTILINE␤STRING␤»
say $second; # OUTPUT: «SECOND␤MULTILINE␤STRING␤»
clouds56 commented 1 year ago

The interesting thing is that the Github seems only recognize wrong syntax as well

bscan commented 1 year ago

Hi @clouds56! Thanks for using the extension, I hope it's working well for you. For syntax highlighting, I mostly just copied the highlighting from here https://github.com/Raku/atom-language-perl6 . Looks like this issue is fairly similar: https://github.com/Raku/atom-language-perl6/issues/63 . Although the development in that repo is not very active, I think it's still good to centralize issues there.

Github has the same issue because it also uses that repo https://github.com/github/linguist/blob/master/vendor/README.md