469,271 Members | 1,787 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

pgen2 use questions.

I happened to stumble upon Guido's announcement of his python2 to
python3 refactoring tool earlier today
(http://mail.python.org/pipermail/pyt...r/005102.html),
and, after playing with it a bit, I have some use questions as I don't
quite understand how the pattern matching language works.

In some instances I cannot grok matching certain sorts of patterns,
sometimes very simple ones. For instance, how is the following
incorrect for matching pass statements?

pass_stmt< 'pass'>

If I wanted to insert "# Do nothing, and well." after each pass
statement how would the transformation work?

Why would this pattern not match function statements?

funcdef<
decorators < decs=any >
'def'
atom < def_name=NAME >
parameters < pars=any >
':'
suite < suite_content=any >
>
If I wanted to change the function name how would I do so? How about
parts of the function body?

Jan 10 '07 #1
0 771

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by softwareengineer2006 | last post: by
reply views Thread by connectrajesh | last post: by
8 posts views Thread by Krypto | last post: by
reply views Thread by ramu | last post: by
1 post views Thread by ramu | last post: by
reply views Thread by ramu | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.