MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / tokenFactory

Function tokenFactory

mini-code-edit/cm/mode/coffeescript/coffeescript.js:166–192  ·  view source on GitHub ↗
(delimiter, outclass)

Source from the content-addressed store, hash-verified

164 }
165
166 function tokenFactory(delimiter, outclass) {
167 var singleline = delimiter.length == 1;
168 return function tokenString(stream, state) {
169 while (!stream.eol()) {
170 stream.eatWhile(/[^'"\/\\]/);
171 if (stream.eat('\\')) {
172 stream.next();
173 if (singleline && stream.eol()) {
174 return outclass;
175 }
176 } else if (stream.match(delimiter)) {
177 state.tokenize = tokenBase;
178 return outclass;
179 } else {
180 stream.eat(/['"\/]/);
181 }
182 }
183 if (singleline) {
184 if (conf.mode.singleLineStringErrors) {
185 outclass = ERRORCLASS
186 } else {
187 state.tokenize = tokenBase;
188 }
189 }
190 return outclass;
191 };
192 }
193
194 function longComment(stream, state) {
195 while (!stream.eol()) {

Callers 1

tokenBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected