(type, value, noComma)
| 716 | return maybeoperatorNoComma(type, value, false); |
| 717 | } |
| 718 | function maybeoperatorNoComma(type, value, noComma) { |
| 719 | var me = |
| 720 | noComma == false ? maybeoperatorComma : maybeoperatorNoComma; |
| 721 | var expr = noComma == false ? expression : expressionNoComma; |
| 722 | if (type == "=>") |
| 723 | return cont( |
| 724 | pushcontext, |
| 725 | noComma ? arrowBodyNoComma : arrowBody, |
| 726 | popcontext |
| 727 | ); |
| 728 | if (type == "operator") { |
| 729 | if (/\+\+|--/.test(value) || (isTS && value == "!")) |
| 730 | return cont(me); |
| 731 | if ( |
| 732 | isTS && |
| 733 | value == "<" && |
| 734 | cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false) |
| 735 | ) |
| 736 | return cont( |
| 737 | pushlex(">"), |
| 738 | commasep(typeexpr, ">"), |
| 739 | poplex, |
| 740 | me |
| 741 | ); |
| 742 | if (value == "?") return cont(expression, expect(":"), expr); |
| 743 | return cont(expr); |
| 744 | } |
| 745 | if (type == "quasi") { |
| 746 | return pass(quasi, me); |
| 747 | } |
| 748 | if (type == ";") return; |
| 749 | if (type == "(") |
| 750 | return contCommasep(expressionNoComma, ")", "call", me); |
| 751 | if (type == ".") return cont(property, me); |
| 752 | if (type == "[") |
| 753 | return cont( |
| 754 | pushlex("]"), |
| 755 | maybeexpression, |
| 756 | expect("]"), |
| 757 | poplex, |
| 758 | me |
| 759 | ); |
| 760 | if (isTS && value == "as") { |
| 761 | cx.marked = "keyword"; |
| 762 | return cont(typeexpr, me); |
| 763 | } |
| 764 | if (type == "regexp") { |
| 765 | cx.state.lastType = cx.marked = "operator"; |
| 766 | cx.stream.backUp(cx.stream.pos - cx.stream.start - 1); |
| 767 | return cont(expr); |
| 768 | } |
| 769 | } |
| 770 | function quasi(type, value) { |
| 771 | if (type != "quasi") return pass(); |
| 772 | if (value.slice(value.length - 2) != "${") return cont(quasi); |
no test coverage detected