o
    xijn                     @   sl  d Z ddlZddl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 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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&dS )'z
    pygments.lexers.configs
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for configuration file formats.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerdefaultwordsbygroupsincludeusing)
TextCommentOperatorKeywordNameStringNumberPunctuation
WhitespaceLiteral)	BashLexer)IniLexerRegeditLexerPropertiesLexerKconfigLexerCfengine3LexerApacheConfLexerSquidConfLexerNginxConfLexerLighttpdConfLexerDockerLexerTerraformLexerTermcapLexerTerminfoLexerPkgConfigLexerPacmanConfLexerc                   @   sl   e Zd ZdZdZg dZg d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.
    INI)inicfgdosini)z*.iniz*.cfgz*.infz
text/x-iniztext/infroot\s+[;#].*z\[.*?\]$z*(.*?)([ \t]*)(=)([ \t]*)(.*(?:\n[ \t].+)*)z(.+?)$c                 C   s2   |  d}|dk rdS | d dko| |d  dkS )N
   Fr   [   ])find)textnpos r1   X/home/ubuntu/.local/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/configs.pyanalyse_text0   s   
zIniLexer.analyse_textN)__name__
__module____qualname____doc__namealiases	filenames	mimetypesr   r	   Singler   r   r   	Attributer
   r   tokensr3   r1   r1   r1   r2   r      s"    r   c                   @   s   e 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   z
    Lexer for `Windows Registry
    <http://en.wikipedia.org/wiki/Windows_Registry#.REG_files>`_ files produced
    by regedit.

    .. versionadded:: 1.6
    regregistryz*.regztext/x-windows-registryzWindows Registry Editor.*r'   r(   z(\[)(-?)(HKEY_[A-Z_]+)(.*?\])$z)("(?:\\"|\\\\|[^"])+")([ \t]*)(=)([ \t]*)valuez(.*?)([ \t]*)(=)([ \t]*)-#popz1(dword|hex(?:\([0-9a-fA-F]\))?)(:)([0-9a-fA-F,]+).+r&   rA   c                 C   s
   |  dS )NzWindows Registry Editor)
startswith)r/   r1   r1   r2   r3   _   s   
zRegeditLexer.analyse_textN)r4   r5   r6   r7   r8   r9   r:   r;   r   r	   r<   r   r   r
   r   Builtinr=   Variabler   r   r   r   r>   r3   r1   r1   r1   r2   r   7   s<    r   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
    
Properties
propertiesjpropertiesz*.propertiesztext/x-java-propertiesr&   z^(\w+)([ \t])(\w+\s*)$z^\w+(\\[ \t]\w*)*$z(^ *)([#!].*)z(^ *)((?:;|//).*)z/(.*?)([ \t]*)([=:])([ \t]*)(.*(?:(?<=\\)\n.*)*)z\sN)r4   r5   r6   r7   r8   r9   r:   r;   r   r   r=   r   r   r	   r
   r>   r1   r1   r1   r2   r   c   s"    r   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.*\nr1   )level	tab_widthspace_repeatlevel_repeatr1   r1   r2   
_rx_indent   s   rT   c                   @   s   e Zd ZdZdZg dZg d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
    Kconfig)kconfig
menuconfigzlinux-configzkernel-config)rU   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)rT   r   DocrP   r1   r1   r2   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)rT   r   rX   r   r   rY   r1   r1   r2   	do_indent   s   zKconfigLexer.do_indentr'   #.*?\n)mainmenuconfigrW   choice	endchoicecommentmenu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+r[               r*   rM   r,   rC   )	r&   rp   indent7indent6indent5indent4indent3indent2indent1N)r4   r5   r6   r7   r8   r9   r:   r;   flagsrZ   r]   r   r	   r<   r   r   r   rG   r
   r   r   Integerr   Doubler   r>   r1   r1   r1   r2   r      sZ    
r   c                   @   sn  e 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   z_
    Lexer for `CFEngine3 <http://cfengine.org>`_ policy files.

    .. versionadded:: 1.5
    	CFEngine3	cfengine3cf3z*.cfr^   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+r'   z\$[{(]interpolz\\.rC   \n.#pushz[})]z	[^${()}]+z\),)r&   r   r   r   N)r4   r5   r6   r7   r8   r9   r:   r;   r	   r   r   r   r   Functionr   rH   Typer
   Reservedr   ClassDeclarationr   Floatr   InterpolEscaper>   r1   r1   r1   r2   r      sl    




r   c                   @   s   e Zd ZdZdZg dZg d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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
    
ApacheConf)
apacheconfaconfapache)z	.htaccesszapache.confzapache2.confztext/x-apacheconfr'   z(#.*?)$z(<[^\s>]+)(?:(\s+)(.*?))?(>)z([a-z]\w*)(\s+)rA   z\.+\\\n$rC   z\\z[^\S\n]+\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)\b"([^"\\]*(?:\\.[^"\\]*)*)"z	[^\s"\\]+rE   N)r4   r5   r6   r7   r8   r9   r:   r;   re	MULTILINE
IGNORECASEr~   r   r	   r   r   Tagr   rG   r   Otherr   r   r>   r1   r1   r1   r2   r     s>    

r   c                   @   s   e Zd ZdZdZg d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   zj
    Lexer for `squid <http://www.squid-cache.org/>`_ configuration files.

    .. versionadded:: 0.9
    	SquidConf)	squidconf
squid.confsquidr   ztext/x-squidconf)
access_logaclalways_directannounce_hostannounce_periodannounce_portannounce_toanonymize_headersappend_domainas_whois_serverauth_param_basicauthenticate_childrenauthenticate_programauthenticate_ttlbroken_postsbuffered_logscache_access_logcache_announce	cache_dircache_dns_programcache_effective_groupcache_effective_user
cache_hostcache_host_aclcache_host_domain	cache_log	cache_memcache_mem_highcache_mem_low	cache_mgrcachemgr_passwd
cache_peercache_peer_accesscahce_replacement_policycache_stoplistcache_stoplist_patterncache_store_log
cache_swapcache_swap_highcache_swap_logcache_swap_low	client_dbclient_lifetimeclient_netmaskconnect_timeoutcoredump_dirdead_peer_timeoutdebug_optionsdelay_accessdelay_classdelay_initial_bucket_leveldelay_parametersdelay_pools	deny_infodns_childrendns_defnamesdns_nameserversdns_testnamesemulate_httpd_logerr_html_textfake_user_agentfirewall_ipforwarded_forforward_snmpd_portfqdncache_sizeftpget_optionsftpget_programftp_list_widthftp_passiveftp_userhalf_closed_clientsheader_accessheader_replacehierarchy_stoplisthigh_response_time_warninghigh_page_fault_warning
hosts_file	htcp_porthttp_accesshttp_anonymizerhttpd_accelhttpd_accel_hosthttpd_accel_porthttpd_accel_uses_host_headerhttpd_accel_with_proxy	http_porthttp_reply_access
icp_accessicp_hit_staleicp_porticp_query_timeoutident_lookupident_lookup_accessident_timeoutincoming_http_averageincoming_icp_averageinside_firewallipcache_highipcache_lowipcache_sizelocal_domainlocal_iplogfile_rotatelog_fqdnlog_icp_querieslog_mime_hdrsmaximum_object_sizemaximum_single_addr_triesmcast_groupsmcast_icp_query_timeoutmcast_miss_addrmcast_miss_encode_keymcast_miss_portmemory_poolsmemory_pools_limitmemory_replacement_policy
mime_tablemin_http_poll_cntmin_icp_poll_cntminimum_direct_hopsminimum_object_sizeminimum_retry_timeoutmiss_accessnegative_dns_ttlnegative_ttlneighbor_timeoutneighbor_type_domain
netdb_high	netdb_lownetdb_ping_periodnetdb_ping_ratenever_directno_cachepassthrough_proxypconn_timeoutpid_filenamepinger_programpositive_dns_ttlprefer_direct
proxy_authproxy_auth_realm
query_icmpquick_abortquick_abort_maxquick_abort_minquick_abort_pctrange_offset_limitread_timeoutredirect_childrenredirect_programredirect_rewrites_host_headerreference_agerefresh_patternreload_into_imsrequest_body_max_sizerequest_sizerequest_timeoutshutdown_lifetimesingle_parent_bypasssiteselect_timeoutsnmp_accesssnmp_incoming_address	snmp_portsource_ping	ssl_proxystore_avg_object_sizestore_objects_per_bucketstrip_query_termsswap_level1_dirsswap_level2_dirstcp_incoming_addresstcp_outgoing_addresstcp_recv_bufsizetest_reachabilityudp_hit_objudp_hit_obj_sizeudp_incoming_addressudp_outgoing_addressunique_hostnameunlinkd_programuri_whitespaceuseragent_logvisible_hostname
wais_relaywais_relay_hostwais_relay_port)z
proxy-onlyweightttlzno-queryr   zround-robinzmulticast-responderonoffalldenyallowviaparentz	no-digestheaplrurealmchildrenq1q2credentialsttlnonedisableoffline_togglediskd)shutdowninfo	parameterserver_listclient_listr   )objects
vm_objectsutilizationipcache	fqdncachedns
redirectorioreply_headersfiledescriptorsnetdb)statusenablerr  clear)	url_regexurlpath_regexreferer_regexportprotoreq_mime_typerep_mime_typemethodbrowserusersrcdsttime	dstdomainident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}))r'   #rc   rm   prefixro   zstats/zlog/=z(?:/(?:z|\b\d+\b))?z(?:\b\d+\b(?:-\b\d+|%)?)rr   z	\s*TAG:.*rC   rD   )r&   rc   N)r4   r5   r6   r7   r8   r9   r:   r;   r   r   r~   keywordsoptsactionsactions_statsactions_logaclsip_rer   r	   r   r   r   Constantr   r   r   r   r   r   r>   r1   r1   r1   r2   r   G  s@    ;

r   c                   @   s   e 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   za
    Lexer for `Nginx <http://nginx.net/>`_ configuration files.

    .. versionadded:: 0.11
    zNginx configuration filenginxz
nginx.confztext/x-nginx-confz(include)(\s+)([^\s;]+)z[^\s;#]+stmtbase\}r\   \{block;rC   #.*\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;#]*r'   z[$;])r&   r  r  r  N)r4   r5   r6   r7   r8   r9   r:   r;   r   r   r   r   r   r   	Namespacer	   r<   r  rH   r   r   r   Regexr>   r1   r1   r1   r2   r     sD    

r   c                   @   sp   e Zd ZdZdZddgZ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   zg
    Lexer for `Lighttpd <http://lighttpd.net/>`_ configuration files.

    .. versionadded:: 0.11
    zLighttpd configuration filelightylighttpdztext/x-lighttpd-confr&   r  z/\S*z[a-zA-Z._-]+r   rq   z=>|=~|\+=|==|=|\+z\$[A-Z]+z[(){}\[\],]r   r'   N)r4   r5   r6   r7   r8   r9   r:   r;   r	   r<   r   r   r   r
   rG   r   r   r   r   r>   r1   r1   r1   r2   r     s&    r   c                   @   s   e Zd ZdZdZddgZddgZdgZdZe	j
e	jB Zd	d
ef eejeefdef eeefdefdefdeefgiZdS )r   z`
    Lexer for `Docker <http://docker.io>`_ configuration files.

    .. versionadded:: 2.0
    Dockerdocker
dockerfile
Dockerfilez*.dockerztext/x-dockerfile-configz@(?:FROM|MAINTAINER|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|WORKDIR)r&   z^(ONBUILD)(\s+)(%s)\bz^(%s)\b(.*)z#.*RUNz(.*\\\n)*.+N)r4   r5   r6   r7   r8   r9   r:   r;   	_keywordsr   r   r   r~   r   r   r   r   r   r	   r   r   r>   r1   r1   r1   r2   r     s$    
r   c                   @   st  e Zd ZdZdZddgZdgZddgZeded	ed
ededde	fge
ddddejfdejdfdejfdeejeefe
ddddejdfe
ddddejfdejdfgdeeeefed	ed
gdejdfe
ddddejfeded	defdejdfgd eejfgd!efgd"ejfdejfgd#ejfd$ejdfd%ejdfd&ejfgd'efdefd(efgd)	Zd*S )+r   zc
    Lexer for `terraformi .tf files <https://www.terraform.io/>`_.

    .. versionadded:: 2.1
    	Terraform	terraformtfz*.tfzapplication/x-tfzapplication/x-terraformr   punctuationcurlybasic
whitespacerq   )truefalserm   r  z\s*/\*rc   z\s*#.*\nz(.*?)(\s*)(=))variableresourceproviderprovisionermodulefunction)ingressegresslistenerr   
connection\$\{var_builtinz(\s+)(".*")(\s+)r   )concatfilejoinlookupelementr'   r  rC   z(".*")z
[\[\](),.]r  z[^*/]z/\*z\*/z[*/]r   r   )	r&   r  r  r  r   r  r  rc   r  N)r4   r5   r6   r7   r8   r9   r:   r;   r   r   r   r   r   r	   	Multiliner<   r   r   r=   r   r
   r   r   r   r   rG   r   r   r>   r1   r1   r1   r2   r   /  sz    	







r   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gded	fd
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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
    Termcaptermcapztermcap.src^#.*$z
^[^\s#:|]+namesr   rC   :defs\|z[^:|]+z
\\\n[ \t]*z\n[ \t]*r\   (#)([0-9]+)r  dataz	[^\s:=#]+z\\072z[^:\\]+r   r&   r  r  r  N)r4   r5   r6   r7   r8   r9   r:   r;   r	   r   r   r   r   r=   r   r
   r   r   r   r>   r1   r1   r1   r2   r   w  s6    	
	
r   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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
    Terminfoterminfozterminfo.srcr  z
^[^\s#,|]+r  r   rC   z(,)([ \t]*)r  r  z[^,|]+z\n[ \t]+r\   r  r  r  z	[^\s,=#]+z\\[,\\]z[^\\,]+r   r  N)r4   r5   r6   r7   r8   r9   r:   r;   r	   r   r   r   r   r   r=   r
   r   r   r   r>   r1   r1   r1   r2   r     s6    	
	
r   c                	   @   s   e 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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gdZdS )r    z
    Lexer for `pkg-config
    <http://www.freedesktop.org/wiki/Software/pkg-config/>`_
    (see also `manual page <http://linux.die.net/man/1/pkg-config>`_).

    .. versionadded:: 2.1
    	PkgConfig	pkgconfigz*.pc#.*$z	^(\w+)(=)z^([\w.]+)(:)spvalueinterpz[^${}#=:\n.]+r   z\$\$r  r  r  rC   r   r   z
[^${}#\n]+)r&   r  r  r  N)r4   r5   r6   r7   r8   r9   r:   r;   r	   r<   r   r   r=   r
   r   r   r   r   r   r   r>   r1   r1   r1   r2   r      s8    



r    c                	   @   sp   e Zd ZdZdZdgZdgZg Zddej	fd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giZdS )r!   a  
    Lexer for `pacman.conf
    <https://www.archlinux.org/pacman/pacman.conf.5.html>`_.

    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
    
PacmanConf
pacmanconfzpacman.confr&   r  z^\s*\[.*?\]\s*$z(\w+)(\s*)(=)z^(\s*)(\w+)(\s*)$)z$repoz$archz%oz%urm   rn   r   N)r4   r5   r6   r7   r8   r9   r:   r;   r	   r<   r   r   r   r=   r   r
   r   rH   r>   r1   r1   r1   r2   r!     s.    	r!   )'r7   r   pygments.lexerr   r   r   r   r   r   pygments.tokenr   r	   r
   r   r   r   r   r   r   r   pygments.lexers.shellr   __all__r   r   r   rT   r   r   r   r   r   r   r   r   r   r   r    r!   r1   r1   r1   r2   <module>   s.   
 0,M=* .H..8