MCPcopy Index your code
hub / github.com/csev/py4e / tokenString

Function tokenString

tools/pythonauto/static/codemirror/python.js:177–200  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

175 var OUTCLASS = 'string';
176
177 function tokenString(stream, state) {
178 while (!stream.eol()) {
179 stream.eatWhile(/[^'"\\]/);
180 if (stream.eat('\\')) {
181 stream.next();
182 if (singleline && stream.eol()) {
183 return OUTCLASS;
184 }
185 } else if (stream.match(delimiter)) {
186 state.tokenize = tokenBase;
187 return OUTCLASS;
188 } else {
189 stream.eat(/['"]/);
190 }
191 }
192 if (singleline) {
193 if (parserConf.singleLineStringErrors) {
194 return ERRORCLASS;
195 } else {
196 state.tokenize = tokenBase;
197 }
198 }
199 return OUTCLASS;
200 }
201 tokenString.isString = true;
202 return tokenString;
203 }

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected