Closed
Description
Example 1:
def test():
print()
# Comment
Error:
$ lpython --show-ast --new-parser examples/expr2.py
syntax error: Token '# Comment
' (of type 'comment') is unexpected here
--> examples/expr2.py:4:1
|
4 | # Comment
| ^^^^^^^^^^
Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that needs to be fixed).
Example 2:
def main():
print()
# Comment
Error:
$ lpython --show-ast --new-parser examples/expr2.py
syntax error: End of file is unexpected here
--> examples/expr2.py:5:1
|
5 |
| ^
Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that needs to be fixed).
Example 3:
def main():
print()
# Comment
return
$ lpython --show-ast --new-parser examples/expr2.py
syntax error: Token '# Comment
' (of type 'comment') is unexpected here
--> examples/expr2.py:3:1
|
3 | # Comment
| ^^^^^^^^^^
Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that needs to be fixed).