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

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

Thread Previous | Thread Next
From:
Philip Newton
Date:
November 23, 1999 23:39
Subject:
Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"
Message ID:
Pine.LNX.4.04.9911240313310.18828-100000@ficus.frogspace.net
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?

Cheers,
Philip
-- 
Philip Newton <newton@newton.digitalspace.net>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About