'*******************************************************************************
' EverEdit Syntax File
' Language:    Gui4Cli v19.38
' Maintainer:  Morler	<morler@163.com> 
' History:
'   2012/10/15 First Version
'   2013/05/14 New syntax from Editra
'*******************************************************************************
Include( ".\const.mac" )

Set gui4cli=CreateParser()

Set LineComment=gui4cli.CreateRegion(COLOR_COMMENT1, "//(?!@)", "$", True )
Set BlockComment=gui4cli.CreateRegion(COLOR_COMMENT1, "+/*+", "+*/+", True )
Set rString1=gui4cli.CreateStringRegion( COLOR_STRING2, """", "\\", False )
Set rString2=gui4cli.CreateStringRegion( COLOR_STRING1, "'", "\\", False )

'Numbers
Set gui4cli_words4=gui4cli.CreateItem( COLOR_NUMBER, "(?<!\w)[+-]?[0-9_]+\.?[0-9_]*(?!\w)", False )

'Operators
gui4cli.AddItem( gui4cli.CreateItem(COLOR_OPERATOR, "[\{\}\(\)\+\-\*\\=%&\^!~\|<>?\.,:;\/\[\]\$]",False ) )


'Reserved words
Set Word1=gui4cli.CreateWord( COLOR_WORD2, "G4C 3State #AANSI #FixANSI #FixOEM #FIXSYS #GUI #Separator #SYS #This Abri Active All AltStart AppData AppWin Arrange Arrow Ascend Attr Auto Back BC BitBucket BL Bold Border Bottom BR Buffers Busy Button Buttons Caption Center Char Check Child Clean Clear Closed Color Comm Common.AltStart Common.Desktop Common.Favorites Common.Menu Common.Programs Common.Startup Cookies Cross CurDir Current Cursor Data Date Day Decorative Def1 Def2 Def3 Def4 Descend Desktop Dialog Dir Disable Disabled Disk Disks DLbegin DLcomplete DlgFrame Double Drag Drop DropList Dttm Edit Editor Effects Ellipse Emboss End Enable EndGUI English Enter Error Exists Explore Ext Fail Favorites Fields File Files Find First Fixed FixWidth Flat FNumber Focus Foreground Format Forward Free Front Full FullPath GcDir GcExe GcName Greek Grid GuiPath Heavy Height Help Hex Hidden Hide Hist History Home Horizontal Hot Hour IBeam ICLeft Index Info Int Invoke Italic Item Julian Justify Large Last LB LBLeft LC Length Light Line Lines Lmb Lmdc Load Loaded Lower Lt Max Maxi MaxBox Maximize Medium Menu MinBox Mini Minimize Minute Mmb Modern Month Move Msec Multi Name NavComplete NetCache NetHood New NewMenu Next No NoAdjust NoBorder NoError NoExt NoFace NoFiles NoFocus NoFolders None Noopen NoRefresh NoReset Normal North NoSize NoVector NoVrt Now NowRap Number Octal Off OK OkCancel On OneClick OneLine Open OverLap Owned Parent Path PcPath Period Personal Polygon Prefs Prev Previous Print Printers Programs Prop Property Pulse Question Quote Ragged Raised Rb Rc Rec Recent Refresh Remove RemSize ReName Report ReSize Ret Retry Right Rmb Roman Root Rounded Routine Rows Rt Save Scalable Screen Script Scroll Search Second Select Selected SelScript SendTo Sensitive Sentence Shell Show Silent Simple Single Size Small Smooth Solid Sort Start StartGUI Startup Stat0 Static Status Std Stop Strech Strike SubChild SubSub Sunk Sunken Swiss SysMenu Tab Tabs Tc Templates Text Thin Time Title Tl Toggle Tool Top TopMost Total Tr Trans Transparent TtOnly Type UnderLine UnFormat UnJulian UnQuote UnSelect UnSelected Upper User Valid Variable VCenter Version Vertical View Wait Warn Wheel Width Winedge Word Year Yes YesNo YesToAll YnCancel", False, "#.")
Word1.AutoCase=True

'Events
Set Word2=gui4cli.CreateWord( COLOR_WORD3, "xArea xBrowser xButton xCheckBox xCombo xEdBox xGroupBox xIcon xImage xListView xMenu xPan xProgress xRadio xReBar xSpliter xStatus xTab xTextBox xTextIn xToolBar xTrackBar xTreeView xUpDown xAfter xAttr xBefore xEnum xHotkey xNotify xOnActive xOnBrowser xOnClick xOnClose xOnDoubleClick xOnDrop xOnFail xOnHelp xOnInactive xOnkey xOnLmb xOnLoad xOnLvClick xOnLvDir xOnMark xOnMmb xOnOpen xOnQuit xOnReload xOnReturn xOnRmb xOnTextIn xOnWheelDown xOnWheelUp xPipe xReqFile xRoutine xTBarIcon xTimer xOnkey", False )
Word2.AutoCase=True

'Attributes
Set Word3=gui4cli.CreateWord( COLOR_VAR, "Background Buddy Buffers Colors ColSave Data DbgStep DbgVars Debug DeepTrans Editor EndGUI Escape Fail Filter Font Frame Grid Help Icon Id IxIcon Key Like Local LvColumn MaxDate MaxSize MaxTrans MciNotify MciSignal Menu MinDate MinSize Next Output Page Parent Path Prefs RbStyle ReSize Say Shape Show StartGUI Style Tab Title Translate Variables", False )
Word3.AutoCase=True

'Controls
Set Word4=gui4cli.CreateWord( COLOR_WORD1, "And AndIfExists Break Call Case DoCase Else ElseIf ElseIfExists EndCase EndFor EndIf EndWhile For Go GoSub Goto If IfExists Label Or OrIfExists Quit Return Stop While", False )
Word4.AutoCase=True

'Commands
Set Word5=gui4cli.CreateWord( COLOR_FUNCTION, "Add Address AddUnique Append AppVar Assign Auto Branch Browser CD Close Combo Command Copy Create CreateLink Cut CutVar DbSum DckDebug DdExec DdPut DdUse Dec Del Delay Delete DelVar EdBox EmptyBin Enum Exit Extract Flash FreeFont FreeIcon GetClip GetColor GetFont GoSub GUI GuiClose GuiLoad GuiOpen GuiQuit GuiRename GuiWindow HtmlHelp Image Inc JoinFile Launch ListView LoadFont loadIcon Lv LvAction LvClip LvRep LvSearch LvSwitch MakeDir Mci Move MsgBox NewFile ParseVar PopMenu QuickMenu Quit Random RegCreate RegDelete RegGet RegSet ReName RepVar ReqFile Run Say SearchVar Send Set SetAttr SetClip SetEvent SetGadValues SetIcon SetPointer SetVar SetWinAttr SetWinTitle Shell Status System TerminateProc TextFile TreeView Tv Update UpDown Use Wait WinAttr Window", False )
Word5.AutoCase=True

'Gui4CliDoc Syntax
Set gui4clidoc=gui4cli.CreateItem(COLOR_COMMENT1, "^(//)(@(author|desc|date|name|version|syntax|param|return))\t*([^\t]+)$", False)
gui4clidoc.Capture 2, COLOR_WORD1
gui4clidoc.Capture 4, COLOR_WORD2

gui4cli.AddRegion( LineComment )
gui4cli.AddRegion( BlockComment )
gui4cli.AddRegion( rString1 )
gui4cli.AddRegion( rString2 )
gui4cli.AddItem(gui4cli_words4)
gui4cli.AddWord( Word1 )
gui4cli.AddWord( Word2 )
gui4cli.AddWord( Word3 )
gui4cli.AddWord( Word4 )
gui4cli.AddWord( Word5 )
gui4cli.AddItem(gui4clidoc)

'Call gui4cli.IndentText( "(Then|Do)$|(?<!(End\s+))(Sub|Function)", False )
'Call gui4cli.UnindentText( "\b(End\s+(Sub|Function|If)|Next|Wend)$", False )

Call gui4cli.SetPairs( "[]{}()""""" )

Call gui4cli.CommentLine("//")