3 ��X� � @ st d Z ddlmZ ddlmZmZmZmZmZm Z m Z mZmZ ddl mZ ddgZG dd� de�ZG dd� de�Zd S ) z� pygments.lexers.pawn ~~~~~~~~~~~~~~~~~~~~ Lexers for the Pawn languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � )� RegexLexer) �Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Error)�get_bool_opt�SourcePawnLexer� PawnLexerc O @ s� e Zd ZdZdZdgZdgZdgZdZdZ de jd fd e jdfde d e jd fde d e jdfdefdefdefde j fde jfdefdedfdejfdejfdejfdejfdejfdejfdefdefdefd efd!ejfd"ejfd#efgd$ed%fd&ejfd'efdefd(efgd)e jfd*e jfd+e j d%fd,e jfd-e jfde jd%fgd.e jd/fd0e jd%fd1e fgd2�Zed��Z d�d�� Z!d�d�� Z"d�S )�r z] For SourcePawn source code with preprocessor directives. .. versionadded:: 1.6 Z SourcePawnZspz*.spztext/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[{}]zL?"�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]?z0x[0-9a-fA-F]+[LlUu]*z0[0-7]+[LlUu]*z \d+[LlUu]*z\*/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�Float�Pluginr �any� AdminFlag�OverrideType�OverrideRule�ImmunityType�GroupId�AdminId� AdmAccessMode�AdminCachePart�CookieAccess� CookieMenu�CookieMenuAction�NetFlow�ConVarBounds�QueryCookie�ReplySource�ConVarQueryResult�ConVarQueryFinished�Function�Identity�PluginStatus� PluginInfo�DBResult� DBBindType� DBPriority�PropType� PropFieldType�MoveType� RenderMode�RenderFx� EventHookMode� EventHook�FileType�FileTimeMode�PathType� ParamType�ExecType� DialogType�Handle�KvDataTypes�NominateResult� MapChange� MenuStyle� MenuAction� MenuSource� RegexError�SDKCallType� SDKLibrary�SDKFuncConfSource�SDKType� SDKPassMethod�RayType�TraceEntityFilter�ListenOverride� SortOrder�SortType� SortFunc2D�APLRes�FeatureType� FeatureStatus� SMCResult�SMCError�TFClassType�TFTeam�TFCond�TFResourceType�Timer� TopMenuAction�TopMenuObjectType�TopMenuPosition� TopMenuObject�UserMsgc K sF t |dd�| _t� | _| jr4ddlm} | jj|� tj| f|� d S )NZ sourcemodTr )� FUNCTIONS) r �smhighlighting�set� _functionsZ#pygments.lexers._sourcemod_builtinsrc �updater �__init__)�selfZoptionsrc � rj �/usr/lib/python3.6/pawn.pyrh m s zSourcePawnLexer.__init__c c s\ xVt j| |�D ]F\}}}|tkrH| jrH|| jkr8tj}n|| jkrHtj}|||fV qW d S )N) r �get_tokens_unprocessedr rd �SM_TYPESr �Typerf ZBuiltin)ri �text�index�token�valuerj rj rk rl w s z&SourcePawnLexer.get_tokens_unprocessedN)Nr r r r r r r r r r r r! r"