(P: ParseState, closer: string)
| 3755 | } |
| 3756 | |
| 3757 | function parseTestUnary(P: ParseState, closer: string): TsNode | null { |
| 3758 | skipBlanks(P.L) |
| 3759 | const c = peek(P.L) |
| 3760 | if (c === '(') { |
| 3761 | const s = P.L.b |
| 3762 | advance(P.L) |
| 3763 | const open = mk(P, '(', s, P.L.b, []) |
| 3764 | const inner = parseTestOr(P, closer) |
| 3765 | skipBlanks(P.L) |
| 3766 | let close: TsNode |
| 3767 | if (peek(P.L) === ')') { |
| 3768 | const cs = P.L.b |
| 3769 | advance(P.L) |
| 3770 | close = mk(P, ')', cs, P.L.b, []) |
| 3771 | } else { |
| 3772 | close = mk(P, ')', P.L.b, P.L.b, []) |
| 3773 | } |
| 3774 | const kids = inner ? [open, inner, close] : [open, close] |
| 3775 | return mk( |
| 3776 | P, |
| 3777 | 'parenthesized_expression', |
| 3778 | open.startIndex, |
| 3779 | close.endIndex, |
| 3780 | kids, |
| 3781 | ) |
| 3782 | } |
| 3783 | return parseTestBinary(P, closer) |
| 3784 | } |
| 3785 | |
| 3786 | /** |
| 3787 | * Parse `!`-negated or test-operator (`-f`) or parenthesized primary — but NOT |
no test coverage detected