3
V'íc ã @ s d Z ddlZddlmZmZmZmZmZmZm Z m
Z
ddlmZm
Z
mZmZmZmZmZmZmZ ddlmZ ddgZG dd deZG d d deZdS )
zÙ
pygments.lexers.perl
~~~~~~~~~~~~~~~~~~~~
Lexers for Perl, Raku and related languages.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)Ú
RegexLexerÚExtendedRegexLexerÚincludeÚbygroupsÚusingÚthisÚdefaultÚwords) ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚ
Whitespace)Úshebang_matchesÚ PerlLexerÚ
Perl6Lexerc Ù @ s e Zd ZdZdZdZddgZdddd gZd
dgZe j
e jB Zde
jd
fde
jd
fde
jd
fde
jd
fde
jd
fde
jd
fde
jd
fde
jd
fde
jd
fde
jd
fg
dejfdejfdejfedNd3d4efd5eeeeeeed6fd7ejfd8e
jfd9e
jfd:e
jfd;e
jfd<e
jfd=e
jd>fd?e
jd>fd@e
jd>fdAe
jd>fdBe
jfdCe
jd>fdDe
jfdEefedOd3d4ejfdejjfdee
e
e
je
e
jefdejdfdejj fdejj fd ejd
fde!j"fde!j#fd
e!j$fde!j%fde!j%fde!j&fde
fde
fde
j'fde
jfde
j(dfde
j(dfde
j(dfde
j(dfde
j(fdeeeej)fdeeeej)fd eeed!fedPd3d4efd&efd'efd(efd)ed*fg1d+e
j*d
fd,e
j*fgdEefd-ed
fd.ed
fd/ej)fd0ejd
fgd1ej)d
fd2ej)d
fd0ed
fd3ej+d
fd4e,d
fgd5ej-fdEefd6eeefd7ed
fd8ed
fgd9e
j(fd:e
j(fd-e
j(dfd;e
j(d
fd<e
j(fgd=e
j(fd:e
j(fd>e
j(dfd?e
j(d
fd@e
j(fgdAe
j(fd:e
j(fdBe
j(dfdCe
j(d
fdDe
j(fgdEe
j(fd:e
j(fdFe
j(dfdGe
j(d
fdHe
j(fgdIejd
fgdJZ.dKdL Z/dMS (Q r z
For Perl source code.
ÚPerlzhttps://www.perl.orgÚperlÚplz*.plz*.pmz*.tz*.perlztext/x-perlzapplication/x-perlz"/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*z#popz"!(\\\\|\\[^\\]|[^\\!])*![egimosx]*z\\(\\\\|[^\\])*\\[egimosx]*z$\{(\\\\|\\[^\\]|[^\\}])*\}[egimosx]*z"<(\\\\|\\[^\\]|[^\\>])*>[egimosx]*z%\[(\\\\|\\[^\\]|[^\\\]])*\][egimosx]*z$\((\\\\|\\[^\\]|[^\\)])*\)[egimosx]*z"@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*z"%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*z$\$(\\\\|\\[^\\]|[^\\$])*\$[egimosx]*z \A\#!.+?$z\#.*?$z^=[a-zA-Z0-9]+\s+.*?\n=cutÚcaseÚcontinueÚdoÚelseÚelsifÚforÚforeachÚifÚlastÚmyÚnextÚourÚredoÚresetÚthenÚunlessÚuntilÚwhileÚprintÚnewÚBEGINÚCHECKÚINITÚENDÚreturnz\b)Úsuffixz!(format)(\s+)(\w+)(\s*)(=)(\s*\n)Úformatz$(eq|lt|gt|le|ge|ne|not|and|or|cmp)\bz:s/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*z.s!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*z+s\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*z:s@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*z:s%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*zs\{(\\\\|\\[^\\]|[^\\}])*\}\s*zbalanced-regexzs<(\\\\|\\[^\\]|[^\\>])*>\s*zs\[(\\\\|\\[^\\]|[^\\\]])*\]\s*zs\((\\\\|\\[^\\]|[^\\)])*\)\s*z&m?/(\\\\|\\[^\\]|[^\\/\n])*/[gcimosx]*zm(?=[/!\\{<\[(@%$])z6((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*z\s+ÚabsÚacceptÚalarmÚatan2ÚbindÚbinmodeÚblessÚcallerÚchdirÚchmodÚchompÚchopÚchownÚchrÚchrootÚcloseÚclosedirÚconnectÚcosÚcryptÚdbmcloseÚdbmopenÚdefinedÚdeleteÚdieÚdumpÚeachÚendgrentÚ
endhostentÚ endnetentÚendprotoentÚendpwentÚ
endserventÚeofÚevalÚexecÚexistsÚexitÚexpÚfcntlÚfilenoÚflockÚforkÚformlineÚgetcÚgetgrentÚgetgrgidÚgetgrnamÚ
gethostbyaddrÚ
gethostbynameÚ
gethostentÚgetloginÚgetnetbyaddrÚgetnetbynameÚ getnetentÚgetpeernameÚgetpgrpÚgetppidÚgetpriorityÚgetprotobynameÚgetprotobynumberÚgetprotoentÚgetpwentÚgetpwnamÚgetpwuidÚ
getservbynameÚ
getservbyportÚ
getserventÚgetsocknameÚ
getsockoptÚglobÚgmtimeÚgotoÚgrepÚhexÚimportÚindexÚintÚioctlÚjoinÚkeysÚkillÚlcÚlcfirstÚlengthÚlinkÚlistenÚlocalÚ localtimeÚlogÚlstatÚmapÚmkdirÚmsgctlÚmsggetÚmsgrcvÚmsgsndÚoctÚopenÚopendirÚordÚpackÚpipeÚpopÚposÚprintfÚ prototypeÚpushÚ quotemetaÚrandÚreadÚreaddirÚreadlineÚreadlinkÚreadpipeÚrecvÚrefÚrenameÚreverseÚ rewinddirÚrindexÚrmdirÚscalarÚseekÚseekdirÚselectÚsemctlÚsemgetÚsemopÚsendÚsetgrentÚ
sethostentÚ setnetentÚsetpgrpÚsetpriorityÚsetprotoentÚsetpwentÚ
setserventÚ
setsockoptÚshiftÚshmctlÚshmgetÚshmreadÚshmwriteÚshutdownÚsinÚsleepÚsocketÚ
socketpairÚsortÚspliceÚsplitÚsprintfÚsqrtÚsrandÚstatÚstudyÚsubstrÚsymlinkÚsyscallÚsysopenÚsysreadÚsysseekÚsystemÚsyswriteÚtellÚtelldirÚtieÚtiedÚtimeÚtimesÚtrÚtruncateÚucÚucfirstÚumaskÚundefÚunlinkÚunpackÚunshiftÚuntieÚutimeÚvaluesÚvecÚwaitÚwaitpidÚ wantarrayÚwarnÚwritez+((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\bz/(<<)([\'"]?)([a-zA-Z_]\w*)(\2;?\n.*?\n)(\3)(\n)Z__END__zend-partz\$\^[ADEFHILMOPSTWX]z(\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)z[$@%#]+Úvarnamez0_?[0-7]+(_[0-7]+)*z0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*z0b[01]+(_[01]+)*z?(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?z(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*z
\d+(_\d+)*z'(\\\\|\\[^\\]|[^'\\])*'z"(\\\\|\\[^\\]|[^"\\])*"z`(\\\\|\\[^\\]|[^`\\])*`z<([^\s>]+)>z(q|qq|qw|qr|qx)\{z cb-stringz(q|qq|qw|qr|qx)\(z rb-stringz(q|qq|qw|qr|qx)\[z sb-stringz(q|qq|qw|qr|qx)\<z lt-stringz (q|qq|qw|qr|qx)([\W_])(.|\n)*?\2z/(package)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)z6(use|require|no)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)z
(sub)(\s+)ÚfuncnameÚnoÚpackageÚrequireÚusez=(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|!~|&&?|\|\||\.{1,3})z[-+/*%=<>&^|!\\~]=?z[()\[\]:;,<>/?{}]z(?=\w)Únamez\.\nz[^\n]*\nz\{z\)|,z\w+::z[\w:]+z+[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*(::)?(?=\s*->)z[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*::z
[A-Z_]+(?=\W)z(?=\W)z[a-zA-Z_]\w*[!?]?z(\([$@%]*\))(\s*)ú;z.*?\{z\\[{}\\]z\\z\}z[^{}\\]+z\\[()\\]z\(z\)z[^()]+z
\\[\[\]\\]z\[z\]z[^\[\]]+z\\[<>\\]z\<z\>z[^<>]+z.+)zbalanced-regexÚrootr3 rñ r÷ rò z cb-stringz rb-stringz sb-stringz lt-stringzend-partc C s: t | drdS d}tjd| r&|d7 }d| kr6|d }|S )Nr Tr z(?:my|our)\s+[$@%(]gÍÌÌÌÌÌì?z:=é )r ÚreÚsearch)ÚtextÚresult© rÿ ú8/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/perl.pyÚanalyse_textÐ s
zPerlLexer.analyse_textN)r r r r r r r r r! r"