How to in Python

Chris Mellon arkanes at gmail.com
Fri Dec 21 10:42:42 EST 2007


On Dec 21, 2007 7:25 AM,  <MartinRinehart at gmail.com> wrote:
>
>
> John Machin wrote:
> > Use a proper lexer written by somebody who knows what they are doing,
> > as has already been recommended to you.
>
> My lexer returns a MALFORMED_NUMBER token on '0x' or '0x '. Try that
> in Python.
>

Is there some reason that you think Python is incapable of
implementing lexers that do this, just because Python lexer accepts
it? Note that if you're using your lexer to mark up or pretty print or
whatever Python source, it's wrong - 0x is (rightly or not) a valid
Python literal.



More information about the Python-list mailing list