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

Function tokenStringFactory

tools/pythonauto/static/codemirror/python.js:170–203  ·  view source on GitHub ↗
(delimiter)

Source from the content-addressed store, hash-verified

168 }
169
170 function tokenStringFactory(delimiter) {
171 while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
172 delimiter = delimiter.substr(1);
173 }
174 var singleline = delimiter.length == 1;
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 }
204
205 function indent(stream, state, type) {
206 type = type || 'py';

Callers 1

tokenBaseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected