Dhruv Manilawala
7cb2619ef5
Add syntax error for empty type parameter list ( #12030 )
...
## Summary
(I'm pretty sure I added this in the parser re-write but must've got
lost in the rebase?)
This PR raises a syntax error if the type parameter list is empty.
As per the grammar, there should be at least one type parameter:
```
type_params:
| invalid_type_params
| '[' type_param_seq ']'
type_param_seq: ','.type_param+ [',']
```
Verified via the builtin `ast` module as well:
```console
$ python3.13 -m ast parser/_.py
Traceback (most recent call last):
[..]
File "parser/_.py", line 1
def foo[]():
^
SyntaxError: Type parameter list cannot be empty
```
## Test Plan
Add inline test cases and update the snapshots.
2024-06-26 08:10:35 +05:30
..
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-06-03 18:23:50 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-19 16:46:15 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-06-17 06:47:00 +00:00
2024-06-17 06:47:00 +00:00
2024-06-17 06:47:00 +00:00
2024-06-17 06:47:00 +00:00
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-23 04:19:05 +00:00
2024-04-23 04:19:05 +00:00
2024-04-23 04:19:05 +00:00
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-06-03 18:23:50 +05:30
2024-06-03 18:23:50 +05:30
2024-06-03 18:23:50 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-06-03 18:23:50 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-19 11:36:26 +00:00
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-26 09:47:29 +02:00
2024-04-26 09:47:29 +02:00
2024-04-26 09:47:29 +02:00
2024-04-26 09:47:29 +02:00
2024-04-18 17:57:39 +05:30
2024-04-26 09:47:29 +02:00
2024-04-26 09:47:29 +02:00
2024-06-26 08:10:35 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-04-18 17:57:39 +05:30
2024-06-06 08:59:56 +00:00
2024-04-18 17:57:39 +05:30