KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

autohotkey.php 15KB

11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <?php
  2. /*************************************************************************************
  3. * autohotkey.php
  4. * --------
  5. * Author: Naveen Garg (naveen.garg@gmail.com)
  6. * Copyright: (c) 2009 Naveen Garg and GeSHi
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2009/06/11
  9. *
  10. * Autohotkey language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * Release 1.0.8.5 (2009/06/11)
  15. * - First Release
  16. *
  17. * TODO
  18. * ----
  19. * Reference: http://www.autohotkey.com/docs/
  20. *
  21. *************************************************************************************
  22. *
  23. * This file is part of GeSHi.
  24. *
  25. * GeSHi is free software; you can redistribute it and/or modify
  26. * it under the terms of the GNU General Public License as published by
  27. * the Free Software Foundation; either version 2 of the License, or
  28. * (at your option) any later version.
  29. *
  30. * GeSHi is distributed in the hope that it will be useful,
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  33. * GNU General Public License for more details.
  34. *
  35. * You should have received a copy of the GNU General Public License
  36. * along with GeSHi; if not, write to the Free Software
  37. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  38. *
  39. ************************************************************************************/
  40. $language_data = array (
  41. 'LANG_NAME' => 'Autohotkey',
  42. 'COMMENT_SINGLE' => array(
  43. 1 => ';'
  44. ),
  45. 'COMMENT_MULTI' => array('/*' => '*/'),
  46. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  47. 'QUOTEMARKS' => array('"'),
  48. 'ESCAPE_CHAR' => '',
  49. 'KEYWORDS' => array(
  50. 1 => array(
  51. 'while','if','and','or','else','return'
  52. ),
  53. 2 => array(
  54. // built in variables
  55. 'A_AhkPath','A_AhkVersion','A_AppData','A_AppDataCommon',
  56. 'A_AutoTrim','A_BatchLines','A_CaretX','A_CaretY',
  57. 'A_ComputerName','A_ControlDelay','A_Cursor','A_DD',
  58. 'A_DDD','A_DDDD','A_DefaultMouseSpeed','A_Desktop',
  59. 'A_DesktopCommon','A_DetectHiddenText','A_DetectHiddenWindows','A_EndChar',
  60. 'A_EventInfo','A_ExitReason','A_FormatFloat','A_FormatInteger',
  61. 'A_Gui','A_GuiEvent','A_GuiControl','A_GuiControlEvent',
  62. 'A_GuiHeight','A_GuiWidth','A_GuiX','A_GuiY',
  63. 'A_Hour','A_IconFile','A_IconHidden','A_IconNumber',
  64. 'A_IconTip','A_Index','A_IPAddress1','A_IPAddress2',
  65. 'A_IPAddress3','A_IPAddress4','A_ISAdmin','A_IsCompiled',
  66. 'A_IsCritical','A_IsPaused','A_IsSuspended','A_KeyDelay',
  67. 'A_Language','A_LastError','A_LineFile','A_LineNumber',
  68. 'A_LoopField','A_LoopFileAttrib','A_LoopFileDir','A_LoopFileExt',
  69. 'A_LoopFileFullPath','A_LoopFileLongPath','A_LoopFileName','A_LoopFileShortName',
  70. 'A_LoopFileShortPath','A_LoopFileSize','A_LoopFileSizeKB','A_LoopFileSizeMB',
  71. 'A_LoopFileTimeAccessed','A_LoopFileTimeCreated','A_LoopFileTimeModified','A_LoopReadLine',
  72. 'A_LoopRegKey','A_LoopRegName','A_LoopRegSubkey','A_LoopRegTimeModified',
  73. 'A_LoopRegType','A_MDAY','A_Min','A_MM',
  74. 'A_MMM','A_MMMM','A_Mon','A_MouseDelay',
  75. 'A_MSec','A_MyDocuments','A_Now','A_NowUTC',
  76. 'A_NumBatchLines','A_OSType','A_OSVersion','A_PriorHotkey',
  77. 'A_ProgramFiles','A_Programs','A_ProgramsCommon','A_ScreenHeight',
  78. 'A_ScreenWidth','A_ScriptDir','A_ScriptFullPath','A_ScriptName',
  79. 'A_Sec','A_Space','A_StartMenu','A_StartMenuCommon',
  80. 'A_Startup','A_StartupCommon','A_StringCaseSense','A_Tab',
  81. 'A_Temp','A_ThisFunc','A_ThisHotkey','A_ThisLabel',
  82. 'A_ThisMenu','A_ThisMenuItem','A_ThisMenuItemPos','A_TickCount',
  83. 'A_TimeIdle','A_TimeIdlePhysical','A_TimeSincePriorHotkey','A_TimeSinceThisHotkey',
  84. 'A_TitleMatchMode','A_TitleMatchModeSpeed','A_UserName','A_WDay',
  85. 'A_WinDelay','A_WinDir','A_WorkingDir','A_YDay',
  86. 'A_YEAR','A_YWeek','A_YYYY','Clipboard',
  87. 'ClipboardAll','ComSpec','ErrorLevel','ProgramFiles',
  88. ),
  89. 3 => array(
  90. 'AutoTrim',
  91. 'BlockInput','Break','Click',
  92. 'ClipWait','Continue','Control',
  93. 'ControlClick','ControlFocus','ControlGet',
  94. 'ControlGetFocus','ControlGetPos','ControlGetText',
  95. 'ControlMove','ControlSend','ControlSendRaw',
  96. 'ControlSetText','CoordMode','Critical',
  97. 'DetectHiddenText','DetectHiddenWindows','DllCall','Drive',
  98. 'DriveGet','DriveSpaceFree',
  99. 'Else','EnvAdd','EnvDiv',
  100. 'EnvGet','EnvMult','EnvSet',
  101. 'EnvSub','EnvUpdate','Exit',
  102. 'ExitApp','FileAppend','FileCopy',
  103. 'FileCopyDir','FileCreateDir','FileCreateShortcut',
  104. 'FileDelete','FileGetAttrib','FileGetShortcut',
  105. 'FileGetSize','FileGetTime','FileGetVersion',
  106. 'FileInstall','FileMove','FileMoveDir',
  107. 'FileRead','FileReadLine','FileRecycle',
  108. 'FileRecycleEmpty','FileRemoveDir','FileSelectFile',
  109. 'FileSelectFolder','FileSetAttrib','FileSetTime',
  110. 'FormatTime','Gosub',
  111. 'Goto','GroupActivate','GroupAdd',
  112. 'GroupClose','GroupDeactivate','Gui',
  113. 'GuiControl','GuiControlGet','Hotkey',
  114. 'IfExist','IfGreater','IfGreaterOrEqual',
  115. 'IfInString','IfLess','IfLessOrEqual',
  116. 'IfMsgBox','IfNotEqual','IfNotExist',
  117. 'IfNotInString','IfWinActive','IfWinExist',
  118. 'IfWinNotActive','IfWinNotExist','ImageSearch',
  119. 'IniDelete','IniRead','IniWrite',
  120. 'Input','InputBox','KeyHistory',
  121. 'KeyWait','ListHotkeys','ListLines',
  122. 'ListVars','Loop',
  123. 'Menu','MouseClick','MouseClickDrag',
  124. 'MouseGetPos','MouseMove','MsgBox',
  125. 'OnMessage','OnExit','OutputDebug',
  126. 'PixelGetColor','PixelSearch','PostMessage',
  127. 'Process','Progress','Random',
  128. 'RegExMatch','RegExReplace','RegisterCallback',
  129. 'RegDelete','RegRead','RegWrite',
  130. 'Reload','Repeat','Return',
  131. 'Run','RunAs','RunWait',
  132. 'Send','SendEvent','SendInput',
  133. 'SendMessage','SendMode','SendPlay',
  134. 'SendRaw','SetBatchLines','SetCapslockState',
  135. 'SetControlDelay','SetDefaultMouseSpeed','SetEnv',
  136. 'SetFormat','SetKeyDelay','SetMouseDelay',
  137. 'SetNumlockState','SetScrollLockState','SetStoreCapslockMode',
  138. 'SetTimer','SetTitleMatchMode','SetWinDelay',
  139. 'SetWorkingDir','Shutdown','Sleep',
  140. 'Sort','SoundBeep','SoundGet',
  141. 'SoundGetWaveVolume','SoundPlay','SoundSet',
  142. 'SoundSetWaveVolume','SplashImage','SplashTextOff',
  143. 'SplashTextOn','SplitPath','StatusBarGetText',
  144. 'StatusBarWait','StringCaseSense','StringGetPos',
  145. 'StringLeft','StringLen','StringLower',
  146. 'StringMid','StringReplace','StringRight',
  147. 'StringSplit','StringTrimLeft','StringTrimRight',
  148. 'StringUpper','Suspend','SysGet',
  149. 'Thread','ToolTip','Transform',
  150. 'TrayTip','URLDownloadToFile','While',
  151. 'VarSetCapacity',
  152. 'WinActivate','WinActivateBottom','WinClose',
  153. 'WinGet','WinGetActiveStats','WinGetActiveTitle',
  154. 'WinGetClass','WinGetPos','WinGetText',
  155. 'WinGetTitle','WinHide','WinKill',
  156. 'WinMaximize','WinMenuSelectItem','WinMinimize',
  157. 'WinMinimizeAll','WinMinimizeAllUndo','WinMove',
  158. 'WinRestore','WinSet','WinSetTitle',
  159. 'WinShow','WinWait','WinWaitActive',
  160. 'WinWaitClose','WinWaitNotActive'
  161. ),
  162. 4 => array(
  163. 'Abs','ACos','Asc','ASin',
  164. 'ATan','Ceil','Chr','Cos',
  165. 'Exp','FileExist','Floor',
  166. 'GetKeyState','IL_Add','IL_Create','IL_Destroy',
  167. 'InStr','IsFunc','IsLabel','Ln',
  168. 'Log','LV_Add','LV_Delete','LV_DeleteCol',
  169. 'LV_GetCount','LV_GetNext','LV_GetText','LV_Insert',
  170. 'LV_InsertCol','LV_Modify','LV_ModifyCol','LV_SetImageList',
  171. 'Mod','NumGet','NumPut',
  172. 'Round',
  173. 'SB_SetIcon','SB_SetParts','SB_SetText','Sin',
  174. 'Sqrt','StrLen','SubStr','Tan',
  175. 'TV_Add','TV_Delete','TV_GetChild','TV_GetCount',
  176. 'TV_GetNext','TV_Get','TV_GetParent','TV_GetPrev',
  177. 'TV_GetSelection','TV_GetText','TV_Modify',
  178. 'WinActive','WinExist'
  179. ),
  180. 5 => array(
  181. // #Directives
  182. 'AllowSameLineComments','ClipboardTimeout','CommentFlag',
  183. 'ErrorStdOut','EscapeChar','HotkeyInterval',
  184. 'HotkeyModifierTimeout','Hotstring','IfWinActive',
  185. 'IfWinExist','IfWinNotActive','IfWinNotExist',
  186. 'Include','IncludeAgain','InstallKeybdHook',
  187. 'InstallMouseHook','KeyHistory','LTrim',
  188. 'MaxHotkeysPerInterval','MaxMem','MaxThreads',
  189. 'MaxThreadsBuffer','MaxThreadsPerHotkey','NoEnv',
  190. 'NoTrayIcon','Persistent','SingleInstance',
  191. 'UseHook','WinActivateForce'
  192. ),
  193. 6 => array(
  194. 'Shift','LShift','RShift',
  195. 'Alt','LAlt','RAlt',
  196. 'LControl','RControl',
  197. 'Ctrl','LCtrl','RCtrl',
  198. 'LWin','RWin','AppsKey',
  199. 'AltDown','AltUp','ShiftDown',
  200. 'ShiftUp','CtrlDown','CtrlUp',
  201. 'LWinDown','LWinUp','RWinDown',
  202. 'RWinUp','LButton','RButton',
  203. 'MButton','WheelUp','WheelDown',
  204. 'WheelLeft','WheelRight','XButton1',
  205. 'XButton2','Joy1','Joy2',
  206. 'Joy3','Joy4','Joy5',
  207. 'Joy6','Joy7','Joy8',
  208. 'Joy9','Joy10','Joy11',
  209. 'Joy12','Joy13','Joy14',
  210. 'Joy15','Joy16','Joy17',
  211. 'Joy18','Joy19','Joy20',
  212. 'Joy21','Joy22','Joy23',
  213. 'Joy24','Joy25','Joy26',
  214. 'Joy27','Joy28','Joy29',
  215. 'Joy30','Joy31','Joy32',
  216. 'JoyX','JoyY','JoyZ',
  217. 'JoyR','JoyU','JoyV',
  218. 'JoyPOV','JoyName','JoyButtons',
  219. 'JoyAxes','JoyInfo','Space',
  220. 'Tab','Enter',
  221. 'Escape','Esc','BackSpace',
  222. 'BS','Delete','Del',
  223. 'Insert','Ins','PGUP',
  224. 'PGDN','Home','End',
  225. 'Up','Down','Left',
  226. 'Right','PrintScreen','CtrlBreak',
  227. 'Pause','ScrollLock','CapsLock',
  228. 'NumLock','Numpad0','Numpad1',
  229. 'Numpad2','Numpad3','Numpad4',
  230. 'Numpad5','Numpad6','Numpad7',
  231. 'Numpad8','Numpad9','NumpadMult',
  232. 'NumpadAdd','NumpadSub','NumpadDiv',
  233. 'NumpadDot','NumpadDel','NumpadIns',
  234. 'NumpadClear','NumpadUp','NumpadDown',
  235. 'NumpadLeft','NumpadRight','NumpadHome',
  236. 'NumpadEnd','NumpadPgup','NumpadPgdn',
  237. 'NumpadEnter','F1','F2',
  238. 'F3','F4','F5',
  239. 'F6','F7','F8',
  240. 'F9','F10','F11',
  241. 'F12','F13','F14',
  242. 'F15','F16','F17',
  243. 'F18','F19','F20',
  244. 'F21','F22','F23',
  245. 'F24','Browser_Back','Browser_Forward',
  246. 'Browser_Refresh','Browser_Stop','Browser_Search',
  247. 'Browser_Favorites','Browser_Home','Volume_Mute',
  248. 'Volume_Down','Volume_Up','Media_Next',
  249. 'Media_Prev','Media_Stop','Media_Play_Pause',
  250. 'Launch_Mail','Launch_Media','Launch_App1',
  251. 'Launch_App2'
  252. ),
  253. 7 => array(
  254. // Gui commands
  255. 'Add',
  256. 'Show', 'Submit', 'Cancel', 'Destroy',
  257. 'Font', 'Color', 'Margin', 'Flash', 'Default',
  258. 'GuiEscape','GuiClose','GuiSize','GuiContextMenu','GuiDropFilesTabStop',
  259. ),
  260. 8 => array(
  261. // Gui Controls
  262. 'Button',
  263. 'Checkbox','Radio','DropDownList','DDL',
  264. 'ComboBox','ListBox','ListView',
  265. 'Text', 'Edit', 'UpDown', 'Picture',
  266. 'TreeView','DateTime', 'MonthCal',
  267. 'Slider'
  268. )
  269. ),
  270. 'SYMBOLS' => array(
  271. '(',')','[',']',
  272. '+','-','*','/','&','^',
  273. '=','+=','-=','*=','/=','&=',
  274. '==','<','<=','>','>=',':=',
  275. ',','.'
  276. ),
  277. 'CASE_SENSITIVE' => array(
  278. GESHI_COMMENTS => false,
  279. 1 => false,
  280. 2 => false,
  281. 3 => false,
  282. 4 => false,
  283. 5 => false,
  284. 6 => false,
  285. 7 => false,
  286. 8 => false
  287. ),
  288. 'STYLES' => array(
  289. 'KEYWORDS' => array(
  290. 1 => 'color: #AAAAFF; font-weight: bold;', // reserved #blue
  291. 2 => 'color: #88FF88;', // BIV yellow
  292. 3 => 'color: #FF00FF; font-style: italic;', // commands purple
  293. 4 => 'color: #888844; font-weight: bold;', // functions #0080FF
  294. 5 => 'color: #000000; font-style: italic;', // directives #black
  295. 6 => 'color: #FF0000; font-style: italic;', // hotkeys #red
  296. 7 => 'color: #000000; font-style: italic;', // gui commands #black
  297. 8 => 'color: #000000; font-style: italic;' // gui controls
  298. ),
  299. 'COMMENTS' => array(
  300. 'MULTI' => 'font-style: italic; color: #669900;',
  301. 1 => 'font-style: italic; color: #009933;'
  302. ),
  303. 'ESCAPE_CHAR' => array(
  304. 0 => ''
  305. ),
  306. 'BRACKETS' => array(
  307. 0 => 'color: #00FF00; font-weight: bold;'
  308. ),
  309. 'STRINGS' => array(
  310. 0 => 'font-weight: bold; color: #008080;'
  311. ),
  312. 'NUMBERS' => array(
  313. 0 => 'color: #0000dd;'
  314. ),
  315. 'METHODS' => array(
  316. 1 => 'color: #0000FF; font-style: italic; font-weight: italic;'
  317. ),
  318. 'SYMBOLS' => array(
  319. 0 => 'color: #000000; font-weight: italic;'
  320. ),
  321. 'REGEXPS' => array(
  322. 0 => 'font-weight: italic; color: #A00A0;',
  323. 1 => 'color: #CC0000; font-style: italic;',
  324. 2 => 'color: #DD0000; font-style: italic;',
  325. 3 => 'color: #88FF88;'
  326. ),
  327. 'SCRIPT' => array(
  328. )
  329. ),
  330. 'OOLANG' => false,
  331. 'OBJECT_SPLITTERS' => array(
  332. 1 => '_'
  333. ),
  334. 'REGEXPS' => array(
  335. //Variables
  336. 0 => '%[a-zA-Z_][a-zA-Z0-9_]*%',
  337. //hotstrings
  338. 1 => '::[\w\d]+::',
  339. //labels
  340. 2 => '\w[\w\d]+:\s',
  341. //Built-in Variables
  342. 3 => '\bA_\w+\b(?![^<]*>)'
  343. ),
  344. 'URLS' => array(
  345. 1 => '',
  346. 2 => 'http://www.autohotkey.com/docs/Variables.htm#{FNAME}',
  347. 3 => 'http://www.autohotkey.com/docs/commands/{FNAME}.htm',
  348. 4 => 'http://www.autohotkey.com/docs/Functions.htm#BuiltIn',
  349. 5 => 'http://www.autohotkey.com/docs/commands/_{FNAME}.htm',
  350. 6 => '',
  351. 7 => 'http://www.autohotkey.com/docs/commands/Gui.htm#{FNAME}',
  352. 8 => 'http://www.autohotkey.com/docs/commands/GuiControls.htm#{FNAME}'
  353. ),
  354. 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
  355. 'SCRIPT_DELIMITERS' => array(
  356. ),
  357. 'HIGHLIGHT_STRICT_BLOCK' => array(
  358. 0 => true,
  359. 1 => true,
  360. 2 => true,
  361. 3 => true
  362. ),
  363. 'PARSER_CONTROL' => array(
  364. 'KEYWORDS' => array(
  365. 5 => array(
  366. 'DISALLOWED_BEFORE' => '(?<!\w)\#'
  367. )
  368. )
  369. )
  370. );
  371. ?>