MCPcopy Index your code
hub / github.com/documentcloud/visualsearch / compileTerminators

Function compileTerminators

docs/assets/highlight.js:184–204  ·  view source on GitHub ↗
(mode, language)

Source from the content-addressed store, hash-verified

182 }
183
184 function compileTerminators(mode, language) {
185 var terminators = [];
186
187 for (var i = 0; i < mode.contains.length; i++) {
188 terminators.push(mode.contains[i].begin);
189 }
190
191 var index = modes.length - 1;
192 do {
193 if (modes[index].end) {
194 terminators.push(modes[index].end);
195 }
196 index--;
197 } while (modes[index + 1].endsWithParent);
198
199 if (mode.illegal) {
200 terminators.push(mode.illegal);
201 }
202
203 return langRe(language, '(' + terminators.join('|') + ')', true);
204 }
205
206 function eatModeChunk(value, index) {
207 var mode = modes[modes.length - 1];

Callers 1

eatModeChunkFunction · 0.85

Calls 1

langReFunction · 0.85

Tested by

no test coverage detected