B
    b                 @   s  d Z ddlZddlmZmZmZmZmZmZm	Z	 ddl
mZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddd	d
ddddddddddddddddgZG dd deZG dd deZG dd	 d	eZdd ZG d d
 d
eZ G d!d deZ!G d"d deZ"G d#d deZ#G d$d deZ$G d%d deZ%G d&d deZ&G d'd deZ'G d(d deZ(G d)d deZ)G d*d deZ*G d+d deZ+G d,d deZ,G d-d deZ-G d.d deZ.G d/d deZ/G d0d deZ0dS )1z
    pygments.lexers.configs
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for configuration file formats.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)ExtendedRegexLexer
RegexLexerdefaultwordsbygroupsincludeusing)TextCommentOperatorKeywordNameStringNumberPunctuation
WhitespaceLiteralErrorGeneric)	BashLexer)	JsonLexerIniLexerRegeditLexerPropertiesLexerKconfigLexerCfengine3LexerApacheConfLexerSquidConfLexerNginxConfLexerLighttpdConfLexerDockerLexerTerraformLexerTermcapLexerTerminfoLexerPkgConfigLexerPacmanConfLexerAugeasLexer	TOMLLexerNestedTextLexerSingularityLexerUnixConfigLexerc               @   s   e Zd ZdZdZdddgZdddd	d
ddddddddddgZddgZddefde	j
fdefdeejeeeefdejfgiZdd ZdS ) r   z5
    Lexer for configuration files in INI style.
    ZINIZiniZcfgZdosiniz*.iniz*.cfgz*.infz.editorconfigz	*.servicez*.socketz*.devicez*.mountz*.automountz*.swapz*.targetz*.pathz*.timerz*.slicez*.scopez
text/x-iniztext/infrootz\s+z[;#].*z\[.*?\]$z"(.*?)([ \t]*)(=)([ \t]*)([^\t\n]*)z(.+?)$c             C   s2   |  d}|dk rdS | d dko0| |d  dkS )N
   Fr   [   ])find)textZnpos r3   6lib/python3.7/site-packages/pygments/lexers/configs.pyanalyse_text8   s    
zIniLexer.analyse_textN)__name__
__module____qualname____doc__namealiases	filenames	mimetypesr   r
   Singler   r   r   	Attributer   r   tokensr5   r3   r3   r3   r4   r      s   

c               @   s   e Zd ZdZdZdZdgZdgZdgZde	fde
fd	ejfd
eeeejefdeeje
ee
dfdeeje
ee
dfgdedfdeejeedfdedfedgdZdd ZdS )r   zZ
    Lexer for Windows Registry files produced by regedit.

    .. versionadded:: 1.6
    Zregz8http://en.wikipedia.org/wiki/Windows_Registry#.REG_filesregistryz*.regztext/x-windows-registryzWindows Registry Editor.*z\s+z[;#].*z(\[)(-?)(HKEY_[A-Z_]+)(.*?\])$z)("(?:\\"|\\\\|[^"])+")([ \t]*)(=)([ \t]*)valuez(.*?)([ \t]*)(=)([ \t]*)-z#popz1(dword|hex(?:\([0-9a-fA-F]\))?)(:)([0-9a-fA-F,]+)z.+)r+   rB   c             C   s
   |  dS )NzWindows Registry Editor)
startswith)r2   r3   r3   r4   r5   f   s    zRegeditLexer.analyse_textN)r6   r7   r8   r9   r:   urlr;   r<   r=   r	   r   r
   r>   r   r   r   r   Builtinr?   Variabler   r   r   r   r@   r5   r3   r3   r3   r4   r   ?   s.   c               @   sz   e Zd ZdZdZddgZdgZdgZddee	j
eefd	e	j
fd
eeefdeeefdee	j
eeeefdefgiZdS )r   z
    Lexer for configuration files in Java's properties format.

    Note: trailing whitespace counts as part of the value as per spec

    .. versionadded:: 1.4
    Z
PropertiesZ
propertiesZjpropertiesz*.propertiesztext/x-java-propertiesr+   z^(\w+)([ \t])(\w+\s*)$z^\w+(\\[ \t]\w*)*$z(^ *)([#!].*)z(^ *)((?:;|//).*)z/(.*?)([ \t]*)([=:])([ \t]*)(.*(?:(?<=\\)\n.*)*)z\sN)r6   r7   r8   r9   r:   r;   r<   r=   r   r   r?   r   r   r
   r   r@   r3   r3   r3   r4   r   j   s   c             C   sB   d}|dkrd}nd|d  }| dkr,d}nd|  }d|||f S )	N      +z{1,%d}r/    z{%s}z(?:\t| %s\t| {%s})%s.*\nr3   )levelZ	tab_widthZspace_repeatZlevel_repeatr3   r3   r4   
_rx_indent   s    rM   c               @   s  e Zd ZdZdZddddgZddd	d
gZdgZdZdd Z	dd Z
defdejfedddefdedfdejfdefdefdejfdejfdejfdefgdefe	d e	d!e	d"e	d#e	d$e	d%e	d&ed'g	e
d e
d!e
d"e
d#e
d$e
d%e
d&d(	Zd)S )*r   zC
    For Linux-style Kconfig files.

    .. versionadded:: 1.6
    ZKconfigZkconfig
menuconfigzlinux-configzkernel-configzKconfig*z*Config.in*zexternal.in*zstandard-modules.inztext/x-kconfigr   c             C   s   t | tjd|  fS )Nzindent%s)rM   r   Doc)rL   r3   r3   r4   call_indent   s    zKconfigLexer.call_indentc             C   s   t | tjfdtftdgS )Nz\s*\nz#pop:2)rM   r   rO   r	   r   )rL   r3   r3   r4   	do_indent   s    zKconfigLexer.do_indentz\s+z#.*?\n)ZmainmenuZconfigrN   choiceZ	endchoicecommentZmenuZendmenuz
visible ififZendifsourcepromptZselectz
depends onr   rangeoptionz\b)suffixz(---help---|help)[\t ]*\nhelpz;(bool|tristate|string|hex|int|defconfig_list|modules|env)\bz[!=&|]z[()]z[0-9]+z'(''|[^'])*'z"(""|[^"])*"z\S+z\s*\n            r-   rI   r/   z#pop)	r+   rZ   Zindent7Zindent6Zindent5Zindent4Zindent3Zindent2Zindent1N)r6   r7   r8   r9   r:   r;   r<   r=   flagsrP   rQ   r   r
   r>   r   r   r   rF   r   r   r   Integerr   Doubler	   r   r@   r3   r3   r3   r4   r      sP   c               @   sr  e Zd ZdZdZdZddgZdgZg Zde	fde
eeeeefd	e
eeeeejed
fde
eeeeejfde
eejeeejeeefde
ejeeefdedfde
ejefde
ejefde
ejefdejfdefdefdefdejfdejfdejfdefgdejdfdejfdedfdefd efgdejd!fd"ejdfd#ejfgd$edfd%efdejfdefgd&Zd'S )(r   zF
    Lexer for CFEngine3 policy files.

    .. versionadded:: 1.5
    Z	CFEngine3zhttp://cfengine.orgZ	cfengine3Zcf3z*.cfz#.*?\nz(body)(\s+)(\S+)(\s+)(control)z%(body|bundle)(\s+)(\S+)(\s+)(\w+)(\()arglistz!(body|bundle)(\s+)(\S+)(\s+)(\w+)z7(")([^"]+)(")(\s+)(string|slist|int|real)(\s*)(=>)(\s*)z(\S+)(\s*)(=>)(\s*)"stringz	(\w+)(\()z([\w.!&|()]+)(::)z(\w+)(:)z@[{(][^)}]+[})]z[(){},;]z=>z->z\d+\.\d+z\d+z\w+z\s+z\$[{(]interpolz\\.z#popz\n.z#pushz[})]z	[^${()}]+z\),)r+   rd   re   rb   N)r6   r7   r8   r9   r:   rE   r;   r<   r=   r
   r   r   r   r   Functionr   rG   Typer   Reservedr	   r   ClassDeclarationr   Floatr`   InterpolEscaper@   r3   r3   r3   r4   r      sV   




c               @   s   e Zd ZdZdZdddgZdddgZd	gZej	ej
B Zd
efdefdeejeeejfdeejejfdejdfdefgdefdedfdefdefdefdefdejfdefdejfdefg
dZdS )r   zo
    Lexer for configuration files following the Apache config file
    format.

    .. versionadded:: 0.6
    Z
ApacheConfZ
apacheconfZaconfZapachez	.htaccesszapache.confzapache2.confztext/x-apacheconfz\s+z#(.*\\\n)+.*$|(#.*?)$z"(<[^\s>/][^\s>]*)(?:(\s+)(.*))?(>)z(</[^\s>]+)(>)z[a-z]\w*rB   z\.+z\\\nz\n+z#popz\\z[^\S\n]+z\d+\.\d+\.\d+\.\d+(?:/\d+)?z\d+z/([*a-z0-9][*\w./-]+)z(on|off|none|any|all|double|email|dns|min|minimal|os|productonly|full|emerg|alert|crit|error|warn|notice|info|debug|registry|script|inetd|standalone|user|group)\bz"([^"\\]*(?:\\(.|\n)[^"\\]*)*)"z	[^\s"\\]+)r+   rB   N)r6   r7   r8   r9   r:   r;   r<   r=   re	MULTILINE
IGNORECASEr_   r   r
   r   r   Tagr   rF   r	   r   ZOtherr   ra   r@   r3   r3   r3   r4   r   %  s2   


c               @   s  e Zd ZdZdZdZdddgZdgZdgZe	j
ZdZd	Zd
ZdZdZdZdZdefdedfeedddefeedddejfeedddefeedddefeedddefeedddefed e d ejfdefdefgdejdfdedfedgdZdS ) r   zI
    Lexer for squid configuration files.

    .. versionadded:: 0.9
    Z	SquidConfzhttp://www.squid-cache.org/Z	squidconfz
squid.confZsquidztext/x-squidconf)Z
access_logZaclZalways_directZannounce_hostZannounce_periodZannounce_portZannounce_toZanonymize_headersZappend_domainZas_whois_serverZauth_param_basicZauthenticate_childrenZauthenticate_programZauthenticate_ttlZbroken_postsZbuffered_logsZcache_access_logZcache_announce	cache_dirZcache_dns_programZcache_effective_groupZcache_effective_userZ
cache_hostZcache_host_aclZcache_host_domainZ	cache_logZ	cache_memZcache_mem_highZcache_mem_lowZ	cache_mgrZcachemgr_passwdZ
cache_peerZcache_peer_accessZcache_replacement_policyZcache_stoplistZcache_stoplist_patternZcache_store_logZ
cache_swapZcache_swap_highZcache_swap_logZcache_swap_lowZ	client_dbZclient_lifetimeZclient_netmaskZconnect_timeoutZcoredump_dirZdead_peer_timeoutZdebug_optionsZdelay_accessZdelay_classZdelay_initial_bucket_levelZdelay_parametersZdelay_poolsZ	deny_infoZdns_childrenZdns_defnamesZdns_nameserversZdns_testnamesZemulate_httpd_logZerr_html_textZfake_user_agentZfirewall_ipZforwarded_forZforward_snmpd_portZfqdncache_sizeZftpget_optionsZftpget_programZftp_list_widthZftp_passiveZftp_userZhalf_closed_clientsZheader_accessZheader_replaceZhierarchy_stoplistZhigh_response_time_warningZhigh_page_fault_warningZ
hosts_fileZ	htcp_portZhttp_accessZhttp_anonymizerZhttpd_accelZhttpd_accel_hostZhttpd_accel_portZhttpd_accel_uses_host_headerZhttpd_accel_with_proxyZ	http_portZhttp_reply_accessZ
icp_accessZicp_hit_staleZicp_portZicp_query_timeoutZident_lookupZident_lookup_accessZident_timeoutZincoming_http_averageZincoming_icp_averageZinside_firewallZipcache_highZipcache_lowZipcache_sizeZlocal_domainZlocal_ipZlogfile_rotateZlog_fqdnZlog_icp_queriesZlog_mime_hdrsZmaximum_object_sizeZmaximum_single_addr_triesZmcast_groupsZmcast_icp_query_timeoutZmcast_miss_addrZmcast_miss_encode_keyZmcast_miss_portZmemory_poolsZmemory_pools_limitZmemory_replacement_policyZ
mime_tableZmin_http_poll_cntZmin_icp_poll_cntZminimum_direct_hopsZminimum_object_sizeZminimum_retry_timeoutZmiss_accessZnegative_dns_ttlZnegative_ttlZneighbor_timeoutZneighbor_type_domainZ
netdb_highZ	netdb_lowZnetdb_ping_periodZnetdb_ping_rateZnever_directZno_cacheZpassthrough_proxyZpconn_timeoutZpid_filenameZpinger_programZpositive_dns_ttlZprefer_directZ
proxy_authZproxy_auth_realmZ
query_icmpZquick_abortZquick_abort_maxZquick_abort_minZquick_abort_pctZrange_offset_limitZread_timeoutZredirect_childrenZredirect_programZredirect_rewrites_host_headerZreference_ageZrefresh_patternZreload_into_imsZrequest_body_max_sizeZrequest_sizeZrequest_timeoutZshutdown_lifetimeZsingle_parent_bypassZsiteselect_timeoutZsnmp_accessZsnmp_incoming_addressZ	snmp_portZsource_pingZ	ssl_proxyZstore_avg_object_sizeZstore_objects_per_bucketZstrip_query_termsZswap_level1_dirsZswap_level2_dirsZtcp_incoming_addressZtcp_outgoing_addressZtcp_recv_bufsizeZtest_reachabilityZudp_hit_objZudp_hit_obj_sizeZudp_incoming_addressZudp_outgoing_addressZunique_hostnameZunlinkd_programZuri_whitespaceZuseragent_logZvisible_hostnameZ
wais_relayZwais_relay_hostZwais_relay_port)z
proxy-onlyZweightZttlzno-queryr   zround-robinzmulticast-responderZonZoffallZdenyZallowZviaparentz	no-digestheapZlruZrealmZchildrenZq1Zq2ZcredentialsttlZnonedisableZoffline_toggleZdiskd)ZshutdowninfoZ	parameterZserver_listZclient_listz
squid.conf)ZobjectsZ
vm_objectsZutilizationZipcacheZ	fqdncacheZdnsZ
redirectorioZreply_headersZfiledescriptorsZnetdb)statusenablerx   clear)Z	url_regexZurlpath_regexZreferer_regexZportprotoZreq_mime_typeZrep_mime_typemethodZbrowserusersrcdstZtimeZ	dstdomainZidentZsnmp_communitya  (?:(?:(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|0x0*[0-9a-f]{1,2}|0+[1-3]?[0-7]{0,2})(?:\.(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|0x0*[0-9a-f]{1,2}|0+[1-3]?[0-7]{0,2})){3})|(?!.*::.*::)(?:(?!:)|:(?=:))(?:[0-9a-f]{0,4}(?:(?<=::)|(?<!::):)){6}(?:[0-9a-f]{0,4}(?:(?<=::)|(?<!::):)[0-9a-f]{0,4}(?:(?<=::)|(?<!:)|(?<=:)(?<!::):)|(?:25[0-4]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-4]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))z\s+#rS   z\b)prefixrY   zstats/zlog/=z(?:/(?:z|\b\d+\b))?z(?:\b\d+\b(?:-\b\d+|%)?)z\S+z	\s*TAG:.*z#popz.+)r+   rS   N) r6   r7   r8   r9   r:   rE   r;   r<   r=   rp   rr   r_   keywordsZoptsactionsZactions_statsZactions_logZaclsZip_rer   r
   r   r   r   Constantr   r   rm   r	   ro   r   r@   r3   r3   r3   r4   r   P  s8   
;
c               @   s   e Zd ZdZdZdZdgZdgZdgZde	e
eefde
d	fed
gdedfde
jd	fed
gdedfdedfed
gdejfdejfdejfde	eeejfdefdejfde	eeejfdefdefdefdefdefgdZdS )r   zJ
    Lexer for Nginx configuration files.

    .. versionadded:: 0.11
    zNginx configuration filezhttp://nginx.net/Znginxz
nginx.confztext/x-nginx-confz(include)(\s+)([^\s;]+)z[^\s;#]+stmtbasez\}z#pop:2z\{block;z#popz#.*\nzon|offz\$[^\s;#()]+z([a-z0-9.-]+)(:)([0-9]+)z[a-z-]+/[a-z-+]+z[0-9]+[km]?\bz(~)(\s*)([^\s{]+)z[:=~]z[^\s;#{}$]+z	/[^\s;#]*z\s+z[$;])r+   r   r   r   N)r6   r7   r8   r9   r:   rE   r;   r<   r=   r   r   r   r   r   r   	Namespacer
   r>   r   rG   r   r`   r   Regexr	   r@   r3   r3   r3   r4   r     s8   
c               @   sv   e Zd ZdZdZdZddgZdgZdgZdd	e	j
fd
efdefdefdefdefdejfdefdejfdefg
iZdS )r   zM
    Lexer for Lighttpd configuration files.

    .. versionadded:: 0.11
    zLighttpd configuration filezhttp://lighttpd.net/ZlighttpdZlightyzlighttpd.confztext/x-lighttpd-confr+   z#.*\nz/\S*z[a-zA-Z._-]+z\d+\.\d+\.\d+\.\d+(?:/\d+)?z[0-9]+z=>|=~|\+=|==|=|\+z\$[A-Z]+z[(){}\[\],]z"([^"\\]*(?:\\.[^"\\]*)*)"z\s+N)r6   r7   r8   r9   r:   rE   r;   r<   r=   r
   r>   r   r   r   r   rF   r   r   ra   r   r@   r3   r3   r3   r4   r     s"   c               @   s  e Zd ZdZdZdZddgZddgZdgZd	Z	d
Z
dZejejB Zddefdeeeeeeeefdef eeeeefdeef eeeeefdef eeeeeeefdeef eeeeefde	 eeeefde
f eeefdeefg	iZdS )r    zJ
    Lexer for Docker configuration files.

    .. versionadded:: 2.0
    ZDockerzhttp://docker.ioZdockerZ
dockerfileZ
Dockerfilez*.dockerztext/x-dockerfile-configz-(?:MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)z-(?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY)z(?:\s*\\?\s*)r+   z#.*z1(FROM)([ \t]*)(\S*)([ \t]*)(?:(AS)([ \t]*)(\S*))?z(ONBUILD)(\s+)(%s)z$(HEALTHCHECK)(\s+)((%s--\w+=\w+%s)*)z/(VOLUME|ENTRYPOINT|CMD|SHELL)(\s+)(%s)(\[.*?\])z$(LABEL|ENV|ARG)(\s+)((%s\w+=\w+%s)*)z(%s|VOLUME)\b(\s+)(.*)z	(%s)(\s+)z(.*\\\n)*.+N)r6   r7   r8   r9   r:   rE   r;   r<   r=   Z	_keywordsZ_bash_keywordsZ_lbrp   rr   rq   r_   r
   r   r   r   r   r   r   r   r@   r3   r3   r3   r4   r      s0   

c               @   s   e Zd ZdZdZdZddgZdgZddgZd	Z	d

de	ZdZdZdZdZdZdZdZdZdZdZee e e e e e e e Zd

deZdd Zededdeejfeddddej feeddde!j"fededd e#fgd!e$j%d"fd#e$j&fedd$ee'ej(e'e)e'e*fd%ee'ej+e'e)e'fd&ee'e,jje'e)e'fed' eej-e*fd(ee*ej(e*fed) ee!j.e'ej/e'ej0e'e*fd*efg
d+eej0fd,eej0fgd-e*fgd.e$j%fd/e$j%d0fd1e$j%d2fd3e$j%fgd4e'fd5e'fd6ee1e'fgd7Z2d8S )9r!   zH
    Lexer for terraformi ``.tf`` files.

    .. versionadded:: 2.1
    Z	Terraformzhttps://www.terraform.io/Z	terraformZtfz*.tfzapplication/x-tfzapplication/x-terraform)ZbackenddatamoduleoutputZproviderZprovisionerresourcevariablez({})|)	rd   ZnumberboollisttuplemapsetobjectZnull)	absZceilZfloorlogmaxZmixZparseintpowZsignum)ZchompformatZ
formatlistindentjoinlowerregexZregexallreplacesplitZstrrevZsubstrtitleZtrimZ
trimprefixZ
trimsuffixZ	trimspaceupper)ZalltrueZanytrueZ	chunklistZcoalesceZcoalescelistZcompactconcatcontainsZdistinctelementZflattenindexkeyslengthr   lookupr   Z	matchkeysmergerW   reverseZsetintersectionZ
setproductZsetsubtractZsetunionslicesortsumZ	transposevaluesZzipmap)Zbase64decodeZbase64encodeZ
base64gzipZ	csvdecodeZ
jsondecodeZ
jsonencodeZtextdecodebase64Ztextencodebase64Z	urlencodeZ
yamldecodeZ
yamlencode)	abspathdirnameZ
pathexpandbasenamefileZ
fileexistsZfilesetZ
filebase64Ztemplatefile)Z
formatdateZtimeaddZ	timestamp)Zbase64sha256Zbase64sha512ZbcryptZfilebase64sha256Zfilebase64sha512Zfilemd5Zfilesha1Z
filesha256Z
filesha512Zmd5Z
rsadecryptZsha1Zsha256Zsha512ZuuidZuuidv5)ZcidrhostZcidrnetmaskZ
cidrsubnetZcidrsubnets)	ZcandefaultsZtobooltolistZtomapZtonumberZtosetZtostringtryc       
      c   sR  | d}|t|dfV  | dtj|dfV  | d|_|d|_|jtj|dfV  | |_|d}d}g }t	d}x|
|j|jD ]~}|r|  }n|  }||krx"|D ]}	|	  tj|	 fV  qW |  tj| fV  | |_P q|| qW x"|D ]}	|	  t|	 fV  q$W t|j|_d S )Nr/   rI   r-   Tz.*?
)startr   groupr   Z	DelimiterposendZHeredocrp   compilefinditerr2   striprstripappendr   len)
selfmatchZctxr   ZhdnameZtolerantlinesZline_reZcheckZamatchr3   r3   r4   heredoc_callback  s2    







zTerraformLexer.heredoc_callbackbasic
whitespacez(".*"))trueZfalsez\b)r   rY   
identifierpunctuationz[0-9]+z\s*/\*rS   z\s*(#|//).*\nz'(\s*)([0-9a-zA-Z-_]+)(\s*)(=?)(\s*)(\{)z"(\s*)([0-9a-zA-Z-_]+)(\s*)(=)(\s*)z(\s*)("\S+")(\s*)([=:])(\s*)z(\()z(\[)([a-z_,\s]+)(\])z8(\s+)("[0-9a-zA-Z-_]+")?(\s*)("[0-9a-zA-Z-_]+")(\s+)(\{)z(<<-?)\s*([a-zA-Z_]\w*)(.*?\n)z\b(var\.[0-9a-zA-Z-_\.\[\]]+)\bz.\b([0-9a-zA-Z-_\[\]]+\.[0-9a-zA-Z-_\.\[\]]+)\bz[\[\]()\{\},.?:!=]z[^*/]z/\*z#pushz\*/z#popz[*/]z\nz\s+z(\\)(\n))r+   r   r   r   rS   r   N)3r6   r7   r8   r9   r:   rE   r;   r<   r=   classesr   r   Z
classes_retypesZnumeric_functionsZstring_functionsZcollection_functionsZencoding_functionsZfilesystem_functionsZdate_time_functionsZhash_crypto_functionsZip_network_functionsZtype_conversion_functionsbuiltinsZbuiltins_rer   r   r   r   ra   r   r   r   r   ri   r   r
   	Multiliner>   r   rF   r   r   r?   r   rh   rj   rk   rG   r	   r@   r3   r3   r3   r4   r!   C  sn   	(



c            	   @   s   e Zd ZdZdZdgZddgZg Zdefde	j
dfdefgd	ed
fdedfdefde	jfgdeeefdedfdeeefdedfdefde	jfgdefded
fdefdefgdZdS )r"   zm
    Lexer for termcap database source.

    This is very simple and minimal.

    .. versionadded:: 2.1
    ZTermcapZtermcapztermcap.srcz^#.*z
^[^\s#:|]+namesz\s+z\nz#pop:defsz\|z[^:|]+z(\\)(\n[ \t]*)z\n[ \t]*z#pop:2z(#)([0-9]+)r   r   z	[^\s:=#]+z\\072z[^:\\]+rf   )r+   r   r   r   N)r6   r7   r8   r9   r:   r;   r<   r=   r
   r   rs   r   r   r?   r   r	   r   r   rk   r   r@   r3   r3   r3   r4   r"     s,   	


c            
   @   s   e Zd ZdZdZdgZddgZg Zdefde	j
dfdefgd	ed
fdeeedfdefde	jfgdefd	edfdeeefdedfdeeefde	jfgdefdeeed
fdefdefgdZdS )r#   zn
    Lexer for terminfo database source.

    This is very simple and minimal.

    .. versionadded:: 2.1
    ZTerminfoZterminfozterminfo.srcz^#.*$z
^[^\s#,|]+r   z\s+z\nz#popz(,)([ \t]*)r   z\|z[^,|]+z\n[ \t]+z#pop:2z(#)([0-9]+)r   r   z	[^\s,=#]+z\\[,\\]z[^\\,]+rf   )r+   r   r   r   N)r6   r7   r8   r9   r:   r;   r<   r=   r
   r   rs   r   r   r   r?   r   r   rk   r   r@   r3   r3   r3   r4   r#     s,   	


c            
   @   s   e Zd ZdZdZdZdgZdgZg Zde	j
fdeejefdeejed	fed
defdefdefgdefdejdfgdejdfdejfged
de	j
dfdedfdefdefdefgdZdS )r$   z
    Lexer for pkg-config
    (see also `manual page <http://linux.die.net/man/1/pkg-config>`_).

    .. versionadded:: 2.1
    Z	PkgConfigz4http://www.freedesktop.org/wiki/Software/pkg-config/Z	pkgconfigz*.pcz#.*$z	^(\w+)(=)z^([\w.]+)(:)spvalueinterpz\s+z[^${}#=:\n.]+rf   z\$\$z\$\{curlyz\}z#popz\w+z\nz[^${}#\n\s]+)r+   r   r   r   N)r6   r7   r8   r9   r:   rE   r;   r<   r=   r
   r>   r   r   r?   r   rs   r   r   r   r	   r   rn   r@   r3   r3   r3   r4   r$   N  s0   


c            	   @   s   e Zd ZdZdZdZdgZdgZg Zdde	j
fdeeeefd	eejeefd
eeejefedddejfdefdefgiZdS )r%   a[  
    Lexer for pacman.conf.

    Actually, IniLexer works almost fine for this format,
    but it yield error token. It is because pacman.conf has
    a form without assignment like:

        UseSyslog
        Color
        TotalDownload
        CheckSpace
        VerbosePkgLists

    These are flags to switch on.

    .. versionadded:: 2.1
    Z
PacmanConfz3https://www.archlinux.org/pacman/pacman.conf.5.htmlZ
pacmanconfzpacman.confr+   z#.*$z^(\s*)(\[.*?\])(\s*)$z(\w+)(\s*)(=)z^(\s*)(\w+)(\s*)$)z$repoz$archz%oz%uz\b)rY   z\s+rf   N)r6   r7   r8   r9   r:   rE   r;   r<   r=   r
   r>   r   r   r   r   r?   r   r   rG   r	   r@   r3   r3   r3   r4   r%     s&   c               @   s  e Zd ZdZdZdZdgZdgZdee	j
eej
fdee	jeejfdeejefd	eeejee	jefd
ejdfdefdefdejdfdejdfdeej
eejfdejfdefgdejfdejfdejdfgdejfdejfdejdfgdejfd
ejdfdejdfdejfgdZdS )r&   z6
    Lexer for Augeas.

    .. versionadded:: 2.4
    ZAugeaszhttp://augeas.netZaugeasz*.augz(module)(\s*)([^\s=]+)z(let)(\s*)([^\s=]+)zV(del|store|value|counter|seq|key|label|autoload|incl|excl|transform|test|get|put)(\s+)z8(\()([^:]+)(\:)(unit|string|regexp|lens|tree|filter)(\))z\(\*rS   z[*+\-.;=?|]z
[()\[\]{}]rc   rd   z\/r   z([A-Z]\w*)(\.)(\w+)rf   z\s+z\\.z[^"]z#popz[^/]z[^*)]z#pushz\*\)z[)*])r+   rd   r   rS   N)r6   r7   r8   r9   r:   rE   r;   r<   r   r   r   r   r   rl   rG   rF   r   ri   r
   r   r   r   ra   r   ro   r@   r3   r3   r3   r4   r&     s6   




c               @   s   e Zd ZdZdZdZdgZdddgZdd	ee	e
fd
e	fde	fdejfdefdefdefde
jfdefdejfdejfdejfdejfdejfdefdefdefgiZdS )r'   z\
    Lexer for TOML, a simple language
    for config files.

    .. versionadded:: 2.4
    ZTOMLz!https://github.com/toml-lang/tomlZtomlz*.tomlZPipfilezpoetry.lockr+   z^(\s*)(\[.*?\])$z[ \t]+z\nz#.*?$z"(\\\\|\\[^\\]|[^"\\])*"z\'\'\'(.*)\'\'\'z
\'[^\']*\'z(true|false)$z[a-zA-Z_][\w\-]*z>\d{4}-\d{2}-\d{2}(?:T| )\d{2}:\d{2}:\d{2}(?:Z|[-+]\d{2}:\d{2})z'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?z\d+[eE][+-]?[0-9]+j?z[+-]?(?:(inf(?:inity)?)|nan)z[+-]?\d+z[]{}:(),;[]z\.r   N)r6   r7   r8   r9   r:   rE   r;   r<   r   r   r   r
   r>   r   r   r   r   r`   rm   r   r   r@   r3   r3   r3   r4   r'     s.   
c               @   s   e Zd ZdZdZdZddgZdgZdZdd	e	e
efd
e	e
ee
ee
fde	e
ee
ee
fede	e
eeeee
fede	e
eeeee
fde	e
eee
ee
fgiZdS )r(   z\
    Lexer for NextedText, a human-friendly data
    format.

    .. versionadded:: 2.9
    Z
NestedTextzhttps://nestedtext.orgZ
nestedtextntz*.ntz#^(\s*)({0})(.*?)({0}: ?)(.*?)(\s*)$r+   z^(\s*)(#.*?)$z^(\s*)(>)( ?)(.*?)(\s*)$z^(\s*)(-)( ?)(.*?)(\s*)$'rc   z^(\s*)(.*?)(:)( ?)(.*?)(\s*)$N)r6   r7   r8   r9   r:   rE   r;   r<   Z_quoted_dict_itemr   r   r
   r   r   r   r   r@   r3   r3   r3   r4   r(   #  s   c               @   s   e Zd ZdZdZdZdgZddgZej	ej
B ejB ZdZdZdZeeejed	feeejed	feeeeefd
efdefdefdefgdeedfgdZdd ZdS )r)   zL
    Lexer for Singularity definition files.

    .. versionadded:: 2.6
    ZSingularityzAhttps://www.sylabs.io/guides/3.0/user-guide/definition_files.htmlZsingularityz*.defzS^(\s*)(bootstrap|from|osversion|mirrorurl|include|registry|namespace|includecmd)(:)zT^(%(?:pre|post|setup|environment|help|labels|test|runscript|files|startscript))(\s*)z6^(%app(?:install|help|run|labels|env|test|files))(\s*)scriptz	\s*#.*?\nz"\b(([0-9]+\.?[0-9]*)|(\.[0-9]+))\bz[ \t]+z
(?!^\s*%).z(.+?(?=^\s*%))|(.*)z#pop)r+   r   c             C   s>   d}t d| t jr|d7 }t tjdd | r:|d7 }|S )zlThis is a quite simple script file, but there are a few keywords
        which seem unique to this language.r   z&\b(?:osversion|includecmd|mirrorurl)\bg      ?r/   Ng\(\?)rp   searchrr   r)   _section)r2   resultr3   r3   r4   r5   ^  s    zSingularityLexer.analyse_textN)r6   r7   r8   r9   r:   rE   r;   r<   rp   rr   rq   DOTALLr_   Z_headersr   Z_appsectr   r   ZHeadingr   r   r	   r
   r   r   r   r@   r5   r3   r3   r3   r4   r)   >  s$   c               @   sL   e Zd ZdZdZddgZg Zddefdefde	fd	e
fd
efdefgiZdS )r*   z
    Lexer for Unix/Linux config files using colon-separated values, e.g.

    * ``/etc/group``
    * ``/etc/passwd``
    * ``/etc/shadow``
    
    .. versionadded:: 2.12
    zUnix/Linux config filesZ
unixconfigZlinuxconfigr+   z^#.*z\nr   z[0-9]+z"((?!\n)[a-zA-Z0-9\_\-\s\(\),]){2,}z[^:\n]+N)r6   r7   r8   r9   r:   r;   r<   r
   r   r   r   r	   r   r@   r3   r3   r3   r4   r*   k  s   	)1r9   rp   Zpygments.lexerr   r   r   r   r   r   r   Zpygments.tokenr	   r
   r   r   r   r   r   r   r   r   r   r   Zpygments.lexers.shellr   Zpygments.lexers.datar   __all__r   r   r   rM   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r3   r3   r3   r4   <module>	   sD   $8
#+M>+ /$ .//::-4-