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