(leftExpr: ExpressionNode)
| 2140 | } |
| 2141 | |
| 2142 | private _parseChainAssignments(leftExpr: ExpressionNode): ExpressionNode { |
| 2143 | // Is the left side of the assignment assignable? |
| 2144 | const assignError = leftExpr.getAssignmentError(); |
| 2145 | if (assignError) { |
| 2146 | this._addError(assignError, leftExpr); |
| 2147 | } |
| 2148 | |
| 2149 | let rightExpr: ExpressionNode | undefined; |
| 2150 | rightExpr = this._tryParseYieldExpression(); |
| 2151 | if (!rightExpr) { |
| 2152 | rightExpr = this._parseTestListAsExpression('Expected expression to the right of "="'); |
| 2153 | } |
| 2154 | |
| 2155 | if (rightExpr instanceof ErrorExpressionNode) { |
| 2156 | return rightExpr; |
| 2157 | } |
| 2158 | |
| 2159 | // Recurse until we've consumed the entire chain. |
| 2160 | if (this._consumeTokenIfOperator(OperatorType.Assign)) { |
| 2161 | rightExpr = this._parseChainAssignments(rightExpr); |
| 2162 | if (rightExpr instanceof ErrorExpressionNode) { |
| 2163 | return rightExpr; |
| 2164 | } |
| 2165 | } |
| 2166 | |
| 2167 | return new AssignmentNode(leftExpr, rightExpr); |
| 2168 | } |
| 2169 | |
| 2170 | private _parseTypeAnnotation(node: ExpressionNode): TypeAnnotationExpression { |
| 2171 | let rawExpression = node; |
no test coverage detected