A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-August/102915.html below:

[Python-Dev] Adding a token

[Python-Dev] Adding a token [Python-Dev] Adding a tokenGreg Ewing greg.ewing at canterbury.ac.nz
Sun Aug 8 03:41:56 CEST 2010
I'm trying to add a '?' token to the parser, and weird things
are happening.

I've added a #define to token.h, an entry to _PyParser_TokenNames
in tokenizer.c and case for it in PyToken_OneChar(). But it's
behaving as though the tokenizer is not recognising my token.

I put in some printfs to find out whether PyToken_OneChar() is
recognising it. The results are confusing: while running
pgen, PyToken_OneChar() is being called and recognising the
new token correctly.

However, it doesn't seem to be getting called *at all* when
parsing Python code. I don't see how this can happen, because
pgen seems to use the same tokenizing code as Python itself.

Is there anything else I need to do? Does some file need
to be manually re-made?

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4