nickers / tinypy

Automatically exported from code.google.com/p/tinypy
Other
0 stars 0 forks source link

invalid (2.x) print statements parse but don't work #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. "print 'OK'"

What is the expected output? What do you see instead?
It should raise an exception since this isn't supported tinypy syntax. 
Instead it does nothing.  (It parses this as "print; 'OK'")

Here's a test case that should work:
t_render("""print 'OK'""","Exception")

Original issue reported on code.google.com by philhas...@gmail.com on 11 Jun 2008 at 3:02

GoogleCodeExporter commented 8 years ago
It would be swell if someone patched this... it'll take some bungling around in
parse.py to resolve.  I'd like this fixed since it apparently confuses people:

http://groups.google.com/group/tinypy/web/gotchas

Which is quite understandable as this is not good behavior.

Original comment by philhas...@gmail.com on 11 Jun 2008 at 3:03

GoogleCodeExporter commented 8 years ago
This is true for all functions, variables, or complete statements. If I had "3 
5" in
my program, tinypy would allow it and python would give a syntax error. It also 
means
one can chain statements in a very nasty way like "x=3 x+=1 y=4 print(x, y)" 
with no
newlines or semicolons. The real issue appears to be that any number of tokens 
that
can stand alone are being parsed, while they ought to require a newline or 
semicolon.

Original comment by ulf...@gmail.com on 13 Jun 2008 at 3:30

GoogleCodeExporter commented 8 years ago

Original comment by philhas...@gmail.com on 6 Sep 2008 at 7:23