MCPcopy Create free account
hub / github.com/sql-js/sql.js / compileTerminators

Function compileTerminators

documentation/javascript/application.js:397–417  ·  view source on GitHub ↗
(mode, language)

Source from the content-addressed store, hash-verified

395 }
396
397 function compileTerminators(mode, language) {
398 var terminators = [];
399
400 for (var i = 0; i < mode.contains.length; i++) {
401 terminators.push(mode.contains[i].begin);
402 }
403
404 var index = modes.length - 1;
405 do {
406 if (modes[index].end) {
407 terminators.push(modes[index].end);
408 }
409 index--;
410 } while (modes[index + 1].endsWithParent);
411
412 if (mode.illegal) {
413 terminators.push(mode.illegal);
414 }
415
416 return langRe(language, '(' + terminators.join('|') + ')', true);
417 }
418
419 function eatModeChunk(value, index) {
420 var mode = modes[modes.length - 1];

Callers 1

eatModeChunkFunction · 0.85

Calls 1

langReFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…