a
    ¨ˆcÒ  ã                   @   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-2022 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                   @   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h d2£Zd3d4„ Zd5d6„ Z d7S )8r   z]
    For SourcePawn source code with preprocessor directives.

    .. versionadded:: 1.6
    Z
SourcePawnÚspz*.spztext/x-sourcepawnz(?:\s|//.*?\n|/\*.*?\*/)+ú\s*(?:/[*].*?[*]/\s*)*ú^#if\s+0Úif0ú^#Úmacroú^ú#if\s+0ú#ú\nú\s+ú\\\nú/(\\\n)?/(\n|(.|\n)*?[^\\]\n)z/(\\\n)?\*(.|\n)*?\*(\\\n)?/ú[{}]úL?"Ústringú4L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'ú'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*ú(\d+\.\d*|\.\d+|\d+[fF])[fF]?ú0x[0-9a-fA-F]+[LlUu]*ú0[0-7]+[LlUu]*ú
\d+[LlUu]*ú[~!%^&*+=|?:<>/-]ú[()\[\],.;]zs(case|const|continue|native|default|else|enum|for|if|new|operator|public|return|sizeof|static|decl|struct|switch)\bú(bool|Float)\bú(true|false)\bú[a-zA-Z_]\w*ú"ú#popú/\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})ú	[^\\"\n]+ú\\ú[^/\n]+ú/\*(.|\n)*?\*/ú//.*?\nú/ú	(?<=\\)\nú^\s*#if.*?(?<!\\)\nú#pushú^\s*#endif.*?(?<!\\)\nú.*?\n©Úrootr   r   r   >M   Z	ParamTypeZFeatureTypeÚActionZOverrideTypeÚFileTypeZSDKCallTypeZTFClassTypeZExecTypeZTopMenuActionZIdentityZConVarQueryFinishedZ
DialogTypeZNetFlowZ
SDKLibraryZEventHookModeZ	MenuStyleZ
CookieMenuÚboolZRenderFxZ
DBPriorityZTopMenuPositionZPathTypeZKvDataTypesZ	EventHookZSDKTypeZ
SortFunc2DZMoveTypeZSDKFuncConfSourceZPluginStatusZGroupIdZImmunityTypeZPluginZFeatureStatusZTFCondZTopMenuObjectTypeZ	SortOrderÚanyZDBResultZSMCErrorZQueryCookieZPropFieldTypeZ
PluginInfoZFunctionZAPLResZ
MenuSourceZCookieAccessZ	AdminFlagZRayTypeZ
RenderModeZPropTypeZAdminCachePartÚFloatZ
RegexErrorZReplySourcer   Z	SMCResultZSortTypeZTFResourceTypeZUserMsgZOverrideRuleZNominateResultZSDKPassMethodZAdminIdZTraceEntityFilterZConVarQueryResultZCookieMenuActionZ	MapChangeZ
MenuActionZListenOverrideZTFTeamZ
DBBindTypeZAdmAccessModeZFileTimeModeZTopMenuObjectÚTimerZConVarBoundsÚHandlec                 K   sJ   t |ddƒ| _tƒ | _| jr4ddlm} | j |¡ tj| fi |¤Ž d S )NZ	sourcemodTr   )Ú	FUNCTIONS)	r   ÚsmhighlightingÚsetÚ
_functionsZ#pygments.lexers._sourcemod_builtinsr@   Úupdater   Ú__init__)ÚselfÚoptionsr@   © rH   úW/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pygments/lexers/pawn.pyrE   k   s    ÿzSourcePawnLexer.__init__c                 c   sX   t  | |¡D ]F\}}}|tu rF| jrF|| jv r6tj}n|| jv rFtj}|||fV  qd S )N)	r   Úget_tokens_unprocessedr   rA   ÚSM_TYPESr   ÚTyperC   ZBuiltin)rF   ÚtextÚindexÚtokenÚvaluerH   rH   rI   rJ   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   rL   ÚConstantr   ÚEscapeÚtokensrK   rE   rJ   rH   rH   rH   rI   r      sl   

þåû

ú	

ýÓ4
c                   @   sv  e Zd ZdZdZdgZg d¢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d2d3„ Zd4S )5r   z:
    For Pawn source code.

    .. versionadded:: 2.0
    ZPawnZpawn)z*.pz*.pwnz*.incztext/x-pawnz (?:\s|//.*?\n|/[*][\w\W]*?[*]/)+r   r   r   r   r   r   r   r   r   r   r   r   z/(\\\n)?\*[\w\W]*?\*(\\\n)?/r   r   r   r   r   r    r!   r"   r#   r$   r%   z…(switch|case|default|const|new|static|char|continue|break|if|else|for|while|do|operator|enum|public|return|sizeof|tagof|state|goto)\br&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   c                 C   s   d| v 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{®Gáz„?NrH   )rM   rH   rH   rI   Úanalyse_textÆ   s    zPawnLexer.analyse_textN)rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r   r[   r   r\   r]   r
   r   r^   r	   r=   r_   r`   ra   r   r   rL   rb   r   rc   rd   re   rH   rH   rH   rI   r   �   sh   

þåû

ú	

ýÓ4N)rT   Zpygments.lexerr   Zpygments.tokenr   r   r   r   r   r   r	   r
   Zpygments.utilr   Ú__all__r   r   rH   rH   rH   rI   Ú<module>   s   
(n