Andrew Gallant
6a1fa4778f
Reject more syntactically invalid Python programs ( #8524 )
...
## Summary
This commit adds some additional error checking to the parser such that
assignments that are invalid syntax are rejected. This covers the
obvious cases like `5 = 3` and some not so obvious cases like `x + y =
42`.
This does add an additional recursive call to the parser for the cases
handling assignments. I had initially been concerned about doing this,
but `set_context` is already doing recursion during assignments, so I
didn't feel as though this was changing any fundamental performance
characteristics of the parser. (Also, in practice, I would expect any
such recursion here to be quite shallow since the recursion is done on
the target of an assignment. Such things are rarely nested much in
practice.)
Fixes #6895
## Test Plan
I've added unit tests covering every case that is detected as invalid on
an `Expr`.
2023-11-07 07:16:06 -05:00
..
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-07-27 09:29:11 +00:00
2023-07-27 09:29:11 +00:00
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-08-07 16:36:02 +00:00
2023-08-07 16:36:02 +00:00
2023-08-07 16:36:02 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-08-07 16:36:02 +00:00
2023-10-30 12:13:23 +05:30
2023-08-07 16:36:02 +00:00
2023-08-07 16:36:02 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-11-07 07:16:06 -05:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-29 02:55:39 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-10-01 07:58:20 +05:30
2023-10-01 07:58:20 +05:30
2023-10-01 07:58:20 +05:30
2023-10-03 19:38:03 +05:30
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-10-05 23:12:09 +05:30
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-25 15:13:21 +00:00
2023-09-25 15:13:21 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-28 20:38:06 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-25 11:45:44 +01:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-09-11 19:12:46 +00:00
2023-08-07 16:36:02 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-08-17 14:34:05 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-07-27 09:29:11 +00:00
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-08-18 15:34:54 +00:00
2023-07-27 09:29:11 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 14:42:15 +01:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-09-29 02:55:39 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-09-29 02:55:39 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-09-29 02:55:39 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-09-29 02:55:39 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-08-14 13:46:54 +00:00
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-10-30 12:13:23 +05:30
2023-08-14 13:46:54 +00:00