MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / parseJS

Function parseJS

mini-code-edit/cm/mode/javascript/javascript.js:133–152  ·  view source on GitHub ↗
(state, style, type, content, stream)

Source from the content-addressed store, hash-verified

131 }
132
133 function parseJS(state, style, type, content, stream) {
134 var cc = state.cc;
135 // Communicate our context to the combinators.
136 // (Less wasteful than consing up a hundred closures on every call.)
137 cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
138
139 if (!state.lexical.hasOwnProperty("align"))
140 state.lexical.align = true;
141
142 while(true) {
143 var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
144 if (combinator(type, content)) {
145 while(cc.length && cc[cc.length - 1].lex)
146 cc.pop()();
147 if (cx.marked) return cx.marked;
148 if (type == "variable" && inScope(state, content)) return "variable-2";
149 return style;
150 }
151 }
152 }
153
154 // Combinator utils
155

Callers 1

javascript.jsFile · 0.85

Calls 1

inScopeFunction · 0.85

Tested by

no test coverage detected