Support return statements without expressions #1

Merged
R167 merged 2 commits from master into master 2021-01-19 09:37:00 +01:00
R167 commented 2021-01-19 00:07:53 +01:00 (Migrated from github.com)

Currently the python grammar doesn't support/properly recognize a return statement with no return value.

Example:

foo(a, b):
  return # This is not correctly handled

The above is currently unsupported with the current grammar in lever-python.

Reference to cpython grammar:
github.com/python/cpython@c347cbe694/Grammar/python.gram (L198)
(more readable format on the official python docs, search for return_stmt)

Currently the python grammar doesn't support/properly recognize a return statement with no return value. Example: ```python foo(a, b): return # This is not correctly handled ``` The above is currently unsupported with the current grammar in lever-python. Reference to cpython grammar: https://github.com/python/cpython/blob/c347cbe694743cee120457aa6626712f7799a932/Grammar/python.gram#L198 (more readable format on the [official python docs](https://docs.python.org/3/reference/grammar.html), search for `return_stmt`)
marijnh commented 2021-01-19 09:38:57 +01:00 (Migrated from github.com)

Thanks! Released as 0.13.2

Thanks! Released as 0.13.2
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/python!1
No description provided.