MCPcopy Create free account
hub / github.com/TruthHun/BookStack / tokenLexer

Function tokenLexer

static/editor.md/lib/codemirror/mode/sass/sass.js:356–384  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

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() {

Callers 1

sass.jsFile · 0.70

Calls 1

dedentFunction · 0.70

Tested by

no test coverage detected