'*******************************************************************************
' EverEdit Syntax File
' Language:    Google Go
' Maintainer:  www.everedit.net  Morler
' History:
'   2013/04/04 First Version
'   2013/05/14 Updated
'	2015/10/15 Added outline support (Thanks ldbug)
'*******************************************************************************
Include( ".\const.mac" )

Set go=CreateParser()

Set rComment1=go.CreateRegion(COLOR_COMMENT1, "+//+", "$", False )
Set rComment2=go.CreateRegion(COLOR_COMMENT2, "+/*+", "+*/+", False )

Set rString1=go.CreateStringRegion( COLOR_STRING1, "'", "\", False )
Set rString2=go.CreateStringRegion( COLOR_STRING2, """", "\", False )

Set rString3=go.CreateStringRegion( COLOR_STRING1, "", "`", False )

'Reserved words
Set iWord1=go.CreateWord(COLOR_WORD1, "break case chan const continue default defer delete else fallthrough for func go goto if import interface map package range return select struct switch type var", True)

'Functions
Set iWord2=go.CreateWord(COLOR_WORD2, "append cap close closed complex copy imag len make new panic print println real recover main", True)

'Types
Set iWord3=go.CreateWord(COLOR_WORD3, "bool byte complex complex64 complex128 float float32 float64 int int8 int16 int32 int64 string uint uint8 uint16 uint32 uint64 uintptr _", True)

'Constants & Zero value
Set iWord4=go.CreateWord(COLOR_OPERATOR, "true false iota nil", True)

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


go.AddRegion( rComment1 )
go.AddRegion( rComment2 )
go.AddRegion( rString1 )
go.AddRegion( rString2 )
go.AddRegion( rString3 )
go.AddWord( iWord1 )
go.AddWord( iWord2 )
go.AddWord( iWord3 )
go.AddWord( iWord4 )
go.AddItem( iOperator )

'number
go.AddItem( go.CreateItem(COLOR_NUMBER, "(?<!\w)[+-]?([1-9][0-9]*\.?[0-9]*[e]?[-]?[0-9]*\.?[0-9]*|0([0-7]+|x[0-9A-Fa-f]+)|(?<!-)0(?!\.)|0\.[0-9]*[e]?[-]?[1-9][0-9]*)(?!\w)", False) )

go.IndentText "\{\s*$", False,  "}\s*$", False
go.FoldText "\{", False, "\}", False
go.SetPairs( "[]''""""{}()" )
go.CommentLine( "//" )
go.CommentBlock "/*", "*/"

