MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / typeexpr

Function typeexpr

lib/web/CodeMirror/mode/javascript/javascript.js:607–622  ·  view source on GitHub ↗
(type, value)

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 3

contFunction · 0.70
pushlexFunction · 0.70
commasepFunction · 0.70

Tested by

no test coverage detected