MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / parseJS

Function parseJS

src/cm/javascript.js:167–186  ·  view source on GitHub ↗
(state, style, type, content, stream)

Source from the content-addressed store, hash-verified

165 }
166
167 function parseJS(state, style, type, content, stream) {
168 var cc = state.cc;
169 // Communicate our context to the combinators.
170 // (Less wasteful than consing up a hundred closures on every call.)
171 cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
172
173 if (!state.lexical.hasOwnProperty("align"))
174 state.lexical.align = true;
175
176 while(true) {
177 var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
178 if (combinator(type, content)) {
179 while(cc.length && cc[cc.length - 1].lex)
180 cc.pop()();
181 if (cx.marked) return cx.marked;
182 if (type == "variable" && inScope(state, content)) return "variable-2";
183 return style;
184 }
185 }
186 }
187
188 // Combinator utils
189

Callers 1

javascript.jsFile · 0.85

Calls 1

inScopeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…