hinrik / perl6-mode

Emacs major mode for Perl 6
GNU General Public License v3.0
36 stars 4 forks source link

Add support for escaped quotes in regex #3

Open czipperz opened 9 years ago

czipperz commented 9 years ago

The way the regex parser currently works is good enough in most cases, but when you try to escape the start of a sting, or try to use <-[]>, then it breaks

token var1 { <[" a..r ]> }  # works correctly
token var1 { <-[" a..r ]> }  # rest of document is string
token var3 { <-[\" a..r ]> }  # rest of document is string
token var4 { <-['"' a..r ]> }  # works correctly but REJECTED BY PERL6

token quoted_string { \" .*? \" }  # rest of document is string
token quoted_string { '"' .*? '"' }  # works correctly

Please fix

hinrik commented 8 years ago

Currently, perl6-mode highlights all the contents of regexes and grammars in the same way as normal code, so they are mostly incorrectly highlighted (except by accident on occasion).

I'm working on syntax highlighting for nested constructs (strings, regexes, grammars, Q//, Pod), so I will address this soon.

bradclawsie commented 8 years ago

I have been impacted by this as well, although in the meantime, using '"' in place of \" has worked.

ufobat commented 7 years ago

i'd love to see this fixed soon.