We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print >> filelike
The new AST parser acts strange on print on some case (not all):
print
# tst.py import StringIO sio = StringIO.StringIO() print 'foo' print >> sio, 'foo' print >>sio, 'foo' print >> sio, 'foo', print >>sio, 'foo', print print >> sio print >>sio
CPython reference:
$ cat tst.py | python - foo $
Before change to pythonparser
$ git checkout c7f97e72452ff91b906c9edabdec0024e9078470 $ cat tst.py | make run foo foo foo foo foo $
After moving pythonparser into grumpy
$ git checkout 0def2c25b977bbc200f5797f67ec8ca328893735 $ cat tst.py | make run <unknown>:10:13-11:1: fatal: unexpected newline: expected !=, %, &, (, *, **, +, -, ., /, //, <, <<, <=, <>, ==, >, >=, >>, @, [, ^, and, if, in, is, not, or or | print >> sio ^ Traceback (most recent call last): File "/Users/alanjds/src/git/grumpy/build/bin/grumpc", line 118, in <module> sys.exit(main(parser.parse_args())) File "/Users/alanjds/src/git/grumpy/build/bin/grumpc", line 53, in main mod = pythonparser.parse(py_contents) File "/Users/alanjds/src/git/grumpy/build/lib/python2.7/site-packages/grumpy/pythonparser/__init__.py", line 59, in parse mode, flags, version, engine) File "/Users/alanjds/src/git/grumpy/build/lib/python2.7/site-packages/grumpy/pythonparser/__init__.py", line 29, in parse_buffer return parser.file_input(), lexer.comments File "/Users/alanjds/src/git/grumpy/build/lib/python2.7/site-packages/grumpy/pythonparser/parser.py", line 89, in outer_rule result = inner_rule(parser) File "/Users/alanjds/src/git/grumpy/build/lib/python2.7/site-packages/grumpy/pythonparser/parser.py", line 151, in rule parser.diagnostic_engine.process(error) File "/Users/alanjds/src/git/grumpy/build/lib/python2.7/site-packages/grumpy/pythonparser/diagnostic.py", line 165, in process raise Error(diagnostic) grumpy.pythonparser.diagnostic.Error: <unknown>:10:13-11:1: fatal: unexpected newline: expected !=, %, &, (, *, **, +, -, ., /, //, <, <<, <=, <>, ==, >, >=, >>, @, [, ^, and, if, in, is, not, or or | print >> sio ^ make: *** [run] Error 1
The text was updated successfully, but these errors were encountered:
Comment by trotterdylan Tuesday Apr 25, 2017 at 03:56 GMT
Ah, bummer. Thanks for the report. Would you mind filing this up stream in pythonparser? It should be pretty straightforward to fix.
Sorry, something went wrong.
Comment by alanjds Tuesday Apr 25, 2017 at 14:42 GMT
No problem. Will post there: http://github.com/m-labs/pythonparser
Nudge me if is the wrong place.
No branches or pull requests
The new AST parser acts strange on
print
on some case (not all):CPython reference:
$ cat tst.py | python - foo $
Before change to pythonparser
$ git checkout c7f97e72452ff91b906c9edabdec0024e9078470 $ cat tst.py | make run foo foo foo foo foo $
After moving pythonparser into grumpy
The text was updated successfully, but these errors were encountered: