MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / tokenStringFactory

Function tokenStringFactory

lib/web/CodeMirror/mode/python/python.js:244–275  ·  view source on GitHub ↗
(delimiter, tokenOuter)

Source from the content-addressed store, hash-verified

242 }
243
244 function tokenStringFactory(delimiter, tokenOuter) {
245 while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
246 delimiter = delimiter.substr(1);
247
248 var singleline = delimiter.length == 1;
249 var OUTCLASS = "string";
250
251 function tokenString(stream, state) {
252 while (!stream.eol()) {
253 stream.eatWhile(/[^'"\\]/);
254 if (stream.eat("\\")) {
255 stream.next();
256 if (singleline && stream.eol())
257 return OUTCLASS;
258 } else if (stream.match(delimiter)) {
259 state.tokenize = tokenOuter;
260 return OUTCLASS;
261 } else {
262 stream.eat(/['"]/);
263 }
264 }
265 if (singleline) {
266 if (parserConf.singleLineStringErrors)
267 return ERRORCLASS;
268 else
269 state.tokenize = tokenOuter;
270 }
271 return OUTCLASS;
272 }
273 tokenString.isString = true;
274 return tokenString;
275 }
276
277 function pushPyScope(state) {
278 while (top(state).type != "py") state.scopes.pop()

Callers 1

tokenBaseInnerFunction · 0.70

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected