o a@spdZddlmZddlmZmZmZmZmZm Z m Z m Z ddl m Z ddgZGdddeZGdddeZd S) z pygments.lexers.pawn ~~~~~~~~~~~~~~~~~~~~ Lexers for the Pawn languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. ) RegexLexer)TextCommentOperatorKeywordNameStringNumber Punctuation) get_bool_optSourcePawnLexer PawnLexerc@seZdZdZdZdgZdgZdgZdZdZ de j d fd e j d fd e d e j d fd e de j d fde fde fde fde j fde jfdefdedfdejfdejfdejfdejfdejfdejfdefdefdefd ejfd!ejfd"efgd#ed$fd%ejfd&efdefd'efgd(e j fd)e jfd*e j d$fd+e j fd,e j fde j d$fgd-e j d.fd/e j d$fd0e fgd1Zhd2Zd3d4Zd5d6Z d7S)8r z] For SourcePawn source code with preprocessor directives. .. versionadded:: 1.6 SourcePawnspz*.spztext/x-sourcepawnz(?:\s|//.*?\n|/\*.*?\*/)+\s*(?:/[*].*?[*]/\s*)*^#if\s+0if0^#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.*?(?ManyboolFloatTimerAPLResActionHandlePluginrTFCondTFTeamAdminIdGroupIdNetFlowRayTypeSDKTypeUserMsgDBResultExecTypeFileTypeFunctionIdentityMoveTypePathTypePropTypeRenderFxSMCErrorSortType AdminFlag EventHook MapChange MenuStyle ParamType SMCResult SortOrder CookieMenu DBBindType DBPriority DialogType MenuAction MenuSource PluginInfo RegexError RenderMode SDKLibrary SortFunc2D FeatureType KvDataTypes QueryCookie ReplySource SDKCallType TFClassType ConVarBounds CookieAccess FileTimeMode ImmunityType OverrideRule OverrideType PluginStatus AdmAccessMode EventHookMode FeatureStatus PropFieldType SDKPassMethod TopMenuAction TopMenuObjectAdminCachePartListenOverrideNominateResultTFResourceTypeTopMenuPositionCookieMenuActionConVarQueryResultSDKFuncConfSourceTopMenuObjectTypeTraceEntityFilterConVarQueryFinishedcKsJt|dd|_t|_|jrddlm}|j|tj|fi|dS)N sourcemodTr) FUNCTIONS) r smhighlightingset _functions#pygments.lexers._sourcemod_builtinsrupdater__init__)selfoptionsrr6/usr/lib/python3/dist-packages/pygments/lexers/pawn.pyrks  zSourcePawnLexer.__init__ccsZt||D]#\}}}|tur$|jr$||jvrtj}n||jvr$tj}|||fVqdS)N) rget_tokens_unprocessedrrSM_TYPESrTyperBuiltin)rtextindextokenvaluerrrrus    z&SourcePawnLexer.get_tokens_unprocessedN)!__name__ __module__ __qualname____doc__namealiases filenames mimetypes_ws_ws1rPreprocrSingle Multiliner rCharr r<HexOctIntegerrrrConstantrEscapetokensrrrrrrrr sn     4 c@sveZdZdZdZdgZgdZdgZdZdZ de j d fd e j d fd e d e j d fd e de j d fde fde fde fde j fde jfdefdedfdejfdejfdejfdejfdejfdejfdefdefdefd ejfd!ejfd"efgd#ed$fd%ejfd&efdefd'efgd(e j fd)e jfd*e j d$fd+e j fd,e j fde j d$fgd-e j d.fd/e j d$fd0e fgd1Zd2d3Zd4S)5r z: For Pawn source code. .. versionadded:: 2.0 Pawnpawn)z*.pz*.pwnz*.incz text/x-pawnz (?:\s|//.*?\n|/[*][\w\W]*?[*]/)+rrrrrrrrrrrrz/(\\\n)?\*[\w\W]*?\*(\\\n)?/rrrrr 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/r0r1r2r3r4r5r6r7r8cCsd|vrdSdS)zvThis is basically C. There is a keyword which doesn't exist in C though and is nearly unique to this language.tagofg{Gz?Nr)rrrr analyse_textszPawnLexer.analyse_textN)rrrrrrrrrrrrrrrr rrr r<rrrrrrrrrrrrrrrr sj      4N)rpygments.lexerrpygments.tokenrrrrrrr r pygments.utilr __all__r r rrrrs ( n