Vinay Sajip
2011-12-13 22:56:37 UTC
I'm trying to write a custom lib2to3 fixer which, when processing the source
x = b'foo' b'bar'
will match the right hand side of the expression. From what I can see I should
be able to match it with 'atom' or 'power', but it doesn't seem to match either
of those. The individual byte-string tokens are matched using STRING, as
expected.
What should I use to match the right-hand side, for example if I want to do
constant folding and transform to something like b'foobar'?
Regards,
Vinay Sajip
x = b'foo' b'bar'
will match the right hand side of the expression. From what I can see I should
be able to match it with 'atom' or 'power', but it doesn't seem to match either
of those. The individual byte-string tokens are matched using STRING, as
expected.
What should I use to match the right-hand side, for example if I want to do
constant folding and transform to something like b'foobar'?
Regards,
Vinay Sajip