You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Statement parsing algorithm should be change #3882
Here, the first pattern in invalid_group is related to SyntaxError of del (*x) (pr #3879)
It should print cannot use starred expression here, but without group expression it makes cannot delete starred.
In parser/src/python.lalrpop at line 956, only tuple, yield, genexp are parsed.
Even, parenthesized-form is missing.
I think, we need to make group expression to parse parenthesized-form and handle error about starred epression,
or add equivalent parsing grammar into atom parser
I re-change my opinion.
It is right that missing a group expression is a problem.
In CPython, the expression (*x) raises SyntaxError in statement parsing level.
However, in RustPython, we need to handle it in each statement block level which is too handy
In RustPython, Tuple takes items even if the result is a singleton not a tuple.
We should stop using GenericList to Tuple, and add error handling code.
Activity
[-]Expression Kind `Group` missing[/-][+]Parenthesized-form Expression missing[/+][-]Parenthesized-form Expression missing[/-][+]Expression kind `group` missing[/+]key262yek commentedon Jul 14, 2022
Since
groupis not actual expression kind, it is better to add equivalent parsing method for both parenthesized forms and starred expression[-]Expression kind `group` missing[/-][+]Expression kind `parenth_form` missing[/+]key262yek commentedon Jul 15, 2022
I think it is my mistake.
followings are all fine, so parenth_form and starred expression works.
Hence it's just about error in del statement.
key262yek commentedon Jul 15, 2022
I re-change my opinion.
It is right that missing a group expression is a problem.
In CPython, the expression
(*x)raises SyntaxError in statement parsing level.However, in RustPython, we need to handle it in each statement block level which is too handy
In CPython,
But, in RustPython
because they decide the SyntaxError of
(*x)after compiler move into statement blockIn CPython, tuple expression matches when at least one comma
,exists.they handle the singleton in parenthesis using group expression, and raise syntax error while parsing it.
In RustPython, Tuple takes items even if the result is a singleton not a tuple.
We should stop using GenericList to Tuple, and add error handling code.
[-]Expression kind `parenth_form` missing[/-][+]Statement parsing algorithm should be change[/+]key262yek commentedon Jul 20, 2022
It is resolved by pr #3879
youknowone commentedon Jul 20, 2022
we usually manage it opposite way. adding
fix #3882to the PR make it automatically close this issue when it is merged.key262yek commentedon Jul 20, 2022
@youknowone Thanks for notice. then I need to reopen another one the pr will fix