a
    Dff                     @   s  d Z ddlZddlmZ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 g 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!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Z0G d0d1 d1eZ1G d2d3 d3eZ2G d4d5 d5eZ3dS )6z
    pygments.lexers.configs
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for configuration file formats.

    :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)ExtendedRegexLexer
RegexLexerdefaultwordsbygroupsincludeusingline_re)TextCommentOperatorKeywordNameStringNumberPunctuation
WhitespaceLiteralErrorGeneric)	BashLexer)	JsonLexer)IniLexerSystemdLexerDesktopLexer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g dZg dZddgZdZdZ	d	e
fd
ejfdeee
fdeeje
ee
eee
dfdeeje
ee
efdejfgd	e
fdee
eee
fdedfgdZdd ZdS )r   z5
    Lexer for configuration files in INI style.
    ZINI)ZinicfgZdosini)z*.iniz*.cfgz*.infz.editorconfigz
text/x-iniztext/infz&https://en.wikipedia.org/wiki/INI_file \s+[;#].*z(\[.*?\])([ \t]*)$u0   (.*?)([  \t]*)([=:])([ \t]*)([^;#\n]*)(\\)(\s+)valueu8   (.*?)([ \t]*)([=:])([  \t]*)([^ ;#\n]*(?: +[^ ;#\n]+)*)z(.+?)$z(\s*)(.*)(\\)([ \t]*)z.*$#poprootr2   c                 C   s:   |  d}|dk rdS | d dkr6| |d  dkr6dS dS )	N
   Fr   [   ]g?)find)textZnpos r=   d/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/pygments/lexers/configs.pyanalyse_text@   s    
zIniLexer.analyse_textN)__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_addedr   r   Singler   r   r   	Attributer   r   r
   tokensr?   r=   r=   r=   r>   r      s:   r   c                   @   sx   e Zd ZdZdZdZdgZdgZdgZdZ	dd	e
fd
eeje
fdeee
fdeejeje
ee
ee
fgiZdd ZdS )r   z#
    Lexer for .desktop files.
    zDesktop filezXhttps://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.htmlZdesktopz	*.desktopzapplication/x-desktop2.16r5   	^[ \t]*\nz
^(#.*)(\n)(\[[^\]\n]+\])(\n)zG([-A-Za-z0-9]+)(\[[^\] \t=]+\])?([ \t]*)(=)([ \t]*)([^\n]*)([ \t\n]*\n)c                 C   s2   |  drdS td| d d tjd ur.dS dS )Nz[Desktop Entry]      ?z^\[Desktop Entry\][ \t]*$  ?        
startswithresearch	MULTILINEr<   r=   r=   r>   r?   _   s
    
zDesktopLexer.analyse_textN)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r   r   r   rJ   r   r   rK   	Namespacer   r   rL   r?   r=   r=   r=   r>   r   I   s"   
r   c                   @   s   e Zd ZdZdZdZdgZg dZdZde	fde
eje	fd	e
ee	fd
e
eje	ee	eee	dfde
eje	ee	ee	fgde
eje	fde
e	eee	fde
e	ee	dfgdZdd ZdS )r   z'
    Lexer for systemd unit files.
    ZSystemdzDhttps://www.freedesktop.org/software/systemd/man/systemd.syntax.htmlZsystemd)z	*.servicez*.socketz*.devicez*.mountz*.automountz*.swapz*.targetz*.pathz*.timerz*.slicez*.scoperM   rN   z^([;#].*)(\n)rO   z*([^=]+)([ \t]*)(=)([ \t]*)([^\n]*)(\\)(\n)r2   z&([^=]+)([ \t]*)(=)([ \t]*)([^\n]*)(\n)z([ \t]*)([^\n]*)(\\)(\n)z([ \t]*)([^\n]*)(\n)r3   r4   c                 C   s2   |  drdS td| d d tjd ur.dS dS )Nz[Unit]rP   z^\[Unit\][ \t]*$rQ   rR   rS   rT   rY   r=   r=   r>   r?      s
    
zSystemdLexer.analyse_textN)r@   rA   rB   rC   rD   rH   rE   rF   rI   r   r   r   rJ   r   r   rK   r   r   r
   rL   r?   r=   r=   r=   r>   r   g   s:   r   c                   @   s   e Zd ZdZdZdZdgZdgZdgZd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   z?
    Lexer for Windows Registry files produced by regedit.
    regz8http://en.wikipedia.org/wiki/Windows_Registry#.REG_filesregistryz*.regztext/x-windows-registry1.6zWindows Registry Editor.*r0   r1   z(\[)(-?)(HKEY_[A-Z_]+)(.*?\])$z)("(?:\\"|\\\\|[^"])+")([ \t]*)(=)([ \t]*)r2   z(.*?)([ \t]*)(=)([ \t]*)-r3   z1(dword|hex(?:\([0-9a-fA-F]\))?)(:)([0-9a-fA-F,]+).+r4   c                 C   s
   |  dS )NzWindows Registry Editor)rU   rY   r=   r=   r>   r?      s    zRegeditLexer.analyse_textN)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r
   r   r   rJ   r   r   r   r   BuiltinrK   Variabler   r   r   r   rL   r?   r=   r=   r=   r>   r      s>   r   c                   @   s   e Zd ZdZdZddgZdgZdgZdZdZ	d	e
jfd
efdefedgdejfeddeeeedfdedfd
edfgdefedd
edfgdeejefdejfgd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
    Z
PropertiesZ
propertiesZjpropertiesz*.propertiesztext/x-java-propertiesz)https://en.wikipedia.org/wiki/.propertiesz1.4z[!#].*|/{2}.*\nz	^[^\S\n]+keyz
[^\\:=\s]+escapesz([^\S\n]*)([:=])([^\S\n]*))r3   r2   [^\S\n]+r3   z[^\\\n]+z(\\\n)([^\S\n]*)z\\(.|\n))r5   rc   r2   rd   N)r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r   rJ   r   r   r   rK   r   r   r   r   EscaperL   r=   r=   r=   r>   r      s:   

r   c                 C   sP   d}|dkrd}nd|d  }| dkr,d}nd|  d}d	| d
| d| dS )N      +z{1,%d}r9   r/   {}z(?:\t| z\t| {z})z.*\nr=   )levelZ	tab_widthZspace_repeatZlevel_repeatr=   r=   r>   
_rx_indent   s    rm   c                   @   s  e Zd ZdZdZg dZdZg dZdgZd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   z(
    For Linux-style Kconfig files.
    ZKconfig)Zkconfig
menuconfigzlinux-configzkernel-configr]   )zKconfig*z*Config.in*zexternal.in*zstandard-modules.inztext/x-kconfigzChttps://www.kernel.org/doc/html/latest/kbuild/kconfig-language.htmlr   c                 C   s   t | tjd|  fS )Nindent)rm   r   Docrl   r=   r=   r>   call_indent  s    zKconfigLexer.call_indentc                 C   s   t | tjfdtftdgS )N\s*\n#pop:2)rm   r   rp   r
   r   rq   r=   r=   r>   	do_indent  s    zKconfigLexer.do_indentr0   #.*?\n)Zmainmenuconfigrn   choiceZ	endchoicecommentmenuZendmenuz
visible ififendifsourcepromptselectz
depends onr   rangeoption\bsuffixz(---help---|help)[\t ]*\nhelpz;(bool|tristate|string|hex|int|defconfig_list|modules|env)\bz[!=&|]z[()][0-9]+z'(''|[^'])*'z"(""|[^"])*"\S+rs               r7   rh   r9   r3   )	r5   r   Zindent7Zindent6Zindent5Zindent4Zindent3Zindent2Zindent1N)r@   rA   rB   rC   rD   rE   rI   rF   rG   rH   flagsrr   ru   r   r   rJ   r   r   r   r`   r   r   r   Integerr   Doubler
   r   rL   r=   r=   r=   r>   r   	  s\   r   c                   @   sv  e Zd ZdZdZdZddgZdgZg Zd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   z+
    Lexer for CFEngine3 policy files.
    Z	CFEngine3zhttp://cfengine.orgZ	cfengine3Zcf3z*.cfz1.5rv   z(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+\d+\w+r0   z\$[{(]interpol\\.r3   rb   .#pushz[})]z	[^${()}]+z\),)r5   r   r   r   N)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r   r   r   r   r   Functionr   ra   Typer   Reservedr
   r   ClassDeclarationr   Floatr   Interpolrf   rL   r=   r=   r=   r>   r   W  sn   



r   c                   @   s   e Zd ZdZdZg dZg dZdgZdZd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   zT
    Lexer for configuration files following the Apache config file
    format.
    Z
ApacheConf)Z
apacheconfZaconfZapache)z	.htaccesszapache.confzapache2.confztext/x-apacheconfz6https://httpd.apache.org/docs/current/configuring.htmlz0.6r0   z#(.*\\\n)+.*$|(#.*?)$z"(<[^\s>/][^\s>]*)(?:(\s+)(.*))?(>)z(</[^\s>]+)(>)z[a-z]\w*r2   z\.+z\\\nz\n+r3   z\\re   \d+\.\d+\.\d+\.\d+(?:/\d+)?r   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"\\]+r4   N)r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rV   rX   
IGNORECASEr   r   r   r   r   Tagr   r`   r
   r   ZOtherr   r   rL   r=   r=   r=   r>   r     sB   
r   c                   @   sB  e Zd ZdZdZdZg dZdgZdgZdZ	e
jZdZd	Zd
ZdZdZdZdZde de dZdZde de dZde de dZe de 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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    z.
    Lexer for squid configuration files.
    Z	SquidConfzhttp://www.squid-cache.org/)Z	squidconf
squid.confZsquidr   ztext/x-squidconfz0.9)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_netmask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_directno_cacheZpassthrough_proxyZpconn_timeoutZpid_filenameZpinger_programZpositive_dns_ttlZprefer_direct
proxy_authZproxy_auth_realmZ
query_icmpZquick_abortZquick_abort_maxZquick_abort_minZquick_abort_pctZrange_offset_limitread_timeoutZredirect_childrenZredirect_programZredirect_rewrites_host_headerZreference_ageZrefresh_patternZreload_into_imsZrequest_body_max_sizeZrequest_size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-responderonoffallZdenyZallowZviaparentz	no-digestheapZlrurealmchildrenZq1Zq2ZcredentialsttlnonedisableZoffline_toggleZdiskd)shutdowninfoZ	parameterZserver_listZclient_listr   )ZobjectsZ
vm_objectsZutilizationZipcacheZ	fqdncacheZdnsZ
redirectorioZreply_headersZfiledescriptorsZnetdb)statusenabler   clear)Z	url_regexZurlpath_regexZreferer_regexportprotoZreq_mime_typeZrep_mime_typemethodZbrowserusersrcdsttimeZ	dstdomainidentZsnmp_communityz(\d+|0x[0-9a-f]+)(z(\.z){3})z([0-9a-f]{0,4})z(:z){1,7})|)z(/(z|\d+))?r0   #ry   r   prefixr   zstats/zlog/=z(?:\b\d+\b(?:-\b\d+|%)?)r   z	\s*TAG:.*r3   r_   )r5   ry   N)&r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   rV   r   r   keywordsoptsactionsZactions_statsZactions_logZaclsZ
ipv4_groupZipv4Z
ipv6_groupZipv6Zbare_ipipr   r   r   r   r   Constantr   r   r   r
   rf   r   rL   r=   r=   r=   r>   r      sJ   ;
r    c                   @   s   e Zd ZdZdZdZdgZdgZdgZd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!   z.
    Lexer for Nginx configuration files.
    zNginx configuration filezhttp://nginx.net/Znginxz
nginx.confztext/x-nginx-conf0.11z(include)(\s+)([^\s;]+)z[^\s;#]+stmtbase\}rt   \{block;r3   #.*\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;#]*r0   z[$;])r5   r   r   r   N)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r   r   r   r   r   r   rZ   r   rJ   r   ra   r   r   r   Regexr
   rL   r=   r=   r=   r>   r!   @  sF   
r!   c                   @   sz   e Zd ZdZdZdZddgZdgZdgZd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"   z1
    Lexer for Lighttpd configuration files.
    zLighttpd configuration filezhttp://lighttpd.net/ZlighttpdZlightyzlighttpd.confztext/x-lighttpd-confr   r5   r   z/\S*z[a-zA-Z._-]+r   r   z=>|=~|\+=|==|=|\+z\$[A-Z]+z[(){}\[\],]z"([^"\\]*(?:\\.[^"\\]*)*)"r0   N)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r   rJ   r   r   r   r   r`   r   r   r   r   rL   r=   r=   r=   r>   r"   n  s(   r"   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dZejejB Zddefdeeeeeeeefde deeeeefde de deeeeefde deeeeeeefde de deeeeefde
 deeeefde deeefdeefg	iZdS )r#   z/
    Lexer for Docker configuration files.
    ZDockerzhttp://docker.ioZdockerZ
dockerfileZ
Dockerfilez*.dockerztext/x-dockerfile-configz2.0z-(?:MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)z-(?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY)z(?:\s*\\?\s*)r5   #.*z1(FROM)([ \t]*)(\S*)([ \t]*)(?:(AS)([ \t]*)(\S*))?z(ONBUILD)(\s+)(r   z(HEALTHCHECK)(\s+)((z	--\w+=\w+z)*)z#(VOLUME|ENTRYPOINT|CMD|SHELL)(\s+)(z
)(\[.*?\])z(LABEL|ENV|ARG)(\s+)((z\w+=\w+r   z|VOLUME)\b(\s+)(.*)z)(\s+)z(.*\\\n)*.+N)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   Z	_keywordsZ_bash_keywordsZ_lbrV   r   rX   r   r   r   r   r   r   r   r   r   rL   r=   r=   r=   r>   r#     s>   

r#   c                   @   s  e Zd ZdZdZdZg dZddgZddgZd	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 j0e(e j1e(e+fd+efg
d,ee j1fd-ee j1fgd.e+fgd/e%j&fd0e%j&d1fd2e%j&d3fd4e%j&fgd5e(fd6e(fd7ee2e(fgd8Z3d9S ):r$   z-
    Lexer for terraformi ``.tf`` files.
    Z	Terraformzhttps://www.terraform.io/)Z	terraformtfZhclz*.tfz*.hclzapplication/x-tfzapplication/x-terraform2.1)backenddatamoduleoutputproviderZprovisionerresourcevariablez({})r   )	r   numberboollisttuplemapsetobjectnull)	absceilfloorlogmaxZmixZparseintpowsignum)ZchompformatZ
formatlistro   joinlowerregexZregexallreplacesplitZstrrevsubstrtitleZtrimZ
trimprefixZ
trimsuffixZ	trimspaceupper)ZalltrueZanytrueZ	chunklistZcoalesceZcoalescelistcompactconcatcontainsZdistinctelementflattenindexkeyslengthr   lookupr   Z	matchkeysmerger   reverseZsetintersectionZ
setproductZsetsubtractZsetunionslicesortsumZ	transposevaluesZzipmap)Zbase64decodeZbase64encodeZ
base64gzipZ	csvdecodeZ
jsondecodeZ
jsonencodeZtextdecodebase64Ztextencodebase64	urlencodeZ
yamldecodeZ
yamlencode)	abspathdirnameZ
pathexpandbasenamefileZ
fileexistsZfilesetZ
filebase64Ztemplatefile)
formatdateZtimeadd	timestamp)Zbase64sha256Zbase64sha512ZbcryptZfilebase64sha256Zfilebase64sha512Zfilemd5Zfilesha1Z
filesha256Z
filesha512md5Z
rsadecryptsha1sha256sha512uuidZuuidv5)ZcidrhostZcidrnetmaskZ
cidrsubnetZcidrsubnets)	ZcandefaultsZtobooltolistZtomapZtonumberZtosettostringtryc           	      c   s@  | d}|t|dfV  | dtj|dfV  | d|_|d|_|jtj|dfV  | |_|d}d}g }t	|j
|jD ]~}|r|  }n|  }||kr|D ]}|  tj| fV  q|  tj| fV  | |_ q0q|| q|D ]}|  t| fV  qt|j
|_d S )Nr9   rh   r7   T)startr   groupr   Z	DelimiterposendZHeredocr	   finditerr<   striprstripappendr   len)	selfmatchctxr  ZhdnameZtolerantlinescheckZamatchr=   r=   r>   heredoc_callback  s0    




zTerraformLexer.heredoc_callbackbasic
whitespacez(".*"))truefalser   r   
identifierpunctuationr   z\s*/\*ry   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/\*r   z\*/r3   z[*/]rb   r0   (\\)(\n))r5   r&  r*  r+  ry   r'  N)4r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   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   r   r   r   r   r   r   r   r   	MultilinerJ   r   r`   r   r   rK   r   r   r   r   ra   r
   rL   r=   r=   r=   r>   r$     s   	'
"

r$   c                	   @   s   e Zd ZdZdZdgZddgZg ZdZd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%   zR
    Lexer for termcap database source.

    This is very simple and minimal.
    ZTermcapZtermcapztermcap.srcz%https://en.wikipedia.org/wiki/Termcapr   ^#.*z
^[^\s#:|]+namesr0   rb   r3   :defs\|z[^:|]+z(\\)(\n[ \t]*)z\n[ \t]*rt   (#)([0-9]+)r   r   z	[^\s:=#]+z\\072z[^:\\]+r   r5   r2  r4  r   N)r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r   r   r   r   r   rK   r   r
   r   r   r   r   rL   r=   r=   r=   r>   r%   V  s:   	
	r%   c                
   @   s   e Zd ZdZdZdgZddgZg ZdZd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&   zS
    Lexer for terminfo database source.

    This is very simple and minimal.
    ZTerminfoZterminfozterminfo.srcz&https://en.wikipedia.org/wiki/Terminfor   z^#.*$z
^[^\s#,|]+r2  r0   rb   r3   z(,)([ \t]*)r4  r5  z[^,|]+z\n[ \t]+rt   r6  r   r   z	[^\s,=#]+z\\[,\\]z[^\\,]+r   r7  N)r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   r   r   r   r   r   r   rK   r   r   r   r   rL   r=   r=   r=   r>   r&     s:   	
	r&   c                
   @   s   e Zd ZdZdZdZdgZdgZg Zd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'   ze
    Lexer for pkg-config
    (see also `manual page <http://linux.die.net/man/1/pkg-config>`_).
    Z	PkgConfigz4http://www.freedesktop.org/wiki/Software/pkg-config/Z	pkgconfigz*.pcr   #.*$z	^(\w+)(=)z^([\w.]+)(:)spvalueinterpr0   z[^${}#=:\n.]+r   z\$\$z\$\{curlyr   r3   r   rb   z[^${}#\n\s]+)r5   r:  r;  r9  N)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r   rJ   r   r   rK   r   r   r   r   r   r
   r   r   rL   r=   r=   r=   r>   r'     s>   


r'   c                	   @   s   e Zd ZdZdZdZdgZdgZg Zd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.
    Z
PacmanConfz3https://www.archlinux.org/pacman/pacman.conf.5.htmlZ
pacmanconfzpacman.confr   r5   r8  z^(\s*)(\[.*?\])(\s*)$z(\w+)(\s*)(=)z^(\s*)(\w+)(\s*)$)z$repoz$archz%oz%ur   r   r0   r   N)r@   rA   rB   rC   rD   rH   rE   rF   rG   rI   r   rJ   r   r   r   r   rK   r   r   ra   r
   rL   r=   r=   r=   r>   r(     s2   	r(   c                   @   s   e Zd ZdZdZdZdgZdgZd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)   z
    Lexer for Augeas.
    ZAugeaszhttp://augeas.netZaugeasz*.aug2.4z(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\(\*ry   z[*+\-.;=?|]z
[()\[\]{}]r   r   z\/r   z([A-Z]\w*)(\.)(\w+)r   r0   r   z[^"]r3   z[^/]z[^*)]r   z\*\)z[)*])r5   r   r   ry   N)r@   rA   rB   rC   rD   rH   rE   rF   rI   r   r   rZ   r   r   r   ra   r`   r   r   r   r0  r   r   r   r   rf   rL   r=   r=   r=   r>   r)   &  sB   






r)   c                   @   s4  e Zd ZdZdZdgZg dZdgZdZdZ	dZ
d	e
 d
Zdefdejfeddeeedfdedfgdefdejdfdejdfdefgdefdejdfdejdfdefdedfdefgeejdfe
ejdfdejdfdejdfdejdfdejdfdejdfd ejdfd!ejdfd"ejd#fdejd$fd%ejd&fdejd'fd(ejdfd)ed*fd+ed,fgdefdejfd-efd.edfe dgdefeddeeedfd-efd/edfgdejdfed0d1ejfgd2ejdfgd"ejdfd3eej!efed0d1ejfdejfgd%ejdfd4ejfdejfgd5ej!fd6ej!fgd7Z"d8S )9r*   z=
    Lexer for TOML, a simple language for config files.
    ZTOMLtoml)z*.tomlZPipfilezpoetry.lockzapplication/tomlzhttps://toml.ior<  z\d\d:\d\d:\d\d(\.\d+)?zm(?x)
                  \d\d\d\d-\d\d-\d\d # date, e.g., 1988-10-27
                (
                  [Tt ] z # optional time
                  (
                    [Zz]|[+-]\d\d:\d\d # optional time offset
                  )?
                )?
              r0   r   rc   z(=)(\s*)r2   z\[\[?	table-keyz[A-Za-z0-9_-]+r   basic-string'literal-stringz\.z\]\]?r3   [ \t]+z [+-]?\d[0-9_]*[eE][+-]?\d[0-9_]*z.[+-]?\d[0-9_]*\.\d[0-9_]*([eE][+-]?\d[0-9_]*)?z[+-]?(inf|nan)z
-?0b[01_]+z-?0o[0-7_]+z-?0x[0-9a-fA-F_]+z[+-]?[0-9_]+z""")r3   multiline-basic-string)r3   r?  z''')r3   multiline-literal-string)r3   rA  z
true|false\[)r3   arrayr   )r3   inline-tabler   \]r   rd   z[^"\\]+z.*?'r,  z[^']+z#\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}r   )r5   rc   r>  r2   rF  rG  r?  rA  rC  rD  rd   N)#r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   _time	_datetimer   r   rJ   r   r   r   r   r   r   r   r   r   Dater   r   ZBinOctZHexr   r   r   rf   rL   r=   r=   r=   r>   r*   R  s   
















&



 r*   c                   @   sr  e Zd ZdZdZdZddgZdgZdZde	e
efd	e	e
ed
fde	e
edfde	e
efde	e
ee
ee
fde	e
efde	e
ee
ee
fde	e
efde	e
ee
eje
fde	e
ejefde	e
ejee
ee
fgeddefeddefdedfdedfgeddejfdedfdedfdedfgeddefeddedfded fgedd!ed
fd"edfgd#e
fgd$Zd%S )&r+   z
    Lexer for *NextedText*, a human-friendly data format.

    .. versionchanged:: 2.16
        Added support for *NextedText* v3.0.
    Z
NestedTextzhttps://nestedtext.orgZ
nestedtextntz*.ntz2.9z^([ ]*)(#.*)$z^([ ]*)(\{)inline_dictz^([ ]*)(\[)inline_listz^([ ]*)(>)$z^([ ]*)(>)( )(.*?)([ \t]*)$z^([ ]*)(-)$z^([ ]*)(-)( )(.*?)([ \t]*)$z^([ ]*)(:)$z^([ ]*)(:)( )([^\n]*?)([ \t]*)$z^([ ]*)([^\{\[\s].*?)(:)$z)^([ ]*)([^\{\[\s].*?)(:)( )(.*?)([ \t]*)$r'  z[^\{\}\[\],\s]+inline_valuer   rH  r3   rb   z[^\{\}\[\],:\s]+r3  inline_dict_valuer   rt   r   rE  rB  )r5   rO  rN  rQ  rP  r'  N)r@   rA   rB   rC   rD   rH   rE   rF   rI   r   r   r   r   r
   r   r   r   r   rL   r=   r=   r=   r>   r+     sX   #	r+   c                   @   s   e Zd ZdZdZdZdgZddgZd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,   z1
    Lexer for Singularity definition files.
    ZSingularityzAhttps://www.sylabs.io/guides/3.0/user-guide/definition_files.htmlZsingularityz*.defz2.6zS^(\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]+))\brB  z
(?!^\s*%).z(.+?(?=^\s*%))|(.*)r3   )r5   rR  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      ?r9   Ng\(\?)rV   rW   r   r,   _section)r<   resultr=   r=   r>   r?   k  s    zSingularityLexer.analyse_textN)r@   rA   rB   rC   rD   rH   rE   rF   rI   rV   r   rX   DOTALLr   _headersrS  Z_appsectr   r   ZHeadingr   r   r
   r   r   r   r   rL   r?   r=   r=   r=   r>   r,   L  s,   
r,   c                   @   sT   e Zd ZdZdZddgZg ZdZd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``
    zUnix/Linux config filesZ
unixconfigZlinuxconfigzUhttps://en.wikipedia.org/wiki/Configuration_file#Unix_and_Unix-like_operating_systemsz2.12r5   r1  rb   r3  r   z"((?!\n)[a-zA-Z0-9\_\-\s\(\),]){2,}z[^:\n]+N)r@   rA   rB   rC   rD   rE   rF   rH   rI   r   r   r   r   r
   r   rL   r=   r=   r=   r>   r-   x  s   r-   )4rC   rV   Zpygments.lexerr   r   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   r   r   rm   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r=   r=   r=   r>   <module>   s@   
(8-,*8N=+ .# *//99, )R,