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

Function stringTokenizer

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

Source from the content-addressed store, hash-verified

68 if (greedy == null) { greedy = true; }
69
70 function stringTokenizer(stream, state) {
71 var nextChar = stream.next();
72 var peekChar = stream.peek();
73 var previousChar = stream.string.charAt(stream.pos-2);
74
75 var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\"));
76
77 if (endingString) {
78 if (nextChar !== quote && greedy) { stream.next(); }
79 state.tokenizer = tokenBase;
80 return "string";
81 } else if (nextChar === "#" && peekChar === "{") {
82 state.tokenizer = buildInterpolationTokenizer(stringTokenizer);
83 stream.next();
84 return "operator";
85 } else {
86 return "string";
87 }
88 }
89
90 return stringTokenizer;
91 }

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected