MCPcopy Create free account
hub / github.com/TruthHun/BookStack / parseJS

Function parseJS

static/editor.md/lib/codemirror/mode/javascript/javascript.js:240–259  ·  view source on GitHub ↗
(state, style, type, content, stream)

Source from the content-addressed store, hash-verified

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

Callers 1

javascript.jsFile · 0.85

Calls 1

inScopeFunction · 0.70

Tested by

no test coverage detected