| 259 | } |
| 260 | |
| 261 | function parseJS(state, style, type, content, stream) { |
| 262 | var cc = state.cc; |
| 263 | // Communicate our context to the combinators. |
| 264 | // (Less wasteful than consing up a hundred closures on every call.) |
| 265 | cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; |
| 266 | |
| 267 | if (!state.lexical.hasOwnProperty("align")) |
| 268 | state.lexical.align = true; |
| 269 | |
| 270 | while(true) { |
| 271 | var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; |
| 272 | if (combinator(type, content)) { |
| 273 | while(cc.length && cc[cc.length - 1].lex) |
| 274 | cc.pop()(); |
| 275 | if (cx.marked) return cx.marked; |
| 276 | if (type == "variable" && inScope(state, content)) return "variable-2"; |
| 277 | return style; |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | // Combinator utils |
| 283 | |