| 131 | } |
| 132 | |
| 133 | function parseJS(state, style, type, content, stream) { |
| 134 | var cc = state.cc; |
| 135 | // Communicate our context to the combinators. |
| 136 | // (Less wasteful than consing up a hundred closures on every call.) |
| 137 | cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; |
| 138 | |
| 139 | if (!state.lexical.hasOwnProperty("align")) |
| 140 | state.lexical.align = true; |
| 141 | |
| 142 | while(true) { |
| 143 | var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; |
| 144 | if (combinator(type, content)) { |
| 145 | while(cc.length && cc[cc.length - 1].lex) |
| 146 | cc.pop()(); |
| 147 | if (cx.marked) return cx.marked; |
| 148 | if (type == "variable" && inScope(state, content)) return "variable-2"; |
| 149 | return style; |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | // Combinator utils |
| 155 | |