MCPcopy Index your code
hub / github.com/DHTMLX/gantt / parseJS

Function parseJS

samples/common/codehighlight/javascript.js:244–263  ·  view source on GitHub ↗
(state, style, type, content, stream)

Source from the content-addressed store, hash-verified

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

Callers 1

javascript.jsFile · 0.85

Calls 1

inScopeFunction · 0.85

Tested by

no test coverage detected