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

Function parseJS

lib/web/CodeMirror/mode/javascript/javascript.js:241–260  ·  view source on GitHub ↗
(state, style, type, content, stream)

Source from the content-addressed store, hash-verified

239 }
240
241 function parseJS(state, style, type, content, stream) {
242 var cc = state.cc;
243 // Communicate our context to the combinators.
244 // (Less wasteful than consing up a hundred closures on every call.)
245 cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
246
247 if (!state.lexical.hasOwnProperty("align"))
248 state.lexical.align = true;
249
250 while(true) {
251 var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
252 if (combinator(type, content)) {
253 while(cc.length && cc[cc.length - 1].lex)
254 cc.pop()();
255 if (cx.marked) return cx.marked;
256 if (type == "variable" && inScope(state, content)) return "variable-2";
257 return style;
258 }
259 }
260 }
261
262 // Combinator utils
263

Callers 1

javascript.jsFile · 0.85

Calls 2

inScopeFunction · 0.70
popMethod · 0.45

Tested by

no test coverage detected