| 354 | } |
| 355 | |
| 356 | function tokenLexer(stream, state) { |
| 357 | if (stream.sol()) state.indentCount = 0; |
| 358 | var style = state.tokenizer(stream, state); |
| 359 | var current = stream.current(); |
| 360 | |
| 361 | if (current === "@return" || current === "}"){ |
| 362 | dedent(state); |
| 363 | } |
| 364 | |
| 365 | if (style !== null) { |
| 366 | var startOfToken = stream.pos - current.length; |
| 367 | |
| 368 | var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); |
| 369 | |
| 370 | var newScopes = []; |
| 371 | |
| 372 | for (var i = 0; i < state.scopes.length; i++) { |
| 373 | var scope = state.scopes[i]; |
| 374 | |
| 375 | if (scope.offset <= withCurrentIndent) |
| 376 | newScopes.push(scope); |
| 377 | } |
| 378 | |
| 379 | state.scopes = newScopes; |
| 380 | } |
| 381 | |
| 382 | |
| 383 | return style; |
| 384 | } |
| 385 | |
| 386 | return { |
| 387 | startState: function() { |