function buildModeRegex(mode) {
        const mm = new ResumableMultiRegex();

        mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" }));

        if (mode.terminator_end) {
          mm.addRule(mode.terminator_end, { type: "end" });
        }
        if (mode.illegal) {
          mm.addRule(mode.illegal, { type: "illegal" });
        }

        return mm;
      }
/**
       * Given a mode, builds a huge ResumableMultiRegex that can be used to walk
       * the content and find matches.
       *
       * @param {CompiledMode} mode
       * @returns {ResumableMultiRegex}
       */
Given a mode, builds a huge ResumableMultiRegex that can be used to walk
the content and find matches.


Given a mode builds a huge ResumableMultiRegex that can be used to walk the content and find matches .
function buildModeRegex(mode) {
        const mm = new ResumableMultiRegex();
        mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" }));
        if (mode.terminator_end) {
          mm.addRule(mode.terminator_end, { type: "end" });
        }
        if (mode.illegal) {
          mm.addRule(mode.illegal, { type: "illegal" });
        }
        return mm;
      }
function buildModeRegex ( mode ) { const mm = new ResumableMultiRegex ( ) ; mode . contains . forEach ( term => mm . addRule ( term . begin , { rule : term , type : "begin" } ) ) ; if ( mode . terminator_end ) { mm . addRule ( mode . terminator_end , { type : "end" } ) ; } if ( mode . illegal ) { mm . addRule ( mode . illegal , { type : "illegal" } ) ; } return mm ; }
Given a mode, builds a huge ResumableMultiRegex that can be used to walk
 the content and find matches.
Given a mode builds a huge ResumableMultiRegex that can be used to walk the content and find matches .