()
| 1642 | |
| 1643 | // subscriptlist: subscript (',' subscript)* [','] |
| 1644 | private _parseSubscriptList(): ExpressionNode { |
| 1645 | let listResult = this._parseExpressionListGeneric(() => this._parseSubscript(), () => { |
| 1646 | // Override the normal terminal check to exclude colons, |
| 1647 | // which are a valid way to start subscription expressions. |
| 1648 | if (this._peekTokenType() === TokenType.Colon) { |
| 1649 | return false; |
| 1650 | } |
| 1651 | return this._isNextTokenNeverExpression(); |
| 1652 | }); |
| 1653 | |
| 1654 | if (listResult.parseError) { |
| 1655 | return listResult.parseError; |
| 1656 | } |
| 1657 | |
| 1658 | if (listResult.list.length === 0) { |
| 1659 | return this._handleExpressionParseError('Expected index or slice expression'); |
| 1660 | } |
| 1661 | |
| 1662 | return this._makeExpressionOrTuple(listResult); |
| 1663 | } |
| 1664 | |
| 1665 | // subscript: test | [test] ':' [test] [sliceop] |
| 1666 | // sliceop: ':' [test] |
no test coverage detected