Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
javascript.js770 linesDownload Raw Back to languages
1const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';2const KEYWORDS = [3  "as", // for exports4  "in",5  "of",6  "if",7  "for",8  "while",9  "finally",10  "var",11  "new",12  "function",13  "do",14  "return",15  "void",16  "else",17  "break",18  "catch",19  "instanceof",20  "with",21  "throw",22  "case",23  "default",24  "try",25  "switch",26  "continue",27  "typeof",28  "delete",29  "let",30  "yield",31  "const",32  "class",33  // JS handles these with a special rule34  // "get",35  // "set",36  "debugger",37  "async",38  "await",39  "static",40  "import",41  "from",42  "export",43  "extends",44  // It's reached stage 3, which is "recommended for implementation":45  "using"46];47const LITERALS = [48  "true",49  "false",50  "null",51  "undefined",52  "NaN",53  "Infinity"54];55 56// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects57const TYPES = [58  // Fundamental objects59  "Object",60  "Function",61  "Boolean",62  "Symbol",63  // numbers and dates64  "Math",65  "Date",66  "Number",67  "BigInt",68  // text69  "String",70  "RegExp",71  // Indexed collections72  "Array",73  "Float32Array",74  "Float64Array",75  "Int8Array",76  "Uint8Array",77  "Uint8ClampedArray",78  "Int16Array",79  "Int32Array",80  "Uint16Array",81  "Uint32Array",82  "BigInt64Array",83  "BigUint64Array",84  // Keyed collections85  "Set",86  "Map",87  "WeakSet",88  "WeakMap",89  // Structured data90  "ArrayBuffer",91  "SharedArrayBuffer",92  "Atomics",93  "DataView",94  "JSON",95  // Control abstraction objects96  "Promise",97  "Generator",98  "GeneratorFunction",99  "AsyncFunction",100  // Reflection101  "Reflect",102  "Proxy",103  // Internationalization104  "Intl",105  // WebAssembly106  "WebAssembly"107];108 109const ERROR_TYPES = [110  "Error",111  "EvalError",112  "InternalError",113  "RangeError",114  "ReferenceError",115  "SyntaxError",116  "TypeError",117  "URIError"118];119 120const BUILT_IN_GLOBALS = [121  "setInterval",122  "setTimeout",123  "clearInterval",124  "clearTimeout",125 126  "require",127  "exports",128 129  "eval",130  "isFinite",131  "isNaN",132  "parseFloat",133  "parseInt",134  "decodeURI",135  "decodeURIComponent",136  "encodeURI",137  "encodeURIComponent",138  "escape",139  "unescape"140];141 142const BUILT_IN_VARIABLES = [143  "arguments",144  "this",145  "super",146  "console",147  "window",148  "document",149  "localStorage",150  "sessionStorage",151  "module",152  "global" // Node.js153];154 155const BUILT_INS = [].concat(156  BUILT_IN_GLOBALS,157  TYPES,158  ERROR_TYPES159);160 161/*162Language: JavaScript163Description: JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.164Category: common, scripting, web165Website: https://developer.mozilla.org/en-US/docs/Web/JavaScript166*/167 168 169/** @type LanguageFn */170function javascript(hljs) {171  const regex = hljs.regex;172  /**173   * Takes a string like "<Booger" and checks to see174   * if we can find a matching "</Booger" later in the175   * content.176   * @param {RegExpMatchArray} match177   * @param {{after:number}} param1178   */179  const hasClosingTag = (match, { after }) => {180    const tag = "</" + match[0].slice(1);181    const pos = match.input.indexOf(tag, after);182    return pos !== -1;183  };184 185  const IDENT_RE$1 = IDENT_RE;186  const FRAGMENT = {187    begin: '<>',188    end: '</>'189  };190  // to avoid some special cases inside isTrulyOpeningTag191  const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/;192  const XML_TAG = {193    begin: /<[A-Za-z0-9\\._:-]+/,194    end: /\/[A-Za-z0-9\\._:-]+>|\/>/,195    /**196     * @param {RegExpMatchArray} match197     * @param {CallbackResponse} response198     */199    isTrulyOpeningTag: (match, response) => {200      const afterMatchIndex = match[0].length + match.index;201      const nextChar = match.input[afterMatchIndex];202      if (203        // HTML should not include another raw `<` inside a tag204        // nested type?205        // `<Array<Array<number>>`, etc.206        nextChar === "<" ||207        // the , gives away that this is not HTML208        // `<T, A extends keyof T, V>`209        nextChar === ","210        ) {211        response.ignoreMatch();212        return;213      }214 215      // `<something>`216      // Quite possibly a tag, lets look for a matching closing tag...217      if (nextChar === ">") {218        // if we cannot find a matching closing tag, then we219        // will ignore it220        if (!hasClosingTag(match, { after: afterMatchIndex })) {221          response.ignoreMatch();222        }223      }224 225      // `<blah />` (self-closing)226      // handled by simpleSelfClosing rule227 228      let m;229      const afterMatch = match.input.substring(afterMatchIndex);230 231      // some more template typing stuff232      //  <T = any>(key?: string) => Modify<233      if ((m = afterMatch.match(/^\s*=/))) {234        response.ignoreMatch();235        return;236      }237 238      // `<From extends string>`239      // technically this could be HTML, but it smells like a type240      // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276241      if ((m = afterMatch.match(/^\s+extends\s+/))) {242        if (m.index === 0) {243          response.ignoreMatch();244          // eslint-disable-next-line no-useless-return245          return;246        }247      }248    }249  };250  const KEYWORDS$1 = {251    $pattern: IDENT_RE,252    keyword: KEYWORDS,253    literal: LITERALS,254    built_in: BUILT_INS,255    "variable.language": BUILT_IN_VARIABLES256  };257 258  // https://tc39.es/ecma262/#sec-literals-numeric-literals259  const decimalDigits = '[0-9](_?[0-9])*';260  const frac = `\\.(${decimalDigits})`;261  // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral262  // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals263  const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;264  const NUMBER = {265    className: 'number',266    variants: [267      // DecimalLiteral268      { begin: `(\\b(${decimalInteger})((${frac})|\\.)?|(${frac}))` +269        `[eE][+-]?(${decimalDigits})\\b` },270      { begin: `\\b(${decimalInteger})\\b((${frac})\\b|\\.)?|(${frac})\\b` },271 272      // DecimalBigIntegerLiteral273      { begin: `\\b(0|[1-9](_?[0-9])*)n\\b` },274 275      // NonDecimalIntegerLiteral276      { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },277      { begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },278      { begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },279 280      // LegacyOctalIntegerLiteral (does not include underscore separators)281      // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals282      { begin: "\\b0[0-7]+n?\\b" },283    ],284    relevance: 0285  };286 287  const SUBST = {288    className: 'subst',289    begin: '\\$\\{',290    end: '\\}',291    keywords: KEYWORDS$1,292    contains: [] // defined later293  };294  const HTML_TEMPLATE = {295    begin: '\.?html`',296    end: '',297    starts: {298      end: '`',299      returnEnd: false,300      contains: [301        hljs.BACKSLASH_ESCAPE,302        SUBST303      ],304      subLanguage: 'xml'305    }306  };307  const CSS_TEMPLATE = {308    begin: '\.?css`',309    end: '',310    starts: {311      end: '`',312      returnEnd: false,313      contains: [314        hljs.BACKSLASH_ESCAPE,315        SUBST316      ],317      subLanguage: 'css'318    }319  };320  const GRAPHQL_TEMPLATE = {321    begin: '\.?gql`',322    end: '',323    starts: {324      end: '`',325      returnEnd: false,326      contains: [327        hljs.BACKSLASH_ESCAPE,328        SUBST329      ],330      subLanguage: 'graphql'331    }332  };333  const TEMPLATE_STRING = {334    className: 'string',335    begin: '`',336    end: '`',337    contains: [338      hljs.BACKSLASH_ESCAPE,339      SUBST340    ]341  };342  const JSDOC_COMMENT = hljs.COMMENT(343    /\/\*\*(?!\/)/,344    '\\*/',345    {346      relevance: 0,347      contains: [348        {349          begin: '(?=@[A-Za-z]+)',350          relevance: 0,351          contains: [352            {353              className: 'doctag',354              begin: '@[A-Za-z]+'355            },356            {357              className: 'type',358              begin: '\\{',359              end: '\\}',360              excludeEnd: true,361              excludeBegin: true,362              relevance: 0363            },364            {365              className: 'variable',366              begin: IDENT_RE$1 + '(?=\\s*(-)|$)',367              endsParent: true,368              relevance: 0369            },370            // eat spaces (not newlines) so we can find371            // types or variables372            {373              begin: /(?=[^\n])\s/,374              relevance: 0375            }376          ]377        }378      ]379    }380  );381  const COMMENT = {382    className: "comment",383    variants: [384      JSDOC_COMMENT,385      hljs.C_BLOCK_COMMENT_MODE,386      hljs.C_LINE_COMMENT_MODE387    ]388  };389  const SUBST_INTERNALS = [390    hljs.APOS_STRING_MODE,391    hljs.QUOTE_STRING_MODE,392    HTML_TEMPLATE,393    CSS_TEMPLATE,394    GRAPHQL_TEMPLATE,395    TEMPLATE_STRING,396    // Skip numbers when they are part of a variable name397    { match: /\$\d+/ },398    NUMBER,399    // This is intentional:400    // See https://github.com/highlightjs/highlight.js/issues/3288401    // hljs.REGEXP_MODE402  ];403  SUBST.contains = SUBST_INTERNALS404    .concat({405      // we need to pair up {} inside our subst to prevent406      // it from ending too early by matching another }407      begin: /\{/,408      end: /\}/,409      keywords: KEYWORDS$1,410      contains: [411        "self"412      ].concat(SUBST_INTERNALS)413    });414  const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);415  const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([416    // eat recursive parens in sub expressions417    {418      begin: /(\s*)\(/,419      end: /\)/,420      keywords: KEYWORDS$1,421      contains: ["self"].concat(SUBST_AND_COMMENTS)422    }423  ]);424  const PARAMS = {425    className: 'params',426    // convert this to negative lookbehind in v12427    begin: /(\s*)\(/, // to match the parms with428    end: /\)/,429    excludeBegin: true,430    excludeEnd: true,431    keywords: KEYWORDS$1,432    contains: PARAMS_CONTAINS433  };434 435  // ES6 classes436  const CLASS_OR_EXTENDS = {437    variants: [438      // class Car extends vehicle439      {440        match: [441          /class/,442          /\s+/,443          IDENT_RE$1,444          /\s+/,445          /extends/,446          /\s+/,447          regex.concat(IDENT_RE$1, "(", regex.concat(/\./, IDENT_RE$1), ")*")448        ],449        scope: {450          1: "keyword",451          3: "title.class",452          5: "keyword",453          7: "title.class.inherited"454        }455      },456      // class Car457      {458        match: [459          /class/,460          /\s+/,461          IDENT_RE$1462        ],463        scope: {464          1: "keyword",465          3: "title.class"466        }467      },468 469    ]470  };471 472  const CLASS_REFERENCE = {473    relevance: 0,474    match:475    regex.either(476      // Hard coded exceptions477      /\bJSON/,478      // Float32Array, OutT479      /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,480      // CSSFactory, CSSFactoryT481      /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,482      // FPs, FPsT483      /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/,484      // P485      // single letters are not highlighted486      // BLAH487      // this will be flagged as a UPPER_CASE_CONSTANT instead488    ),489    className: "title.class",490    keywords: {491      _: [492        // se we still get relevance credit for JS library classes493        ...TYPES,494        ...ERROR_TYPES495      ]496    }497  };498 499  const USE_STRICT = {500    label: "use_strict",501    className: 'meta',502    relevance: 10,503    begin: /^\s*['"]use (strict|asm)['"]/504  };505 506  const FUNCTION_DEFINITION = {507    variants: [508      {509        match: [510          /function/,511          /\s+/,512          IDENT_RE$1,513          /(?=\s*\()/514        ]515      },516      // anonymous function517      {518        match: [519          /function/,520          /\s*(?=\()/521        ]522      }523    ],524    className: {525      1: "keyword",526      3: "title.function"527    },528    label: "func.def",529    contains: [ PARAMS ],530    illegal: /%/531  };532 533  const UPPER_CASE_CONSTANT = {534    relevance: 0,535    match: /\b[A-Z][A-Z_0-9]+\b/,536    className: "variable.constant"537  };538 539  function noneOf(list) {540    return regex.concat("(?!", list.join("|"), ")");541  }542 543  const FUNCTION_CALL = {544    match: regex.concat(545      /\b/,546      noneOf([547        ...BUILT_IN_GLOBALS,548        "super",549        "import"550      ].map(x => `${x}\\s*\\(`)),551      IDENT_RE$1, regex.lookahead(/\s*\(/)),552    className: "title.function",553    relevance: 0554  };555 556  const PROPERTY_ACCESS = {557    begin: regex.concat(/\./, regex.lookahead(558      regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)559    )),560    end: IDENT_RE$1,561    excludeBegin: true,562    keywords: "prototype",563    className: "property",564    relevance: 0565  };566 567  const GETTER_OR_SETTER = {568    match: [569      /get|set/,570      /\s+/,571      IDENT_RE$1,572      /(?=\()/573    ],574    className: {575      1: "keyword",576      3: "title.function"577    },578    contains: [579      { // eat to avoid empty params580        begin: /\(\)/581      },582      PARAMS583    ]584  };585 586  const FUNC_LEAD_IN_RE = '(\\(' +587    '[^()]*(\\(' +588    '[^()]*(\\(' +589    '[^()]*' +590    '\\)[^()]*)*' +591    '\\)[^()]*)*' +592    '\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\s*=>';593 594  const FUNCTION_VARIABLE = {595    match: [596      /const|var|let/, /\s+/,597      IDENT_RE$1, /\s*/,598      /=\s*/,599      /(async\s*)?/, // async is optional600      regex.lookahead(FUNC_LEAD_IN_RE)601    ],602    keywords: "async",603    className: {604      1: "keyword",605      3: "title.function"606    },607    contains: [608      PARAMS609    ]610  };611 612  return {613    name: 'JavaScript',614    aliases: ['js', 'jsx', 'mjs', 'cjs'],615    keywords: KEYWORDS$1,616    // this will be extended by TypeScript617    exports: { PARAMS_CONTAINS, CLASS_REFERENCE },618    illegal: /#(?![$_A-z])/,619    contains: [620      hljs.SHEBANG({621        label: "shebang",622        binary: "node",623        relevance: 5624      }),625      USE_STRICT,626      hljs.APOS_STRING_MODE,627      hljs.QUOTE_STRING_MODE,628      HTML_TEMPLATE,629      CSS_TEMPLATE,630      GRAPHQL_TEMPLATE,631      TEMPLATE_STRING,632      COMMENT,633      // Skip numbers when they are part of a variable name634      { match: /\$\d+/ },635      NUMBER,636      CLASS_REFERENCE,637      {638        scope: 'attr',639        match: IDENT_RE$1 + regex.lookahead(':'),640        relevance: 0641      },642      FUNCTION_VARIABLE,643      { // "value" container644        begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',645        keywords: 'return throw case',646        relevance: 0,647        contains: [648          COMMENT,649          hljs.REGEXP_MODE,650          {651            className: 'function',652            // we have to count the parens to make sure we actually have the653            // correct bounding ( ) before the =>.  There could be any number of654            // sub-expressions inside also surrounded by parens.655            begin: FUNC_LEAD_IN_RE,656            returnBegin: true,657            end: '\\s*=>',658            contains: [659              {660                className: 'params',661                variants: [662                  {663                    begin: hljs.UNDERSCORE_IDENT_RE,664                    relevance: 0665                  },666                  {667                    className: null,668                    begin: /\(\s*\)/,669                    skip: true670                  },671                  {672                    begin: /(\s*)\(/,673                    end: /\)/,674                    excludeBegin: true,675                    excludeEnd: true,676                    keywords: KEYWORDS$1,677                    contains: PARAMS_CONTAINS678                  }679                ]680              }681            ]682          },683          { // could be a comma delimited list of params to a function call684            begin: /,/,685            relevance: 0686          },687          {688            match: /\s+/,689            relevance: 0690          },691          { // JSX692            variants: [693              { begin: FRAGMENT.begin, end: FRAGMENT.end },694              { match: XML_SELF_CLOSING },695              {696                begin: XML_TAG.begin,697                // we carefully check the opening tag to see if it truly698                // is a tag and not a false positive699                'on:begin': XML_TAG.isTrulyOpeningTag,700                end: XML_TAG.end701              }702            ],703            subLanguage: 'xml',704            contains: [705              {706                begin: XML_TAG.begin,707                end: XML_TAG.end,708                skip: true,709                contains: ['self']710              }711            ]712          }713        ],714      },715      FUNCTION_DEFINITION,716      {717        // prevent this from getting swallowed up by function718        // since they appear "function like"719        beginKeywords: "while if switch catch for"720      },721      {722        // we have to count the parens to make sure we actually have the correct723        // bounding ( ).  There could be any number of sub-expressions inside724        // also surrounded by parens.725        begin: '\\b(?!function)' + hljs.UNDERSCORE_IDENT_RE +726          '\\(' + // first parens727          '[^()]*(\\(' +728            '[^()]*(\\(' +729              '[^()]*' +730            '\\)[^()]*)*' +731          '\\)[^()]*)*' +732          '\\)\\s*\\{', // end parens733        returnBegin:true,734        label: "func.def",735        contains: [736          PARAMS,737          hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: "title.function" })738        ]739      },740      // catch ... so it won't trigger the property rule below741      {742        match: /\.\.\./,743        relevance: 0744      },745      PROPERTY_ACCESS,746      // hack: prevents detection of keywords in some circumstances747      // .keyword()748      // $keyword = x749      {750        match: '\\$' + IDENT_RE$1,751        relevance: 0752      },753      {754        match: [ /\bconstructor(?=\s*\()/ ],755        className: { 1: "title.function" },756        contains: [ PARAMS ]757      },758      FUNCTION_CALL,759      UPPER_CASE_CONSTANT,760      CLASS_OR_EXTENDS,761      GETTER_OR_SETTER,762      {763        match: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`764      }765    ]766  };767}768 769module.exports = javascript;770 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai