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.
03.1k
1/*2Language: Perl3Author: Peter Leonov <gojpeg@yandex.ru>4Website: https://www.perl.org5Category: common6*/7 8/** @type LanguageFn */9function perl(hljs) {10 const regex = hljs.regex;11 const KEYWORDS = [12 'abs',13 'accept',14 'alarm',15 'and',16 'atan2',17 'bind',18 'binmode',19 'bless',20 'break',21 'caller',22 'chdir',23 'chmod',24 'chomp',25 'chop',26 'chown',27 'chr',28 'chroot',29 'class',30 'close',31 'closedir',32 'connect',33 'continue',34 'cos',35 'crypt',36 'dbmclose',37 'dbmopen',38 'defined',39 'delete',40 'die',41 'do',42 'dump',43 'each',44 'else',45 'elsif',46 'endgrent',47 'endhostent',48 'endnetent',49 'endprotoent',50 'endpwent',51 'endservent',52 'eof',53 'eval',54 'exec',55 'exists',56 'exit',57 'exp',58 'fcntl',59 'field',60 'fileno',61 'flock',62 'for',63 'foreach',64 'fork',65 'format',66 'formline',67 'getc',68 'getgrent',69 'getgrgid',70 'getgrnam',71 'gethostbyaddr',72 'gethostbyname',73 'gethostent',74 'getlogin',75 'getnetbyaddr',76 'getnetbyname',77 'getnetent',78 'getpeername',79 'getpgrp',80 'getpriority',81 'getprotobyname',82 'getprotobynumber',83 'getprotoent',84 'getpwent',85 'getpwnam',86 'getpwuid',87 'getservbyname',88 'getservbyport',89 'getservent',90 'getsockname',91 'getsockopt',92 'given',93 'glob',94 'gmtime',95 'goto',96 'grep',97 'gt',98 'hex',99 'if',100 'index',101 'int',102 'ioctl',103 'join',104 'keys',105 'kill',106 'last',107 'lc',108 'lcfirst',109 'length',110 'link',111 'listen',112 'local',113 'localtime',114 'log',115 'lstat',116 'lt',117 'ma',118 'map',119 'method',120 'mkdir',121 'msgctl',122 'msgget',123 'msgrcv',124 'msgsnd',125 'my',126 'ne',127 'next',128 'no',129 'not',130 'oct',131 'open',132 'opendir',133 'or',134 'ord',135 'our',136 'pack',137 'package',138 'pipe',139 'pop',140 'pos',141 'print',142 'printf',143 'prototype',144 'push',145 'q|0',146 'qq',147 'quotemeta',148 'qw',149 'qx',150 'rand',151 'read',152 'readdir',153 'readline',154 'readlink',155 'readpipe',156 'recv',157 'redo',158 'ref',159 'rename',160 'require',161 'reset',162 'return',163 'reverse',164 'rewinddir',165 'rindex',166 'rmdir',167 'say',168 'scalar',169 'seek',170 'seekdir',171 'select',172 'semctl',173 'semget',174 'semop',175 'send',176 'setgrent',177 'sethostent',178 'setnetent',179 'setpgrp',180 'setpriority',181 'setprotoent',182 'setpwent',183 'setservent',184 'setsockopt',185 'shift',186 'shmctl',187 'shmget',188 'shmread',189 'shmwrite',190 'shutdown',191 'sin',192 'sleep',193 'socket',194 'socketpair',195 'sort',196 'splice',197 'split',198 'sprintf',199 'sqrt',200 'srand',201 'stat',202 'state',203 'study',204 'sub',205 'substr',206 'symlink',207 'syscall',208 'sysopen',209 'sysread',210 'sysseek',211 'system',212 'syswrite',213 'tell',214 'telldir',215 'tie',216 'tied',217 'time',218 'times',219 'tr',220 'truncate',221 'uc',222 'ucfirst',223 'umask',224 'undef',225 'unless',226 'unlink',227 'unpack',228 'unshift',229 'untie',230 'until',231 'use',232 'utime',233 'values',234 'vec',235 'wait',236 'waitpid',237 'wantarray',238 'warn',239 'when',240 'while',241 'write',242 'x|0',243 'xor',244 'y|0'245 ];246 247 // https://perldoc.perl.org/perlre#Modifiers248 const REGEX_MODIFIERS = /[dualxmsipngr]{0,12}/; // aa and xx are valid, making max length 12249 const PERL_KEYWORDS = {250 $pattern: /[\w.]+/,251 keyword: KEYWORDS.join(" ")252 };253 const SUBST = {254 className: 'subst',255 begin: '[$@]\\{',256 end: '\\}',257 keywords: PERL_KEYWORDS258 };259 const METHOD = {260 begin: /->\{/,261 end: /\}/262 // contains defined later263 };264 const ATTR = {265 scope: 'attr',266 match: /\s+:\s*\w+(\s*\(.*?\))?/,267 };268 const VAR = {269 scope: 'variable',270 variants: [271 { begin: /\$\d/ },272 { begin: regex.concat(273 /[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,274 // negative look-ahead tries to avoid matching patterns that are not275 // Perl at all like $ident$, @ident@, etc.276 `(?![A-Za-z])(?![@$%])`277 )278 },279 {280 // Only $= is a special Perl variable and one can't declare @= or %=.281 begin: /[$%@](?!")[^\s\w{=]|\$=/,282 relevance: 0283 }284 ],285 contains: [ ATTR ],286 };287 const NUMBER = {288 className: 'number',289 variants: [290 // decimal numbers:291 // include the case where a number starts with a dot (eg. .9), and292 // the leading 0? avoids mixing the first and second match on 0.x cases293 { match: /0?\.[0-9][0-9_]+\b/ },294 // include the special versioned number (eg. v5.38)295 { match: /\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/ },296 // non-decimal numbers:297 { match: /\b0[0-7][0-7_]*\b/ },298 { match: /\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/ },299 { match: /\b0b[0-1][0-1_]*\b/ },300 ],301 relevance: 0302 };303 const STRING_CONTAINS = [304 hljs.BACKSLASH_ESCAPE,305 SUBST,306 VAR307 ];308 const REGEX_DELIMS = [309 /!/,310 /\//,311 /\|/,312 /\?/,313 /'/,314 /"/, // valid but infrequent and weird315 /#/ // valid but infrequent and weird316 ];317 /**318 * @param {string|RegExp} prefix319 * @param {string|RegExp} open320 * @param {string|RegExp} close321 */322 const PAIRED_DOUBLE_RE = (prefix, open, close = '\\1') => {323 const middle = (close === '\\1')324 ? close325 : regex.concat(close, open);326 return regex.concat(327 regex.concat("(?:", prefix, ")"),328 open,329 /(?:\\.|[^\\\/])*?/,330 middle,331 /(?:\\.|[^\\\/])*?/,332 close,333 REGEX_MODIFIERS334 );335 };336 /**337 * @param {string|RegExp} prefix338 * @param {string|RegExp} open339 * @param {string|RegExp} close340 */341 const PAIRED_RE = (prefix, open, close) => {342 return regex.concat(343 regex.concat("(?:", prefix, ")"),344 open,345 /(?:\\.|[^\\\/])*?/,346 close,347 REGEX_MODIFIERS348 );349 };350 const PERL_DEFAULT_CONTAINS = [351 VAR,352 hljs.HASH_COMMENT_MODE,353 hljs.COMMENT(354 /^=\w/,355 /=cut/,356 { endsWithParent: true }357 ),358 METHOD,359 {360 className: 'string',361 contains: STRING_CONTAINS,362 variants: [363 {364 begin: 'q[qwxr]?\\s*\\(',365 end: '\\)',366 relevance: 5367 },368 {369 begin: 'q[qwxr]?\\s*\\[',370 end: '\\]',371 relevance: 5372 },373 {374 begin: 'q[qwxr]?\\s*\\{',375 end: '\\}',376 relevance: 5377 },378 {379 begin: 'q[qwxr]?\\s*\\|',380 end: '\\|',381 relevance: 5382 },383 {384 begin: 'q[qwxr]?\\s*<',385 end: '>',386 relevance: 5387 },388 {389 begin: 'qw\\s+q',390 end: 'q',391 relevance: 5392 },393 {394 begin: '\'',395 end: '\'',396 contains: [ hljs.BACKSLASH_ESCAPE ]397 },398 {399 begin: '"',400 end: '"'401 },402 {403 begin: '`',404 end: '`',405 contains: [ hljs.BACKSLASH_ESCAPE ]406 },407 {408 begin: /\{\w+\}/,409 relevance: 0410 },411 {412 begin: '-?\\w+\\s*=>',413 relevance: 0414 }415 ]416 },417 NUMBER,418 { // regexp container419 begin: '(\\/\\/|' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',420 keywords: 'split return print reverse grep',421 relevance: 0,422 contains: [423 hljs.HASH_COMMENT_MODE,424 {425 className: 'regexp',426 variants: [427 // allow matching common delimiters428 { begin: PAIRED_DOUBLE_RE("s|tr|y", regex.either(...REGEX_DELIMS, { capture: true })) },429 // and then paired delmis430 { begin: PAIRED_DOUBLE_RE("s|tr|y", "\\(", "\\)") },431 { begin: PAIRED_DOUBLE_RE("s|tr|y", "\\[", "\\]") },432 { begin: PAIRED_DOUBLE_RE("s|tr|y", "\\{", "\\}") }433 ],434 relevance: 2435 },436 {437 className: 'regexp',438 variants: [439 {440 // could be a comment in many languages so do not count441 // as relevant442 begin: /(m|qr)\/\//,443 relevance: 0444 },445 // prefix is optional with /regex/446 { begin: PAIRED_RE("(?:m|qr)?", /\//, /\//) },447 // allow matching common delimiters448 { begin: PAIRED_RE("m|qr", regex.either(...REGEX_DELIMS, { capture: true }), /\1/) },449 // allow common paired delmins450 { begin: PAIRED_RE("m|qr", /\(/, /\)/) },451 { begin: PAIRED_RE("m|qr", /\[/, /\]/) },452 { begin: PAIRED_RE("m|qr", /\{/, /\}/) }453 ]454 }455 ]456 },457 {458 className: 'function',459 beginKeywords: 'sub method',460 end: '(\\s*\\(.*?\\))?[;{]',461 excludeEnd: true,462 relevance: 5,463 contains: [ hljs.TITLE_MODE, ATTR ]464 },465 {466 className: 'class',467 beginKeywords: 'class',468 end: '[;{]',469 excludeEnd: true,470 relevance: 5,471 contains: [ hljs.TITLE_MODE, ATTR, NUMBER ]472 },473 {474 begin: '-\\w\\b',475 relevance: 0476 },477 {478 begin: "^__DATA__$",479 end: "^__END__$",480 subLanguage: 'mojolicious',481 contains: [482 {483 begin: "^@@.*",484 end: "$",485 className: "comment"486 }487 ]488 }489 ];490 SUBST.contains = PERL_DEFAULT_CONTAINS;491 METHOD.contains = PERL_DEFAULT_CONTAINS;492 493 return {494 name: 'Perl',495 aliases: [496 'pl',497 'pm'498 ],499 keywords: PERL_KEYWORDS,500 contains: PERL_DEFAULT_CONTAINS501 };502}503 504export { perl as default };505 