|e|dZddlmZddlmZmZmZmZmZm Z m Z m Z ddl m Z ddgZGddeZGddeZy ) 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)TextCommentOperatorKeywordNameStringNumber Punctuation) get_bool_optSourcePawnLexer PawnLexerc&eZdZdZdZdgZdgZdgZdZdZ de jd fd e jd fd e zd ze jd fd e zdze jd fde fde fde fde jfde jfdefdedfdej"fdej&fdej&fdej(fdej*fdej,fdefdefdefd ej2fd!ej4fd"efgd#ed$fd%ej8fd&efdefd'efgd(e jfd)e jfd*e jd$fd+e jfd,e jfde jd$fgd-e jd.fd/e jd$fd0e fgd1Zhd2Zd3Zd4Z y5)6r 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.*?(?ManyboolFloatTimerAPLResActionHandlePluginr TFCondTFTeamAdminIdGroupIdNetFlowRayTypeSDKTypeUserMsgDBResultExecTypeFileTypeFunctionIdentityMoveTypePathTypePropTypeRenderFxSMCErrorSortType 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 TopMenuObjectAdminCachePartListenOverrideNominateResultTFResourceTypeTopMenuPositionCookieMenuActionConVarQueryResultSDKFuncConfSourceTopMenuObjectTypeTraceEntityFilterConVarQueryFinishedc t|dd|_t|_|jr!ddlm}|jj |tj|fi|y)N sourcemodTr) FUNCTIONS) r smhighlightingset _functions#pygments.lexers._sourcemod_builtinsrupdater__init__)selfoptionsrs 6/usr/lib/python3/dist-packages/pygments/lexers/pawn.pyrzSourcePawnLexer.__init__ksR*7+6>%    E OO " "9 -D,G,c#Ktj||D]^\}}}|turI|jr=||jvrt j }n||jvrtj}|||f`yw)N) rget_tokens_unprocessedrrSM_TYPESrTyperBuiltin)rtextindextokenvalues rrz&SourcePawnLexer.get_tokens_unprocessedusp11$= & E5%}&& - ' $//1 $ % % &sA9A;N)!__name__ __module__ __qualname____doc__namealiases filenames mimetypes_ws_ws1rPreprocrSingle Multiliner r Charr r>HexOctIntegerrrrConstantrEscapetokensrrrrrr r s DfGI$%I 'C $D '//5 1 7??G , 4Z* $goou = 4Z# w 8 DM TN dO -w~~ > ,g.?.? @ k " VX & Dfkk R 7 F -v|| < %vzz 2  + FNN + !8 , [ )BCJ L -  0 0 1 d #7 <66 " ? O 6 " f  FO   )  1 1 2  0 7?? # 7?? + GOOV ,  $W__g > & @ w  [2Fh?H(- &rceZdZdZdZdgZgdZdgZdZdZ de jd fd e jd fd e zd ze jd fd e zdze jd fde fde fde fde jfde jfdefdedfdej"fdej&fdej&fdej(fdej*fdej,fdefdefdefd ej2fd!ej4fd"efgd#ed$fd%ej8fd&efdefd'efgd(e jfd)e jfd*e jd$fd+e jfd,e jfde jd$fgd-e jd.fd/e jd$fd0e fgd1Zd2Zy3)4rz: For Pawn source code. .. versionadded:: 2.0 Pawnpawn)z*.pz*.pwnz*.incz text/x-pawnz (?:\s|//.*?\n|/[*][\w\W]*?[*]/)+rrrrrrrrrrrrz/(\\\n)?\*[\w\W]*?\*(\\\n)?/rrr 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/r0r1r2r3r4r5r6r7r8r9r:cd|vryy)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)rs r analyse_textzPawnLexer.analyse_texts d? rN)rrrrrrrrrrrrrrrr r rr r>rrrrrrrrrrrrrrrrs  DhG)II .C $D '//5 1 7??G , 4Z* $goou = 4Z# w 8 DM TN dO -w~~ > ,g.?.? @ k " VX & Dfkk R 7 F -v|| < %vzz 2  + FNN + !8 , [ )9:A C -  0 0 1 d #7 <66 " ? O 6 " f  FO   )  1 1 2  0 7?? # 7?? + GOOV ,  $W__g > & @ w  [2FhrN)rpygments.lexerrpygments.tokenrrrrrr r r pygments.utilr __all__r rrrrrsH&& k *k&jk&\I Ir