| 605 | } |
| 606 | } |
| 607 | function typeexpr(type, value) { |
| 608 | if (value == "keyof" || value == "typeof" || value == "infer") { |
| 609 | cx.marked = "keyword" |
| 610 | return cont(value == "typeof" ? expressionNoComma : typeexpr) |
| 611 | } |
| 612 | if (type == "variable" || value == "void") { |
| 613 | cx.marked = "type" |
| 614 | return cont(afterType) |
| 615 | } |
| 616 | if (value == "|" || value == "&") return cont(typeexpr) |
| 617 | if (type == "string" || type == "number" || type == "atom") return cont(afterType); |
| 618 | if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) |
| 619 | if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType) |
| 620 | if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType) |
| 621 | if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) |
| 622 | } |
| 623 | function maybeReturnType(type) { |
| 624 | if (type == "=>") return cont(typeexpr) |
| 625 | } |