MCPcopy Create free account
hub / github.com/TruthHun/BookStack / tokenStringFactory

Function tokenStringFactory

static/editor.md/lib/codemirror/mode/vb/vb.js:171–194  ·  view source on GitHub ↗
(delimiter)

Source from the content-addressed store, hash-verified

169 }
170
171 function tokenStringFactory(delimiter) {
172 var singleline = delimiter.length == 1;
173 var OUTCLASS = 'string';
174
175 return function(stream, state) {
176 while (!stream.eol()) {
177 stream.eatWhile(/[^'"]/);
178 if (stream.match(delimiter)) {
179 state.tokenize = tokenBase;
180 return OUTCLASS;
181 } else {
182 stream.eat(/['"]/);
183 }
184 }
185 if (singleline) {
186 if (parserConf.singleLineStringErrors) {
187 return ERRORCLASS;
188 } else {
189 state.tokenize = tokenBase;
190 }
191 }
192 return OUTCLASS;
193 };
194 }
195
196
197 function tokenLexer(stream, state) {

Callers 1

tokenBaseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected