B
    (d                 @   sp   d Z ddlm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 ddgZG dd deZG dd deZd	S )
z
    pygments.lexers.pawn
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for the Pawn languages.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    )
RegexLexer)TextCommentOperatorKeywordNameStringNumberPunctuation)get_bool_optSourcePawnLexer	PawnLexerc            N   @   s  e Zd ZdZdZdgZdgZdgZdZdZ	de
jd	fd
e
jdfde	 d e
jd	fde	 d e
jdfdefdefdefde
jfde
jfdefdedfdej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d ejfd!ejfd"efgd#ed$fd%ejfd&efdefd'efgd(e
jfd)e
jfd*e
jd$fd+e
jfd,e
jfde
jd$fgd-e
jd.fd/e
jd$fd0e
fgd1Zd2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdId2dJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~hNZdd Zdd Z dS )r   z]
    For SourcePawn source code with preprocessor directives.

    .. versionadded:: 1.6
    
SourcePawnspz*.spztext/x-sourcepawnz(?:\s|//.*?\n|/\*.*?\*/)+z\s*(?:/[*].*?[*]/\s*)*z^#if\s+0if0z^#macro^z#if\s+0#z\nz\s+z\\\nz/(\\\n)?/(\n|(.|\n)*?[^\\]\n)z/(\\\n)?\*(.|\n)*?\*(\\\n)?/z[{}]zL?"stringz4L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'z'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*z(\d+\.\d*|\.\d+|\d+[fF])[fF]?z0x[0-9a-fA-F]+[LlUu]*z0[0-7]+[LlUu]*z
\d+[LlUu]*z[~!%^&*+=|?:<>/-]z[()\[\],.;]zs(case|const|continue|native|default|else|enum|for|if|new|operator|public|return|sizeof|static|decl|struct|switch)\bz(bool|Float)\bz(true|false)\bz[a-zA-Z_]\w*"z#popz/\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})z	[^\\"\n]+z\\z[^/\n]+z/\*(.|\n)*?\*/z//.*?\n/z	(?<=\\)\nz^\s*#if.*?(?<!\\)\nz#pushz^\s*#endif.*?(?<!\\)\nz.*?\n)rootr   r   r   ActionboolFloatZPluginr   anyZ	AdminFlagZOverrideTypeZOverrideRuleZImmunityTypeZGroupIdZAdminIdZAdmAccessModeZAdminCachePartZCookieAccessZ
CookieMenuZCookieMenuActionZNetFlowZConVarBoundsZQueryCookieZReplySourceZConVarQueryResultZConVarQueryFinishedFunctionZIdentityZPluginStatusZ
PluginInfoZDBResultZ
DBBindTypeZ
DBPriorityZPropTypeZPropFieldTypeZMoveTypeZ
RenderModeZRenderFxZEventHookModeZ	EventHookFileTypeZFileTimeModeZPathTypeZ	ParamTypeZExecTypeZ
DialogTypeHandleZKvDataTypesZNominateResultZ	MapChangeZ	MenuStyleZ
MenuActionZ
MenuSourceZ
RegexErrorZSDKCallTypeZ
SDKLibraryZSDKFuncConfSourceZSDKTypeZSDKPassMethodZRayTypeZTraceEntityFilterZListenOverrideZ	SortOrderZSortTypeZ
SortFunc2DZAPLResZFeatureTypeZFeatureStatusZ	SMCResultZSMCErrorZTFClassTypeZTFTeamZTFCondZTFResourceTypeTimerZTopMenuActionZTopMenuObjectTypeZTopMenuPositionZTopMenuObjectZUserMsgc             K   sF   t |dd| _t | _| jr4ddlm} | j| tj| f| d S )NZ	sourcemodTr   )	FUNCTIONS)	r   smhighlightingset
_functionsZ#pygments.lexers._sourcemod_builtinsr    updater   __init__)selfoptionsr     r(   a/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/pygments/lexers/pawn.pyr%   k   s    
zSourcePawnLexer.__init__c             c   s\   xVt | |D ]F\}}}|tkrH| jrH|| jkr8tj}n|| jkrHtj}|||fV  qW d S )N)	r   get_tokens_unprocessedr   r!   SM_TYPESr   Typer#   Builtin)r&   textindextokenvaluer(   r(   r)   r*   u   s    

z&SourcePawnLexer.get_tokens_unprocessedN)!__name__
__module____qualname____doc__namealiases	filenames	mimetypes_ws_ws1r   Preprocr   Single	Multiliner
   r   Charr	   r   HexOctIntegerr   r   r,   Constantr   Escapetokensr+   r%   r*   r(   r(   r(   r)   r      s   









c               @   sx  e Zd ZdZdZdgZdddgZdgZdZd	Z	d
e
jdfde
jdfde	 d e
jdfde	 d e
jdfdefdefdefde
jfde
jfdefdedfdej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d"ejfd#ejfd$efgd%ed&fd'ejfd(efdefd)efgd*e
jfd+e
jfd,e
jd&fd-e
jfd.e
jfde
jd&fgd/e
jd0fd1e
jd&fd2e
fgd3Zd4d5 Zd6S )7r   z:
    For Pawn source code.

    .. versionadded:: 2.0
    Pawnpawnz*.pz*.pwnz*.incztext/x-pawnz (?:\s|//.*?\n|/[*][\w\W]*?[*]/)+z\s*(?:/[*].*?[*]/\s*)*z^#if\s+0r   z^#r   r   z#if\s+0r   z\nz\s+z\\\nz/(\\\n)?/(\n|(.|\n)*?[^\\]\n)z/(\\\n)?\*[\w\W]*?\*(\\\n)?/z[{}]zL?"r   z4L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'z'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*z(\d+\.\d*|\.\d+|\d+[fF])[fF]?z0x[0-9a-fA-F]+[LlUu]*z0[0-7]+[LlUu]*z
\d+[LlUu]*z[~!%^&*+=|?:<>/-]z[()\[\],.;]z(switch|case|default|const|new|static|char|continue|break|if|else|for|while|do|operator|enum|public|return|sizeof|tagof|state|goto)\bz(bool|Float)\bz(true|false)\bz[a-zA-Z_]\w*r   z#popz/\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})z	[^\\"\n]+z\\z[^/\n]+z/\*(.|\n)*?\*/z//.*?\nr   z	(?<=\\)\nz^\s*#if.*?(?<!\\)\nz#pushz^\s*#endif.*?(?<!\\)\nz.*?\n)r   r   r   r   c             C   s   d| krdS dS )zvThis is basically C. There is a keyword which doesn't exist in C
        though and is nearly unique to this language.Ztagofg{Gz?Nr(   )r.   r(   r(   r)   analyse_text   s    zPawnLexer.analyse_textN)r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r   r<   r   r=   r>   r
   r   r?   r	   r   r@   rA   rB   r   r   r,   rC   r   rD   rE   rH   r(   r(   r(   r)   r      s\   





N)r5   Zpygments.lexerr   Zpygments.tokenr   r   r   r   r   r   r	   r
   Zpygments.utilr   __all__r   r   r(   r(   r(   r)   <module>	   s   (n