Commit 8053e0e
committed
Python: Allow
That is, the `*T` in `def foo(*args : *T): ...`.
This is apparently a piece of syntax we did not support correctly until
now.
In terms of the grammar, we simply add `list_splat` as a possible
alternative for `type` (which could previously only be an `expression`).
We also update `python.tsg` to not specify `expression` those places (as
the relevant stanzas will then not work for `list_splat`s).
This syntax is not supported by the old parser, hence we only add a new
parser test for it.list_splats as type annotations1 parent fcec8e0 commit 8053e0e
File tree
4 files changed
+49
-6
lines changed- python/extractor
- tests/parser
- tsg-python
- tsp
4 files changed
+49
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3169 | 3169 | | |
3170 | 3170 | | |
3171 | 3171 | | |
3172 | | - | |
| 3172 | + | |
3173 | 3173 | | |
3174 | 3174 | | |
3175 | 3175 | | |
3176 | | - | |
| 3176 | + | |
3177 | 3177 | | |
3178 | 3178 | | |
3179 | 3179 | | |
| |||
3228 | 3228 | | |
3229 | 3229 | | |
3230 | 3230 | | |
3231 | | - | |
| 3231 | + | |
3232 | 3232 | | |
3233 | 3233 | | |
3234 | 3234 | | |
| |||
3245 | 3245 | | |
3246 | 3246 | | |
3247 | 3247 | | |
3248 | | - | |
| 3248 | + | |
3249 | 3249 | | |
3250 | 3250 | | |
3251 | 3251 | | |
| |||
3259 | 3259 | | |
3260 | 3260 | | |
3261 | 3261 | | |
3262 | | - | |
| 3262 | + | |
3263 | 3263 | | |
3264 | 3264 | | |
3265 | 3265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
963 | 963 | | |
964 | 964 | | |
965 | 965 | | |
966 | | - | |
| 966 | + | |
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
| |||
0 commit comments