sourcemod/editor/geshi/sourcepawn.php

135 lines
36 KiB
PHP
Raw Normal View History

<?php
/**
* =============================================================================
* SourcePawn GeSHi Syntax File
* Copyright (C) 2010 AlliedModders LLC
* INC parser originally by Zach "theY4Kman" Kanzler,
* ported to perl and enhanced by Nicholas "psychonic" Hastings
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
$language_data = array(
'LANG_NAME' => 'SourcePawn',
'COMMENT_SINGLE' => array(1 => '//'),
'COMMENT_MULTI' => array("/*" => "*/"),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => array('"','\''),
'ESCAPE_CHAR' => '\\',
'ESCAPE_REGEXP' => array(
1 => "#\\\\x[\da-fA-F]{1,2}#",
2 => "#\\\\b[01]{1,8}#",
3 => "#%[%sdif%NLbxXtTc]#",
),
'SYMBOLS' => array(
0 => array(';'),
// Assignment operators
1 => array('=', '+=', '-=', '/=', '*=', '&=', '|=', '~=', '^='),
// Comparison and logical operators
2 => array('==', '!=', '&&', '||', '>', '<', '<=', '>='),
// Other operators
3 => array('+', '-', '*', '/', '|', '&', '~', '++', '--', '^', '%%', '!'),
),
'KEYWORDS' => array(
// Reserved words
1 => array(
'for', 'if', 'else', 'do', 'while', 'switch', 'case', 'return',
'break', 'continue', 'new', 'decl', 'public', 'stock', 'const',
'enum', 'forward', 'static', 'funcenum', 'functag', 'native',
'sizeof', 'true', 'false', 'default',
),
// Tags
2 => array(
'Action', 'bool', 'Float', 'Plugin', 'String', 'any',
'AdminFlag','OverrideType','OverrideRule','ImmunityType','GroupId','AdminId','AdmAccessMode','AdminCachePart','CookieAccess','CookieMenu','CookieMenuAction','NetFlow','ConVarBounds','QueryCookie','ReplySource','ConVarQueryResult','ConVarQueryFinished','Function','Action','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','UserMsg',
),
// Natives
3 => array(
'DumpAdminCache','AddCommandOverride','GetCommandOverride','UnsetCommandOverride','CreateAdmGroup','FindAdmGroup','SetAdmGroupAddFlag','GetAdmGroupAddFlag','GetAdmGroupAddFlags','SetAdmGroupImmunity','GetAdmGroupImmunity','SetAdmGroupImmuneFrom','GetAdmGroupImmuneCount','GetAdmGroupImmuneFrom','AddAdmGroupCmdOverride','GetAdmGroupCmdOverride','RegisterAuthIdentType','CreateAdmin','GetAdminUsername','BindAdminIdentity','SetAdminFlag','GetAdminFlag','GetAdminFlags','AdminInheritGroup','GetAdminGroupCount','GetAdminGroup','SetAdminPassword','GetAdminPassword','FindAdminByIdentity','RemoveAdmin','FlagBitsToBitArray','FlagBitArrayToBits','FlagArrayToBits','FlagBitsToArray','FindFlagByName','FindFlagByChar','ReadFlagString','CanAdminTarget','CreateAuthMethod','SetAdmGroupImmunityLevel','GetAdmGroupImmunityLevel','SetAdminImmunityLevel','GetAdminImmunityLevel','FlagToBit','BitToFlag','GetAdminTopMenu','AddTargetsToMenu','AddTargetsToMenu2','RedisplayAdminMenu','CreateArray','ClearArray','CloneArray','ResizeArray','GetArraySize','PushArrayCell','PushArrayString','PushArrayArray','GetArrayCell','GetArrayString','GetArrayArray','SetArrayCell','SetArrayString','SetArrayArray','ShiftArrayUp','RemoveFromArray','SwapArrayItems','FindStringInArray','FindValueInArray','ByteCountToCells','CreateStack','PushStackCell','PushStackString','PushStackArray','PopStackCell','PopStackString','PopStackArray','IsStackEmpty','PopStack','CreateTrie','SetTrieValue','SetTrieArray','SetTrieString','GetTrieValue','GetTrieArray','GetTrieString','RemoveFromTrie','ClearTrie','GetTrieSize','BanClient','BanIdentity','RemoveBan','BfWriteBool','BfWriteByte','BfWriteChar','BfWriteShort','BfWriteWord','BfWriteNum','BfWriteFloat','BfWriteString','BfWriteEntity','BfWriteAngle','BfWriteCoord','BfWriteVecCoord','BfWriteVecNormal','BfWriteAngles','BfReadBool','BfReadByte','BfReadChar','BfReadShort','BfReadWord','BfReadNum','BfReadFloat','BfReadString','BfReadEntity','BfReadAngle','BfReadCoord','BfReadVecCoord','BfReadVecNormal','BfReadAngles','BfGetNumBytesLeft','RegClientCookie','FindClientCookie','SetClientCookie','GetClientCookie','AreClientCookiesCached','SetCookiePrefabMenu','SetCookieMenuItem','ShowCookieMenu','GetCookieIterator','ReadCookieIterator','GetCookieAccess','GetClientCookieTime','GetMaxClients','GetClientCount','GetClientName','GetClientIP','GetClientAuthString','GetClientUserId','IsClientConnected','IsClientInGame','IsClientInKickQueue','IsClientAuthorized','IsFakeClient','IsClientObserver','IsPlayerAlive','GetClientInfo','GetClientTeam','SetUserAdmin','GetUserAdmin','AddUserFlags','RemoveUserFlags','SetUserFlagBits','GetUserFlagBits','CanUserTarget','RunAdminCacheChecks','NotifyPostAdminCheck','CreateFakeClient','SetFakeClientConVar','GetClientHealth','GetClientModel','GetClientWeapon','GetClientMaxs','GetClientMins','GetClientAbsAngles','GetClientAbsOrigin','GetClientArmor','GetClientDeaths','GetClientFrags','GetClientDataRate','IsClientTimingOut','GetClientTime','GetClientLatency','GetClientAvgLatency','GetClientAvgLoss','GetClientAvgChoke','GetClientAvgData','GetClientAvgPackets','GetClientOfUserId','KickClient','KickClientEx','ChangeClientTeam','GetClientSerial','GetClientFromSerial','IsPlayerInGame','ProcessTargetString','ReplyToTargetError','ServerCommand','InsertServerCommand','ServerExecute','ClientCommand','FakeClientCommand','FakeClientCommandEx','PrintToServer','PrintToConsole','ReplyToCommand','GetCmdReplySource','SetCmdReplySource','IsChatTrigger','ShowActivity2','ShowActivity','ShowActivityEx','FormatActivitySource','RegServerCmd','RegConsoleCmd','RegAdminCmd','GetCmdArgs','GetCmdArg','GetCmdArgString','CreateConVar','FindConVar','HookConVarChange','UnhookConVarChange','GetConVarBool','SetConVarBool','GetConVarInt','SetConVarInt','GetConVarFloat','SetConVarFloat','GetConVarString','SetConVarString','ResetConVar','GetConVarFlags','SetConVarFlags','GetConVarBounds','SetConVarBounds','GetConVarName','QueryClientConVar','GetCommandIterator','ReadCommandIterator','CheckCommandAccess','GetCommandFlags','SetCommandFlags','FindFirstConComm
),
// Forwards
4 => array(
'OnRebuildAdminCache','OnAdminMenuCreated','OnAdminMenuReady','OnBanClient','OnBanIdentity','OnRemoveBan','OnClientCookiesCached','OnClientConnect','OnClientConnected','OnClientPutInServer','OnClientDisconnect','OnClientDisconnect_Post','OnClientCommand','OnClientSettingsChanged','OnClientAuthorized','OnClientPreAdminCheck','OnClientPostAdminFilter','OnClientPostAdminCheck','OnLogAction','OnNominationRemoved','OnPlayerRunCmd','OnPluginStart','AskPluginLoad','AskPluginLoad2','OnPluginEnd','OnPluginPauseChange','OnGameFrame','OnMapStart','OnMapEnd','OnConfigsExecuted','OnAutoConfigsBuffered','OnServerCfg','OnAllPluginsLoaded','OnLibraryAdded','OnLibraryRemoved','OnClientFloodCheck','OnClientFloodResult','TF2_CalcIsAttackCritical','OnMapTimeLeftChanged',
),
// Defines
5 => array(
'MaxClients',
'AdminFlags_TOTAL','ADMFLAG_RESERVATION','ADMFLAG_GENERIC','ADMFLAG_KICK','ADMFLAG_BAN','ADMFLAG_UNBAN','ADMFLAG_SLAY','ADMFLAG_CHANGEMAP','ADMFLAG_CONVARS','ADMFLAG_CONFIG','ADMFLAG_CHAT','ADMFLAG_VOTE','ADMFLAG_PASSWORD','ADMFLAG_RCON','ADMFLAG_CHEATS','ADMFLAG_ROOT','ADMFLAG_CUSTOM1','ADMFLAG_CUSTOM2','ADMFLAG_CUSTOM3','ADMFLAG_CUSTOM4','ADMFLAG_CUSTOM5','ADMFLAG_CUSTOM6','AUTHMETHOD_STEAM','AUTHMETHOD_IP','AUTHMETHOD_NAME','Admin_Reservation','Admin_Generic','Admin_Kick','Admin_Ban','Admin_Unban','Admin_Slay','Admin_Changemap','Admin_Convars','Admin_Config','Admin_Chat','Admin_Vote','Admin_Password','Admin_RCON','Admin_Cheats','Admin_Root','Admin_Custom1','Admin_Custom2','Admin_Custom3','Admin_Custom4','Admin_Custom5','Admin_Custom6','Override_Command','Override_CommandGroup','Command_Deny','Command_Allow','Immunity_Default','Immunity_Global','INVALID_GROUP_ID','INVALID_ADMIN_ID','Access_Real','Access_Effective','AdminCache_Overrides','AdminCache_Groups','AdminCache_Admins','TEMP_REQUIRE_EXTENSIONS','REQUIRE_EXTENSIONS','ADMINMENU_PLAYERCOMMANDS','ADMINMENU_SERVERCOMMANDS','ADMINMENU_VOTINGCOMMANDS','BANFLAG_AUTO','BANFLAG_IP','BANFLAG_AUTHID','BANFLAG_NOKICK','CookieAccess_Public','CookieAccess_Protected','CookieAccess_Private','CookieMenu_YesNo','CookieMenu_YesNo_Int','CookieMenu_OnOff','CookieMenu_OnOff_Int','CookieMenuAction_DisplayOption','CookieMenuAction_SelectOption','MAXPLAYERS','MAX_NAME_LENGTH','NetFlow_Outgoing','NetFlow_Incoming','NetFlow_Both','MAX_TARGET_LENGTH','COMMAND_FILTER_ALIVE','COMMAND_FILTER_DEAD','COMMAND_FILTER_CONNECTED','COMMAND_FILTER_NO_IMMUNITY','COMMAND_FILTER_NO_MULTI','COMMAND_FILTER_NO_BOTS','COMMAND_TARGET_NONE','COMMAND_TARGET_NOT_ALIVE','COMMAND_TARGET_NOT_DEAD','COMMAND_TARGET_NOT_IN_GAME','COMMAND_TARGET_IMMUNE','COMMAND_TARGET_EMPTY_FILTER','COMMAND_TARGET_NOT_HUMAN','COMMAND_TARGET_AMBIGUOUS','INVALID_FCVAR_FLAGS','FCVAR_NONE','FCVAR_UNREGISTERED','FCVAR_LAUNCHER','FCVAR_GAMEDLL','FCVAR_CLIENTDLL','FCVAR_MATERIAL_SYSTEM','FCVAR_PROTECTED','FCVAR_SPONLY','FCVAR_ARCHIVE','FCVAR_NOTIFY','FCVAR_USERINFO','FCVAR_PRINTABLEONLY','FCVAR_UNLOGGED','FCVAR_NEVER_AS_STRING','FCVAR_REPLICATED','FCVAR_CHEAT','FCVAR_STUDIORENDER','FCVAR_DEMO','FCVAR_DONTRECORD','FCVAR_PLUGIN','FCVAR_DATACACHE','FCVAR_TOOLSYSTEM','FCVAR_FILESYSTEM','FCVAR_NOT_CONNECTED','FCVAR_SOUNDSYSTEM','FCVAR_ARCHIVE_XBOX','FCVAR_INPUTSYSTEM','FCVAR_NETWORKSYSTEM','FCVAR_VPHYSICS','FEATURECAP_COMMANDLISTENER','ConVarBound_Upper','ConVarBound_Lower','QUERYCOOKIE_FAILED','SM_REPLY_TO_CONSOLE','SM_REPLY_TO_CHAT','ConVarQuery_Okay','ConVarQuery_NotFound','ConVarQuery_NotValid','ConVarQuery_Protected','SOURCEMOD_PLUGINAPI_VERSION','AUTOLOAD_EXTENSIONS','REQUIRE_EXTENSIONS','REQUIRE_PLUGIN','INVALID_FUNCTION','Plugin_Continue','Plugin_Changed','Plugin_Handled','Plugin_Stop','Identity_Core','Identity_Extension','Identity_Plugin','Plugin_Running','Plugin_Paused','Plugin_Error','Plugin_Loaded','Plugin_Failed','Plugin_Created','Plugin_Uncompiled','Plugin_BadLoad','PlInfo_Name','PlInfo_Author','PlInfo_Description','PlInfo_Version','PlInfo_URL','CS_TEAM_NONE','CS_TEAM_SPECTATOR','CS_TEAM_T','CS_TEAM_CT','CS_SLOT_PRIMARY','CS_SLOT_SECONDARY','CS_SLOT_GRENADE','CS_SLOT_C4','DBVal_Error','DBVal_TypeMismatch','DBVal_Null','DBVal_Data','DBBind_Int','DBBind_Float','DBBind_String','DBPrio_High','DBPrio_Normal','DBPrio_Low','FL_EDICT_CHANGED','FL_EDICT_FREE','FL_EDICT_FULL','FL_EDICT_FULLCHECK','FL_EDICT_ALWAYS','FL_EDICT_DONTSEND','FL_EDICT_PVSCHECK','FL_EDICT_PENDING_DORMANT_CHECK','FL_EDICT_DIRTY_PVS_INFORMATION','FL_FULL_EDICT_CHANGED','Prop_Send','Prop_Data','PropField_Unsupported','PropField_Integer','PropField_Float','PropField_Entity','PropField_Vector','PropField_String','PropField_String_T','IN_ATTACK','IN_JUMP','IN_DUCK','IN_FORWARD','IN_BACK','IN_USE','IN_CANCEL','IN_LEFT','IN_RIGHT','IN_MOVELEFT','IN_MOVERIGHT','IN_ATTACK2','IN_RUN','IN_RELOAD','IN_ALT1','IN_ALT2','IN_SCORE','IN_SPEED','IN_WALK','IN_ZOOM','IN_WEAPON1','IN_WEAPON2','IN_BULLRUSH','IN_GRENADE1','IN_GRENADE2','FL_ONGROUND','FL_DUCKING','FL_WATERJUMP','FL_ONTRAI
),
),
'NUMBERS' => array(
GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_NONSCI | GESHI_NUMBER_BIN_PREFIX_0B | GESHI_NUMBER_HEX_PREFIX
),
'TAB_WIDTH' => 4,
'CASE_SENSITIVE' => array(
1 => true,
2 => true,
3 => true,
4 => true,
5 => true
),
'REGEXPS' => array(
0 => array(
GESHI_SEARCH => '(#include\s+)(&lt;\w+&gt;)',
GESHI_REPLACE => '\\2',
GESHI_BEFORE => '\\1',
),
1 => array(
GESHI_SEARCH => '(#\w+)(\s+)',
GESHI_REPLACE => '\\1',
GESHI_AFTER => '\\2'
),
),
'STYLES' => array(
'KEYWORDS' => array(
1 => 'color: #0000EE; font-weight: bold;',
2 => 'color: #218087; font-weight: bold;',
3 => 'color: #000040;',
4 => 'color: #000040;',
5 => 'color: #8000FF;',
),
'COMMENTS' => array(
1 => 'color: #006600; font-style: italic;',
'MULTI' => 'color: #006600; font-style: italic;',
),
'ESCAPE_CHAR' => array(
0 => 'color: #ff00ff;',
1 => 'color: #ff00ff;',
2 => 'color: #ff00ff;',
3 => 'color: #ff00ff;',
),
'SYMBOLS' => array(
0 => 'color: #1B5B00; font-weight: bold;',
1 => 'color: #1B5B00;',
2 => 'color: #1B5B00;',
3 => 'color: #1B5B00;',
),
'STRINGS' => array(
0 => 'color: #B90000;',
),
'BRACKETS' => array(
0 => 'color: #1B5B00; font-weight: bold;',
),
'NUMBERS' => array(
0 => 'color: #AE5700;',
),
'REGEXPS' => array(
0 => 'color: #B90000;',
1 => 'color: #0000aa;'
)
),
);
?>