MCPcopy Index your code
hub / github.com/pandao/editor.md / tokenStringFactory

Function tokenStringFactory

lib/codemirror/mode/python/python.js:193–224  ·  view source on GitHub ↗
(delimiter)

Source from the content-addressed store, hash-verified

191 }
192
193 function tokenStringFactory(delimiter) {
194 while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
195 delimiter = delimiter.substr(1);
196
197 var singleline = delimiter.length == 1;
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 }
225
226 function pushScope(stream, state, type) {
227 var offset = 0, align = null;

Callers 1

tokenBaseInnerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…