()
| 4181 | } |
| 4182 | |
| 4183 | func (p *Parser) parseYieldExpression() *ast.Node { |
| 4184 | pos := p.nodePos() |
| 4185 | // YieldExpression[In] : |
| 4186 | // yield |
| 4187 | // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] |
| 4188 | // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] |
| 4189 | p.nextToken() |
| 4190 | var result *ast.Node |
| 4191 | if !p.hasPrecedingLineBreak() && (p.token == ast.KindAsteriskToken || p.isStartOfExpression()) { |
| 4192 | result = p.factory.NewYieldExpression(p.parseOptionalToken(ast.KindAsteriskToken), p.parseAssignmentExpressionOrHigher()) |
| 4193 | } else { |
| 4194 | // if the next token is not on the same line as yield. or we don't have an '*' or |
| 4195 | // the start of an expression, then this is just a simple "yield" expression. |
| 4196 | result = p.factory.NewYieldExpression(nil /*asteriskToken*/, nil /*expression*/) |
| 4197 | } |
| 4198 | return p.finishNode(result, pos) |
| 4199 | } |
| 4200 | |
| 4201 | func (p *Parser) isParenthesizedArrowFunctionExpression() core.Tristate { |
| 4202 | if p.token == ast.KindOpenParenToken || p.token == ast.KindLessThanToken || p.token == ast.KindAsyncKeyword { |
no test coverage detected