MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / tokenStringFactory

Function tokenStringFactory

static/js/codemirror/mode/vb/vb.js:158–181  ·  view source on GitHub ↗
(delimiter)

Source from the content-addressed store, hash-verified

156 }
157
158 function tokenStringFactory(delimiter) {
159 var singleline = delimiter.length == 1;
160 var OUTCLASS = 'string';
161
162 return function(stream, state) {
163 while (!stream.eol()) {
164 stream.eatWhile(/[^'"]/);
165 if (stream.match(delimiter)) {
166 state.tokenize = tokenBase;
167 return OUTCLASS;
168 } else {
169 stream.eat(/['"]/);
170 }
171 }
172 if (singleline) {
173 if (parserConf.singleLineStringErrors) {
174 return ERRORCLASS;
175 } else {
176 state.tokenize = tokenBase;
177 }
178 }
179 return OUTCLASS;
180 };
181 }
182
183
184 function tokenLexer(stream, state) {

Callers 1

tokenBaseFunction · 0.70

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected