| 489 | } |
| 490 | } |
| 491 | function innerMode(stream, state, force) { |
| 492 | if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { |
| 493 | if (state.innerMode) { |
| 494 | if (!state.innerState) { |
| 495 | state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {}; |
| 496 | } |
| 497 | return stream.hideFirstChars(state.indentOf + 2, function () { |
| 498 | return state.innerMode.token(stream, state.innerState) || true; |
| 499 | }); |
| 500 | } else { |
| 501 | stream.skipToEnd(); |
| 502 | return state.indentToken; |
| 503 | } |
| 504 | } else if (stream.sol()) { |
| 505 | state.indentOf = Infinity; |
| 506 | state.indentToken = null; |
| 507 | state.innerMode = null; |
| 508 | state.innerState = null; |
| 509 | } |
| 510 | } |
| 511 | function restOfLine(stream, state) { |
| 512 | if (stream.sol()) { |
| 513 | // if restOfLine was set at end of line, ignore it |