'*******************************************************************************
' EverEdit Syntax File
' Language:    AutoHotKey_L v1.1.09.04
' Maintainer:  www.everedit.net Morler  
' History:
'   2013/04/06 First Version
'	2013/05/08 Support Autohotkey_L syntax
'*******************************************************************************
Include( ".\const.mac" )

Set ahk_l=CreateParser()

Set rComment1=ahk_l.CreateRegion(COLOR_COMMENT1, "(?<!`);", "$", False )
Set rComment2=ahk_l.CreateRegion(COLOR_COMMENT1, "+/*+", "+*/+", False )

Set rString1=ahk_l.CreateStringRegion( COLOR_STRING1, "'", "`", False )
Set rString2=ahk_l.CreateStringRegion( COLOR_STRING2, """", "`", False )

'function
ahk_l.AddItem( ahk_l.CreateItem(COLOR_FUNCTION, "[A-Za-z_][A-Za-z0-9_]*(?=\()", False) )

'Flow of control
Set iWord1=ahk_l.CreateWord(COLOR_WORD1, "If IfEqual IfExist IfGreater IfGreaterOrEqual IfInString IfLess IfLessOrEqual IfMsgBox IfNotEqual IfNotExist IfNotInString IfWinActive IfWinExist IfWinNotActive IfWinNotExist Break Continue Else Exit ExitApp Gosub Goto Loop OnExit Pause Repeat Return SetTimer Sleep Suspend Static Global Local ByRef While Until For Class Try Catch Throw", False)
iWord1.AutoCase=True 

'Keywords
Set iWord2=ahk_l.CreateWord(COLOR_WORD2, "LTrim RTrim Join Ahk_Id Ahk_Pid Ahk_Class Ahk_Group Ahk_Exe ProcessName ProcessPath MinMax ControlList StatusCD FileSystem SetLabel AlwaysOnTop MainWindow NoMainWindow UseErrorLevel AltSubmit HScroll VScroll ImageList WantCtrlA WantF2 Vis VisFirst WantReturn BackgroundTrans MinimizeBox MaximizeBox SysMenu ToolWindow ExStyle Check3 CheckEdGray ReadOnly NoTab LastFound LastFoundExist AltTab ShiftAltTab AltTabMenu AltTabAndMenu AltTabMenuDismiss ControlListHWND Hwnd DeRef Pow BitNot BitAnd BitOr BitXor BitShiftLeft BitShiftRight SendAndMouse MouseMove MouseMoveOff Hkey_Local_Machine Hkey_Users Hkey_Current_User Hkey_Classes_Root Hkey_Current_Config Hklm Hku Hkcu Hkcr Hkcc Reg_Sz Reg_Expand_Sz Reg_Multi_Sz Reg_Dword Reg_Qword Reg_Binary Reg_Link Reg_Resource_List Reg_Full_Resource_Descriptor Reg_Resource_Requirements_List Reg_Dword_Big_Endian Regex Pixel Mouse Screen Relative RGB Low BelowNormal Normal AboveNormal High RealTime Between Contains In Is Integer Float Number Digit XDigit IntegerFast FloatFast Alpha Upper Lower AlNum Time Date Not Or And TopMost Top Bottom TransParent TransColor ReDraw Region Id IdLast Count List Capacity Eject Lock UnLock Label Serial Type Status Seconds Minutes Hours Days Read Parse LogOff Close Error Single ShutDown Menu Exit Reload Tray Add ReName Check UnCheck ToggleCheck Enable Disable ToggleEnable Default NoDefault Standard NoStandard Color Delete DeleteAll Icon NoIcon Tip Click Show Edit Progress Hotkey Text Picture Pic GroupBox Button Link CheckBox Radio DropdownList Ddl ComboBox StatusBar TreeView ListBox ListView DateTime MonthCal UpDown Slider Tab Tab2 ActiveX IconSmall Tile Report SortDesc NoSort NoSorthDr Grid Hdr AutoSize Range Xm Ym Ys Xs Xp Yp Font Resize Owner Submit NoHide Minimize Maximize Restore NoActivate Na Cancel Destroy Center Margin OwnDialogs GuiEscape GuiClose GuiSize GuiContextMenu GuiDropFiles TabsTop Section Wrap Border Top Bottom Buttons Expand First Lines Number UpperCase LowerCase Limit Password Multi Group Background Bold Italic Strike UnderLine Norm Theme Caption Delimiter Flash Style Checked Password Hidden Left Right Center Section Move Focus Hide Choose ChooseString Text Pos Enabled Disabled Visible NoTimers Interrupt Priority WaitClose Unicode ToCodepage FromCodepageYes No Ok Cancel Abort Retry Ignore Force On Off All Send WantTab MonitorCount MonitorPrimary MonitorName MonitorWorkArea Pid This Base Extends __Get __Set __Call __Delete __New New UseUnsetLocal UseUnsetGlobal UseEnv LocalSameAsGlobal", False, "_")
iWord2.AutoCase=True

'Commands
Set iWord3=ahk_l.CreateWord(COLOR_WORD3, "AutoTrim BlockInput ClipWait Control ControlClick ControlFocus ControlGet ControlGetFocus ControlGetPos ControlGetText ControlMove ControlSend ControlSenDraw ControlSetText CoordMode Critical DetectHiddenText DetectHiddenWindows Drive DriveGet DriveSpaceFree Edit EndRepeat EnvAdd EnvDiv EnvGet EnvMult EnvSet EnvSub EnvUpdate FileAppend FileCopy FileCopyDir FileCreateDir FileCreateShortcut FileDelete FileGetAttrib FileGetShortcut FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileMoveDir FileRead FileReadLine FileRecycle FileRecycleEmpty FileRemoveDir FileSelectFile FileSelectFolder FileSetAttrib FileSetTime FormatTime GetKeyState GroupActivate GroupAdd GroupClose GroupDeactivate Gui GuiControl GuiControlGet HideAutoitWin Hotkey ImageSearch IniDelete IniRead IniWrite Input InputBox KeyHistory KeyWait ListHotkeys ListLines ListVars Menu MouseClick MouseClickDrag MouseGetPos MouseMove MsgBox OutputDebug PixelGetColor PixelSearch PostMessage Process Progress Random RegDelete RegRead RegWrite Reload Run RunAs RunWait Send SendEvent SendInput SendLevel SendMessage SendMode SendPlay SendRaw SetBatchLines SetCapslockState SetControlDelay SetDefaultMouseSpeed SetEnv SetFormat SetKeyDelay SetMouseDelay SetNumlockState SetScrolllockState SetStorecapsLockMode SetTitleMatchMode SetWinDelay SetWorkingDir ShutDown Sort SoundBeep SoundGet SoundGetWaveVolume SoundPlay SoundSet SoundSetWaveVolume SplashImage SplashTextOff SplashTextOn SplitPath StatusBarGetText StatusBarWait StringCaseSense StringGetPos StringLeft StringLen StringLower StringMid StringReplace StringRight StringSplit StringTrimLeft StringTrimRight StringUpper SysGet Thread ToolTip Transform TrayTip UrlDownloadToFile WinActivate WinActivateBottom WinClose WinGet WinGetActiveStats WinGetActiveTitle WinGetClass WinGetPos WinGetText WinGetTitle WinHide WinKill WinMaximize WinMenuSelectItem WinMinimize WinMinimizeAll WinMinimizeAllUndo WinMove WinRestore WinSet WinSetTitle WinShow WinWait WinWaitActive WinWaitClose WinWaitNotActive FileEncoding SetRegView", False)
iWord3.AutoCase=True

'Functions
Set iWord4=ahk_l.CreateWord(COLOR_WORD4, "Abs Acos Asc Asin Atan Ceil Chr Cos DllCall Exp FileExist Floor GetKeyState NumGet NumPut RegisterCallback Il_Add Il_Create Il_Destroy InStr IsLabel IsFunc Ln Log Lv_Add Lv_Delete Lv_DeleteCol Lv_GetCount Lv_GetNext Lv_GetText Lv_Insert Lv_InsertCol Lv_Modify Lv_ModifyCol Lv_SetImageList Mod OnMessage Round RegexMatch RegexReplace Sb_SetIcon Sb_SetParts Sb_SetText Sin Sqrt StrLen SubStr Tan Tv_Add Tv_Delete Tv_GetChild Tv_GetCount Tv_GetNext Tv_Get Tv_GetParent Tv_GetPrev Tv_GetSelection Tv_GetText Tv_Modify Tv_SetImageList VarSetCapacity WinActive WinExist Trim LTrim RTrim FileOpen StrGet StrPut Object Array IsObject ObjInsert ObjRemove ObjMinIndex ObjMaxIndex ObjSetCapacity ObjGetCapacity ObjGetAddress ObjNewEnum ObjAddRef ObjRelease ObjHasKey ObjClone _NewEnum ComobjCreate ComobjGet ComobjConnect ComobjError ComobjActive ComobjEnWrap ComobjUnWrap ComobjParameter ComobjMissing ComobjType ComobjValue ComobjArray ComobjQuery ComobjFlags Func GetKeyName GetKeyVk GetKeySc IsByRef Exception", False, "_")
iWord4.AutoCase=True

'Directives
Set iWord5=ahk_l.CreateWord(COLOR_WORD3, "#AllowSameLineComments #ClipBoardTimeout #CommentFlag #ErrorStdout #EscapeChar #HotkeyInterval #HotkeyModifierTimeout #HotString #If #IfTimeout #IfWinActive #IfWinExist #Include #IncludeAgain #InputLevel #InstallKeybdHook #InstallMouseHook #KeyHistory #LTrim #MaxHotkeySperInterval #MaxMem #MaxThreads #MaxThreadsBuffer #MaxThreadsPerHotkey #MenuMaskKey #NoEnv #NoTrayIcon #Persistent #SingleInstance #UseHook #Warn #WinActivateForce #IfWinNotActive #IfWinNotExist", False, "#")
iWord5.AutoCase=True

'Keys and buttons
Set iWord6=ahk_l.CreateWord(COLOR_VAR, "Shift LShift RShift Alt LAlt RAlt Control LControl RControl Ctrl LCtrl RCtrl LWin RWin AppsKey AltDown AltUp Shiftdown Shiftup Ctrldown Ctrlup Lwindown Lwinup Rwindown Rwinup Lbutton Rbutton Mbutton Wheelup Wheeldown XButton1 XButton2 Joy1 Joy2 Joy3 Joy4 Joy5 Joy6 Joy7 Joy8 Joy9 Joy10 Joy11 Joy12 Joy13 Joy14 Joy15 Joy16 Joy17 Joy18 Joy19 Joy20 Joy21 Joy22 Joy23 Joy24 Joy25 Joy26 Joy27 Joy28 Joy29 Joy30 Joy31 Joy32 JoyX JoyY JoyZ JoyR JoyU JoyV JoyPov JoyName JoyButtons JoyAxes JoyInfo Space Tab Enter Escape Esc BackSpace Bs Delete Del Insert Ins PgUp PgDn Home End Up Down Left Right PrintScreen CtrlBreak Pause ScrollLock CapsLock NumLock NumPad0 NumPad1 NumPad2 NumPad3 NumPad4 NumPad5 NumPad6 NumPad7 NumPad8 NumPad9 NumPadMult NumPadAdd NumPadSub NumPadDiv NumPadDot NumPadDel NumPadIns NumPadClear NumPadUp NumPadDown NumPadLeft NumPadRight NumPadHome NumPadEnd NumPadPgUp NumPadPgDn NumPadEnter F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 Browser_Back Browser_Forward Browser_Refresh Browser_Stop Browser_Search Browser_Favorites Browser_Home Volume_Mute Volume_Down Volume_Up Media_Next Media_Prev Media_Stop Media_Play_Pause Launch_Mail Launch_Media Launch_App1 Launch_App2 Blind Click Raw WheelLeft WheelRight", False, "_")
iWord6.AutoCase=True

'Variables
Set iWord7=ahk_l.CreateWord(COLOR_VAR, "A_Ahkpath A_Ahkversion A_Appdata A_Appdatacommon A_Autotrim A_Batchlines A_Caretx A_Carety A_Computername A_Controldelay A_Cursor A_Dd A_Ddd A_Dddd A_Defaultmousespeed A_Desktop A_DesktopCommon A_DetectHiddenText A_DetectHiddenWindows A_EndChar A_EventInfo A_ExitReason A_FormatFloat A_FormatInteger A_Gui A_GuiEvent A_GuiControl A_GuiControlEvent A_GuiHeight A_GuiWidth A_GuiX A_GuiY A_Hour A_IconFile A_IconHidden A_IconNumber A_IconTip A_Index A_IpAddress1 A_IpAddress2 A_IpAddress3 A_IpAddress4 A_IsAdmin A_IsCompiled A_IsSuspended A_KeyDelay A_Language A_LastError A_LineFile A_LineNumber A_LoopField A_LoopFileAttrib A_LoopFileDir A_LoopFileExt A_LoopFileFullPath A_LoopFileLongPath A_LoopFileName A_LoopFileShortName A_LoopFileShortPath A_LoopFileSize A_LoopFileSizeKB A_LoopFileSizeMB A_LoopFileTimeAccessed A_LoopFileTimeCreated A_LoopFileTimeModified A_LoopReadLine A_LoopRegKey A_LoopRegName A_LoopRegSubKey A_LoopRegTimeModified A_LoopRegType A_Mday A_Min A_mm A_mmm A_mmmm A_Mon A_MouseDelay A_msec A_MyDocuments A_Now A_NowUTC A_NumBatchLines A_OsType A_OsVersion A_PriorHotkey A_ProgramFiles A_Programs A_ProgramsCommon A_ScreenHeight A_ScreenWidth A_ScriptDir A_ScriptFullPath A_ScriptName A_sec A_Space A_StartMenu A_StartMenuCommon A_StartUp A_StartUpCommon A_StringCaseSense A_Tab A_Temp A_ThisHotkey A_ThisMenu A_ThisMenuItem A_ThisMenuItemPos A_TickCount A_TimeIdle A_TimeIdlePhysical A_TimeSincePriorHotkey A_TimeSinceThisHotkey A_TitleMatchMode A_TitleMatchModeSpeed A_UserName A_WDay A_WinDelay A_WinDir A_WorkingDir A_YDay A_Year A_YWeek A_yyyy Clipboard ClipboardAll Comspec ErrorLevel ProgramFiles True False A_ThisFunc A_ThisLabel A_IsPaused A_IsCritical A_IsUnicode A_PtrSize A_ScriptHWND A_PriorKey A_Is64BitOs A_RegView", False, "_")
iWord7.AutoCase=True

Set iOperator=ahk_l.CreateItem(COLOR_OPERATOR, "[\{\}\(\)\+\-\*\\=%&\^!~\|<>?\.,:;`@\$\[\]]",False )


ahk_l.AddRegion( rComment1 )
ahk_l.AddRegion( rComment2 )
ahk_l.AddRegion( rString1 )
ahk_l.AddRegion( rString2 )

ahk_l.AddWord( iWord1 )
ahk_l.AddWord( iWord2 )
ahk_l.AddWord( iWord3 )
ahk_l.AddWord( iWord4 )
ahk_l.AddWord( iWord5 )
ahk_l.AddWord( iWord6 )
ahk_l.AddWord( iWord7 )

ahk_l.AddItem( iOperator )

'number
ahk_l.AddItem( ahk_l.CreateItem(COLOR_NUMBER, "(?<!\w)[+-]?([0-9_]+\.?[0-9_]*|0x[A-Fa-f0-9]+)(?!\w)", False) )

Call ahk_l.IndentText( "\{\s*$", False )
Call ahk_l.UnindentText( "\}$", False )

Call ahk_l.FoldText( "\{", False )
Call ahk_l.UnfoldText( "\}", False )

ahk_l.SetPairs( "[]''""""{}()" )

ahk_l.CommentLine( ";" )
ahk_l.CommentBlock "/*", "*/"
