MCPcopy
hub / github.com/DHTMLX/gantt / typeexpr

Function typeexpr

samples/common/codehighlight/javascript.js:610–625  ·  view source on GitHub ↗
(type, value)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

contFunction · 0.85
pushlexFunction · 0.85
commasepFunction · 0.85

Tested by

no test coverage detected