o
    ;h=                      @   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-2025 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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h d4Z d5d6 Z!d7d8 Z"d9S ):r   zB
    For SourcePawn source code with preprocessor directives.
    
SourcePawnspz*.spztext/x-sourcepawnz+https://github.com/alliedmodders/sourcepawnz1.6z(?:\s|//.*?\n|/\*.*?\*/)+\s*(?:/[*].*?[*]/\s*)*^#if\s+0if0^#macro^#if\s+0#\n\s+\\\n/(\\\n)?/(\n|(.|\n)*?[^\\]\n)z/(\\\n)?\*(.|\n)*?\*(\\\n)?/[{}]L?"string4L?'(\\.|\\[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UserMsgZFileTimeModeZ	SMCResultZ
PluginInfoZFeatureTypeZAdminIdFunctionZPluginStatusFloatZCookieMenuActionZOverrideRuleZTFTeamZKvDataTypesZConVarQueryResultZ
SDKLibraryTimerZPluginZ
MenuActionHandleZCookieAccessZTFCondZ	EventHookZ
RegexErrorZExecTypeActionZSMCErrorZ	MenuStyleZOverrideTypeZSDKFuncConfSourceZ
MenuSourceZTraceEntityFilterZRayTypeZGroupIdZQueryCookieZIdentityZDBResultZRenderFxZTopMenuObjectZTopMenuActionZ
DialogTypeZ	AdminFlagZ
DBBindTypeZTopMenuPositionZAPLResZNetFlowZPropTypeZNominateResultZMoveTypeZ
SortFunc2DZ	ParamTypeanyZ
CookieMenuZPathTypeZSDKCallTypeZ
RenderModer   Z	SortOrderZTFClassTypeZConVarBoundsZSDKPassMethodZEventHookModeFileTypeZListenOverrideZTopMenuObjectTypeZFeatureStatusZAdminCachePartZSDKTypeZAdmAccessModeZConVarQueryFinishedboolZTFResourceTypeZImmunityTypeZReplySourceZ	MapChangeZSortTypeZPropFieldTypeZ
DBPriorityc                 K   sJ   t |dd| _t | _| jrddlm} | j| tj| fi | d S )NZ	sourcemodTr   )	FUNCTIONS)	r   smhighlightingset
_functionsZ#pygments.lexers._sourcemod_builtinsrB   updater   __init__)selfoptionsrB    rJ   G/var/www/html/venv/lib/python3.10/site-packages/pygments/lexers/pawn.pyrG   k   s   zSourcePawnLexer.__init__c                 c   sZ    t | |D ]#\}}}|tu r$| jr$|| jv rtj}n|| jv r$tj}|||fV  qd S )N)	r   get_tokens_unprocessedr   rC   SM_TYPESr   TyperE   Builtin)rH   textindextokenvaluerJ   rJ   rK   rL   u   s   


z&SourcePawnLexer.get_tokens_unprocessedN)#__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_added_ws_ws1r   Preprocr   Single	Multiliner
   r   Charr	   r;   HexOctIntegerr   r   rN   Constantr   EscapetokensrM   rG   rL   rJ   rJ   rJ   rK   r      sr    




	
4
c                   @   s~  e Zd ZdZdZdgZg dZdgZdZd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.
    Pawnpawn)z*.pz*.pwnz*.incztext/x-pawnz(https://www.compuphase.com/pawn/pawn.htmz2.0z (?:\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/   r0   r1   r2   r3   r4   r5   r6   r7   r8   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{Gz?NrJ   )rP   rJ   rJ   rK   analyse_text   s   zPawnLexer.analyse_textN)!rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r   r`   r   ra   rb   r
   r   rc   r	   r;   rd   re   rf   r   r   rN   rg   r   rh   ri   rl   rJ   rJ   rJ   rK   r      sn    




	
4N)rW   Zpygments.lexerr   Zpygments.tokenr   r   r   r   r   r   r	   r
   Zpygments.utilr   __all__r   r   rJ   rJ   rJ   rK   <module>   s    
(n