-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
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
Incorrect parsing behaviour with assignment expressions #89
Comments
Thanks for listing all the cases! While this list will definitely help for another cause, most of them are not bugs in the way you think they are. The parser does not list all syntax errors. If you want to list all syntax errors, please use:
The first case is definitely a bug that might be harder to fix. The other ones, might be quite easy. If you want to try yourself, you're very welcome :) If you want to fix this stuff, it's in
It helps to look at the Python grammar to do these. |
Get all errors from parso, as hints from davidhalter/parso#89
Get all errors from parso, as hints from davidhalter/parso#89
Get all errors from parso, as hints from davidhalter/parso#89
Oki 😊 I've made the pull request at #90 |
Should be fixed by #90. |
Benjamin Woodruff (1): Make pgen2's grammar ambiguity detection handle more cases Dave Halter (15): Refactor the ambiguity tests a bit, see #70 Make is_definition work on setitem modifications, see #66 Add include_setitem for get_defined_names, is_definition and get_definition Fix is_definition test Some minor refactorings for #90 Make sure that function executions are errors as well, see #90 Fix: Catch some additional cases named expr errors, see #89, #90 Add Python 3.8 to tested environments for tox Fix: Add more cases for named expression errors, see #89, #90 Whitespace changes Use Python 3.8 on travis for testing Use a lower pytest version so python3.4 is able to pass Add information about named expressions (#90) to the Changelog Prepare the next release v0.5.2 Add a release date to the Changelog Ian Tabolt (1): Remove debug print statement Jarry Shaw (4): Fixing davidhalter/parso#89 Deal with nested comprehension Revised implementation * moved all namedexpr_test related rules to `_NamedExprRule` Naglis (1): Fix typo (#84) Robin Fourcade (1): Fix trailing comma error Thomas A Caswell (1): ENH: update grammar for py39 (#78) yangyang (2): fixed #86 and #87 spelling
Recently, we encountered several issues with
parso
when implementing a backport compiler for assignment expressions.:=
formatter produces incorrect SyntaxErrorNB: all codes are running under Python 3.8.0; actual behaviours are running through
parso.parse(code, error_recovery=False, version='3.8')
.Case 1
Source code:
f'{x:=5}'
Expected behaviour: valid, passes
=5
to formatterActual behaviour:
Case 2
Source code:
Expected behaviour:
Actual behaviour: parsed as valid code
Case 3
Source code:
Expected behaviour:
Actual behaviour: parsed as valid code
Case 4
Source code:
Expected behaviour:
Actual behaviour: parsed as valid code
Case 5
Source code:
Expected behaviour:
Actual behaviour: parsed as valid code
Case 6
Source code:
Expected behaviour:
Actual behaviour: parsed as valid code
Case 7
Source code:
Expected behaviour:
Actual behaviour: parsed as valid code
The text was updated successfully, but these errors were encountered: