function compileKeywords(rawKeywords, caseInsensitive) {
      /** @type KeywordDict */
      const compiledKeywords = {};

      if (typeof rawKeywords === 'string') { // string
        splitAndCompile('keyword', rawKeywords);
      } else {
        Object.keys(rawKeywords).forEach(function(className) {
          splitAndCompile(className, rawKeywords[className]);
        });
      }
      return compiledKeywords;

      // ---

      /**
       * Compiles an individual list of keywords
       *
       * Ex: "for if when while|5"
       *
       * @param {string} className
       * @param {string} keywordList
       */
      function splitAndCompile(className, keywordList) {
        if (caseInsensitive) {
          keywordList = keywordList.toLowerCase();
        }
        keywordList.split(' ').forEach(function(keyword) {
          const pair = keyword.split('|');
          compiledKeywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])];
        });
      }
    }
/**
     * Given raw keywords from a language definition, compile them.
     *
     * @param {string | Record<string,string>} rawKeywords
     * @param {boolean} caseInsensitive
     */
Given raw keywords from a language definition, compile them.
@param {string | Record} rawKeywords
@param {boolean} caseInsensitive
Given raw keywords from a language definition compile them . @param { string | Record } rawKeywords @param { boolean } caseInsensitive
function compileKeywords(rawKeywords, caseInsensitive) {
      const compiledKeywords = {};
      if (typeof rawKeywords === 'string') { 
        splitAndCompile('keyword', rawKeywords);
      } else {
        Object.keys(rawKeywords).forEach(function(className) {
          splitAndCompile(className, rawKeywords[className]);
        });
      }
      return compiledKeywords;
      function splitAndCompile(className, keywordList) {
        if (caseInsensitive) {
          keywordList = keywordList.toLowerCase();
        }
        keywordList.split(' ').forEach(function(keyword) {
          const pair = keyword.split('|');
          compiledKeywords[pair[0]] = [className, scoreForKeyword(pair[0], pair[1])];
        });
      }
    }
function compileKeywords ( rawKeywords , caseInsensitive ) { const compiledKeywords = { } ; if ( typeof rawKeywords === 'string' ) { splitAndCompile ( 'keyword' , rawKeywords ) ; } else { Object . keys ( rawKeywords ) . forEach ( function ( className ) { splitAndCompile ( className , rawKeywords [ className ] ) ; } ) ; } return compiledKeywords ; function splitAndCompile ( className , keywordList ) { if ( caseInsensitive ) { keywordList = keywordList . toLowerCase ( ) ; } keywordList . split ( ' ' ) . forEach ( function ( keyword ) { const pair = keyword . split ( '|' ) ; compiledKeywords [ pair [ 0 ] ] = [ className , scoreForKeyword ( pair [ 0 ] , pair [ 1 ] ) ] ; } ) ; } }
Given raw keywords from a language definition, compile them.
Given raw keywords from a language definition compile them .
/** @type KeywordDict */ // string // --- /**
       * Compiles an individual list of keywords
       *
       * Ex: "for if when while|5"
       *
       * @param {string} className
       * @param {string} keywordList
       */