A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2010-August/102917.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 04:43:48 CEST 2010
Benjamin Peterson wrote:

> Why do you even have to add a new token? You can just put the literal
> '?' in the grammar.

I don't see how that can be sufficient. All the other tokens
have entries in the three places I mentioned, and there's
no way that pgen can generate those automatically just from
seeing a '?' in the grammar.

I just tried an experiment -- I changed the grammar to accept
'?' as an alternative to '+', and tried to use the parser
module to parse "1?2". It reported a SyntaxError.

-- 
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