vendor: 6,963 bytes, lines 1-18
1// highlight.js/lib/languages/[email protected] downloaded from https://ga.jspm.io/npm:[email protected]/es/languages/php.js 2 3/** 4 * @param {HLJSApi} hljs 5 * @returns {LanguageDetail} 6 * */ 7function php(e){const t=e.regex;const a=/(?![A-Za-z0-9])(?![$])/;const n=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a);const r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a);const o=t.concat(/[A-Z]+/,a);const c={scope:"variable",match:"\\$+"+n};const i={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]};const s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]};const l=e.inherit(e.APOS_STRING_MODE,{illegal:null});const d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)});const p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}};const _=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/});const b="[ \t\n]";const u={scope:"string",variants:[d,l,p,_]};const E={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0};const g=["false","null","true"];const h=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"];const f=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"]; 8/** Dual-case keywords 9 * 10 * ["then","FILE"] => 11 * ["then", "THEN", "FILE", "file"] 12 * 13 * @param {string[]} items */const dualCase=e=>{ 14/** @type string[] */ 15const t=[];e.forEach((e=>{t.push(e);e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}));return t};const m={keyword:h,literal:dualCase(g),built_in:f}; 16/** 17 * @param {string[]} items */const normalizeKeywords=e=>e.map((e=>e.replace(/\|\d+$/,"")));const I={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",normalizeKeywords(f).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]};const O=t.concat(n,"\\b(?!\\()");const v={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),O],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]};const y={scope:"attr",match:t.concat(n,t.lookahead(":"),t.lookahead(/(?!::)/))};const w={relevance:0,begin:/\(/,end:/\)/,keywords:m,contains:[y,c,v,e.C_BLOCK_COMMENT_MODE,u,E,I]};const x={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",normalizeKeywords(h).join("\\b|"),"|",normalizeKeywords(f).join("\\b|"),"\\b)"),n,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(x);const M=[y,v,e.C_BLOCK_COMMENT_MODE,u,E,I];const S={begin:t.concat(/#\[\s*\\?/,t.either(r,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...M]},...M,{scope:"meta",variants:[{match:r},{match:o}]}]};return{case_insensitive:false,keywords:m,contains:[S,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:true}]}},i,{scope:"variable.language",match:/\$this\b/},c,x,v,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:true,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:true},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:true,excludeEnd:true,keywords:m,contains:["self",S,c,v,e.C_BLOCK_COMMENT_MODE,u,E]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:true,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},u,E]}}export{php as default}; 18
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.