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

Function tokenString

static/editor.md/lib/codemirror/mode/python/python.js:200–221  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

198 var OUTCLASS = "string";
199
200 function tokenString(stream, state) {
201 while (!stream.eol()) {
202 stream.eatWhile(/[^'"\\]/);
203 if (stream.eat("\\")) {
204 stream.next();
205 if (singleline && stream.eol())
206 return OUTCLASS;
207 } else if (stream.match(delimiter)) {
208 state.tokenize = tokenBase;
209 return OUTCLASS;
210 } else {
211 stream.eat(/['"]/);
212 }
213 }
214 if (singleline) {
215 if (parserConf.singleLineStringErrors)
216 return ERRORCLASS;
217 else
218 state.tokenize = tokenBase;
219 }
220 return OUTCLASS;
221 }
222 tokenString.isString = true;
223 return tokenString;
224 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected