| 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 | |