YBFjs3dZddlZddlmZmZmZmZmZmZm Z m Z m Z m Z ddl mZmZmZmZmZmZmZmZmZmZddlmZmZmZgdZGddeZGd d eZGd d eZdS) z pygments.lexers.php ~~~~~~~~~~~~~~~~~~~ Lexers for PHP and related languages. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) Lexer RegexLexerincludebygroupsdefaultusingthiswords do_insertionsline_re) TextCommentOperatorKeywordNameStringNumber PunctuationOtherGeneric) get_bool_opt get_list_optshebang_matches) ZephirLexerPsyshConsoleLexerPhpLexerceZdZdZdZdZdgZdgZdZgdZ gdZ e j e j zZd efd ejfd ejfged d ejdfdedfedgdedfgdedfed dedfdedfdefdedfdejdfdejfdejfdejfdejfde j!fde j"fde j#fdej$fd ejfgd!Z%d"S)#rz For Zephir language source code. Zephir is a compiled high level language aimed to the creation of C-extensions for PHP. Zephirzhttp://zephir-lang.com/zephirz*.zepz2.0)fetchechoissetempty)bitbitsstring\s+//.*?\n /\*.*?\*/commentsandwhitespacez3/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)#pop/z\nz ^(?=\s|/)slashstartsregexzC\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|(<<|>>>?|==?|!=?|->|[-<>+*%&|^/])=?z[{(\[;,]z[})\].]z(for|in|while|do|break|return|continue|switch|case|default|if|else|loop|require|inline|throw|try|catch|finally|new|delete|typeof|instanceof|void|namespace|use|extends|this|fetch|isset|unset|echo|fetch|likely|unlikely|empty)\bz(var|let|with|function)\bz(abstract|boolean|bool|char|class|const|double|enum|export|extends|final|native|goto|implements|import|int|string|interface|long|ulong|char|uchar|float|unsigned|private|protected|public|short|static|self|throws|reverse|transient|volatile|readonly)\bz(true|false|null|undefined)\bzm(Array|Boolean|Date|_REQUEST|_COOKIE|_SESSION|_GET|_POST|_SERVER|this|stdClass|range|count|iterator|window)\bz[$a-zA-Z_][\w\\]*z%[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?z0x[0-9a-fA-F]+z[0-9]+z"(\\\\|\\[^\\]|[^"\\])*"z'(\\\\|\\[^\\]|[^'\\])*')r*r-badregexrootN)&__name__ __module__ __qualname____doc__nameurlaliases filenames version_addedzephir_keywords zephir_typereDOTALL MULTILINEflagsr rSingle MultilinerrRegexrrrr DeclarationReservedConstantrBuiltinrrFloatHexIntegerDoubletokensAC:\PYTHON\_runtimes\venv\Lib\site-packages\pygments/lexers/php.pyrrs D #CjG IM999O+++K I $ETN  ( 7, -" G+ , ,%|V 5 8V $ GFOO  D& ! 4!3 4 G+ , ,45=?Q S +'9 :  %"#5 7*7+>@R S/180@ B.w/? @< )"4: . 5v| D  +  ' (&- 8 (&- 83 !++FFFrLrc0eZdZdZdZdZdgZdZdZdZ dS) ru For PsySH console output, such as: .. sourcecode:: psysh >>> $greeting = function($name): string { ... return "Hello, {$name}"; ... }; => Closure($name): string {#2371 …3} >>> $greeting('World') => "Hello, World" zPsySH console session for PHPzhttps://psysh.org/psyshz2.7c 4d|d<tj|fi|dS)NT startinline)r__init__)selfoptionss rMrRzPsyshConsoleLexer.__init__is*!%  t''w'''''rLc # Ktdi|j}d}g}tj|D]3}|}|ds|drH|t|dtj |ddfgf||ddz }| dkr@|t|dtj dfgf||ddz }|r-t|| |Ed{Vd}g}| tj|fV5|r+t|| |Ed{VdSdS) Nz>>> z... rz...rK)rrTr finditergroup startswithappendlenrPromptrstripr get_tokens_unprocessedstartOutput)rStextphplexercurcode insertionsmatchlines rMr`z(PsyshConsoleLexer.get_tokens_unprocessedms++dl++ %d++ : :E;;==Dv&& :$//&*A*A :!!3w<<%&RaR$A#B#DEEE48#%''!!3w<<%&$>#?#ABBB48#$,"H$C$CG$L$L N NNNNNNNN G!#JkkmmW^T99999  O$Z%-%D%DW%M%MOO O O O O O O O O O O OrLN) r0r1r2r3r4r5r6r8rRr`rKrLrMrrWsY   +D CiGM(((OOOOOrLrceZdZdZdZdZgdZgdZdgZdZ dZ d Z e j e jze jzZd ejd fd efd efggdejdfde zdzeeeejeejeefdefdedfdejfdejfdejfdejfdejfde zdzeeeejfdefdefdefdeeeefd eeed!fd"eeefd#eeeeed$fd%e zdzeeeej fd&efd'ej fe!d(d)ej"d*fd+e zej"fe ejfd,e#j$fd-e#j$fd.e#j%fd/e#j&fd0e#j'fd1e#j(fd2ejfd3ej)fd4ej*d5fd6ej"dfe!d ge+d7d89ej,j-fge+d:d89ej fge ej.dfge!d;e ej,dfe/dgd4ej*dfde zd?ze zd@zej1fdAeej1e2e3dBCej1fdDeej1e2e3dBCej1fdEeej1ej"ej1fdFej*fgdGedfdHedIfe ej4fe!d gdJedfe!d gdK Z5dLZ6dMZ7dNZ8dOS)Pra; For PHP source code. For PHP embedded in HTML, use the `HtmlPhpLexer`. Additional options accepted: `startinline` If given and ``True`` the lexer starts highlighting with php code (i.e.: no starting ``>> from pygments.lexers._php_builtins import MODULES >>> MODULES.keys() ['PHP Options/Info', 'Zip', 'dba', ...] In fact the names of those modules match the module names from the php documentation. PHPzhttps://www.php.net/)phpphp3php4php5)z*.phpz *.php[345]z*.incz text/x-phprVz1(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*z+(?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*z <\?(php)?rkz[^<]+r+z(<<<)([\'"]?)(z)(\2\n.*?\n\s*)(\3)(;?)(\n)r'z#\[ attributez#.*?\nr(z/\*\*/z /\*\*.*?\*/r)z (->|::)(\s*)()z[~!%^&*+=|:.<>/@-]+z\?z [\[\]{}();,]+z(new)(\s+)(class)\bz (class)(\s+) classnamez(function)(\s*)(?=\()z(function)(\s+)(&?)(\s*) functionnamez (const)(\s+)(a&(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield( from)?|finally|match|readonly)\bz(true|false|null)\bmagicconstantsz\$\{variablevariablez\$+z"(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?z\d+e[+-]?[0-9]+z0[0-7]+z 0x[a-f0-9]+z\d+z0b[01]+z'([^'\\]*(?:\\.[^'\\]*)*)'z`([^`\\]*(?:\\.[^`\\]*)*)`"r&z\}) __construct __destruct__call __callStatic__get__set__isset__unset__sleep__wakeup __toString__invoke __set_state__clone __debugInfoz\b)suffix) __LINE____FILE____DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ __PROPERTY__ magicfuncsz [^{$"\\]+z'\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})z\$z (\[\S+?\]|->z)?z(\{\$\{)(.*?)(\}\})T) _startinlinez(\{)(\$.*?)(\})z(\$\{)(\S+)(\})z[${\\]z\]z\(attributeparamsz\)) r/rkrurrtrrrsr&rprc t|dd|_t|ddg|_t|dd|_d|vr|d|_t |_|jrCdd lm }| D](\}}||jvr|j |)tj |fi|dS) NfuncnamehighlightingTdisabledmodulesunknownrQFrr)MODULES)rrrrrQpopset _functionspygments.lexers._php_builtinsritemsupdaterrR)rSrTrkeyvalues rMrRzPhpLexer.__init__)s$0 +T%3%3!+ &  5 5'FF W $ $&{{>::D %%  $ 2 = = = = = =%mmoo 2 2 Ud222O**5111D,,G,,,,,rLc#Kdg}|jr|dtj|||D]6\}}}|tjur||jvr|tj|fV/|||fV7dS)Nr/rk)rQr\rr`rrrrE)rSrcstackindextokenrs rMr`zPhpLexer.get_tokens_unprocessed=s   LL   1$eDD & & E5% ""DO++u4444% % % % %  & &rLcbt|drdSd}tjd|r|dz }|S)NrkTgz <\?(?!xml)g333333?)rr;search)rcrvs rM analyse_textzPhpLexer.analyse_textIs@ 4 ( ( 4  9]D ) )  #IB rLN)9r0r1r2r3r4r5r6r7 mimetypesr8 _ident_inner _ident_nonsr; IGNORECASEr<r=r>rPreprocrrr Delimiterrr r?r@Docrr AttributerrDrVariablerrFOctrGrHBinBacktickrIr FunctionMagicClassrEscapeInterpolrr DecoratorrJrRr`rrKrLrMrrs@ D C---G000IIMHL@K MBI % 4E7?E 2 u  5M 4 W_f -4  ,/M M Xfff&6@P!4)) *4 TN 4 [+ . 4  '4  (4 ) *4 VZ (4 7, -4  +c 1 Xhdn 5 5 74 $X .!4 "H #4 ${ +%4 &$XXgtW%E%E F'4 (hhw55{ C)4 *&xx'>'> ?+4 ,) XgtXt 4 4n F-4 0 ,s 2 XgtT] 3 3 514 6 *,3 474 L$W%5 6M4 N G$ % %O4 Pdm%7 8Q4 Rl "DM 2S4 T4: &U4 V3FL AW4 X  .Y4 Z $[4 \VZ (]4 ^V^ $_4 ` $a4 b+FM :c4 d+FO * GENN  K ( GENN [qqFf---( & & &rLr) r3r;pygments.lexerrrrrrrr r r r pygments.tokenr rrrrrrrrr pygments.utilrrr__all__rrrrKrLrMrs ////////////////////////((((((((((((((((((((((((EEEEEEEEEE : : :>>>>>*>>>B-O-O-O-O-O-O-O-O`HHHHHzHHHHHrL