develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"

Thread Previous | Thread Next
Philip Newton
November 23, 1999 23:39
Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"
Message ID:
On Tue, 23 Nov 1999, Larry Wall wrote:

> Philip Newton writes:
> : Not quite. I want '\\' to be translated to \ in a previous pass, before
> : the \c mechanism sees it. After the '\\' -> \ pass, I want left-to-right.
> It would have to be done in the same pass, by pretending that \c is a
> funny kind of \.

Is this then where the current problem comes from? "\c\\" gets parsed
left-to-right, and if \c is a funny escape sign, then we have the "token"
\c + backslash, followed by another backslash. \c + backslash is converted
to ^\, and the final backslash stays chr(92). The parser (lexer?) never
sees "\\" to convert to one backslash because the first backslash is
already eaten by the \c "escape".

Maybe some magic, then, which makes "\c\\" into one token, which gets
eaten whole by the "maximal munch" strategy?

Philip Newton <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About