MCPcopy Create free account
hub / github.com/AlexNisnevich/untrusted / tokenString

Function tokenString

lib/codemirror-3.1/mode/python/python.js:163–186  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

161 var OUTCLASS = 'string';
162
163 function tokenString(stream, state) {
164 while (!stream.eol()) {
165 stream.eatWhile(/[^'"\\]/);
166 if (stream.eat('\\')) {
167 stream.next();
168 if (singleline && stream.eol()) {
169 return OUTCLASS;
170 }
171 } else if (stream.match(delimiter)) {
172 state.tokenize = tokenBase;
173 return OUTCLASS;
174 } else {
175 stream.eat(/['"]/);
176 }
177 }
178 if (singleline) {
179 if (parserConf.singleLineStringErrors) {
180 return ERRORCLASS;
181 } else {
182 state.tokenize = tokenBase;
183 }
184 }
185 return OUTCLASS;
186 }
187 tokenString.isString = true;
188 return tokenString;
189 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected