Commit 1cedab1
authored
Fix parsing of parenthesized JSDoc parameters (microsoft#25799)
* Fix parsing of parenthesized JSDoc parameters
Parenthesis can start a jsdoc function parameter since it is just a
type, and parenthesis can start a type:
```js
/** @type {function(((string))): void} */
```
However, this is not legal in other parameter lists:
```ts
function x((((a))): string) { }
```
This change makes jsdoc function parameter lists parse differently than
normal parameter lists by allowing parenthesis as a start character of
jsdoc parameters.
* Parse nested uses of jsdoc function types
* Fix test1 parent 46827f4 commit 1cedab1
7 files changed
Lines changed: 69 additions & 5 deletions
File tree
- src/compiler
- tests
- baselines/reference
- cases/conformance/jsdoc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | | - | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
1513 | 1515 | | |
1514 | 1516 | | |
1515 | 1517 | | |
| |||
1612 | 1614 | | |
1613 | 1615 | | |
1614 | 1616 | | |
| 1617 | + | |
1615 | 1618 | | |
1616 | 1619 | | |
1617 | 1620 | | |
| |||
1795 | 1798 | | |
1796 | 1799 | | |
1797 | 1800 | | |
| 1801 | + | |
1798 | 1802 | | |
1799 | 1803 | | |
1800 | 1804 | | |
| |||
2009 | 2013 | | |
2010 | 2014 | | |
2011 | 2015 | | |
| 2016 | + | |
2012 | 2017 | | |
2013 | 2018 | | |
2014 | 2019 | | |
| |||
2430 | 2435 | | |
2431 | 2436 | | |
2432 | 2437 | | |
2433 | | - | |
| 2438 | + | |
2434 | 2439 | | |
2435 | 2440 | | |
2436 | 2441 | | |
2437 | 2442 | | |
2438 | | - | |
| 2443 | + | |
2439 | 2444 | | |
2440 | 2445 | | |
2441 | 2446 | | |
| |||
2534 | 2539 | | |
2535 | 2540 | | |
2536 | 2541 | | |
2537 | | - | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
2538 | 2545 | | |
2539 | 2546 | | |
2540 | 2547 | | |
| |||
2960 | 2967 | | |
2961 | 2968 | | |
2962 | 2969 | | |
| 2970 | + | |
| 2971 | + | |
2963 | 2972 | | |
2964 | 2973 | | |
2965 | 2974 | | |
| |||
2973 | 2982 | | |
2974 | 2983 | | |
2975 | 2984 | | |
2976 | | - | |
| 2985 | + | |
2977 | 2986 | | |
2978 | 2987 | | |
2979 | 2988 | | |
| |||
6255 | 6264 | | |
6256 | 6265 | | |
6257 | 6266 | | |
| 6267 | + | |
6258 | 6268 | | |
6259 | 6269 | | |
6260 | 6270 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments