Case sensitivity
Piet van Oostrum
piet at cs.uu.nl
Sun Feb 23 10:51:17 EST 2003
>>>>> Dennis Lee Bieber <wlfraed at ix.netcom.com> (DLB) wrote:
DLB> in which the only thing differentiating the loop from the assignment is
DLB> the "," vs "."... Makes for ugly parsing as no matter which choice is
DLB> the default path, the other path requires massive backtracking: (loop
DLB> favored: token do, token 10, token i, token = token 2, token . <whoops>
DLB> back up and combine do 10 i into one token)
IIRC, it's just a simple scan. There is only a problem if it contains an =
sign (outside of string), and then if later it contains a comma outside of
parentheses (and outside of string), it could be a DO, otherwise it is an
assignment. As you would have to count parentheses it can't just be done with
a regexp.
--
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl
More information about the Python-list
mailing list