| 355 | return expressionInner(type, true); |
| 356 | } |
| 357 | function expressionInner(type, noComma) { |
| 358 | if (cx.state.fatArrowAt == cx.stream.start) { |
| 359 | var body = noComma ? arrowBodyNoComma : arrowBody; |
| 360 | if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); |
| 361 | else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); |
| 362 | } |
| 363 | |
| 364 | var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; |
| 365 | if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); |
| 366 | if (type == "function") return cont(functiondef, maybeop); |
| 367 | if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); |
| 368 | if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); |
| 369 | if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); |
| 370 | if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); |
| 371 | if (type == "{") return contCommasep(objprop, "}", null, maybeop); |
| 372 | if (type == "quasi") { return pass(quasi, maybeop); } |
| 373 | return cont(); |
| 374 | } |
| 375 | function maybeexpression(type) { |
| 376 | if (type.match(/[;\}\)\],]/)) return pass(); |
| 377 | return pass(expression); |