'*******************************************************************************
' EverEdit Syntax File
' Language: Perl
' Maintainer: www.everedit.net
' History:
'   2012/09/22 First Version
'*******************************************************************************

Include(".\const.mac")

Set perl=CreateParser()

'comment
Set rLineComment=perl.CreateRegion( COLOR_COMMENT1, "+#+", "$", True )
Set rBlockComment=perl.CreateRegion( COLOR_COMMENT1, "^=\w+.*$", "^=cut\s*$", True )
perl.AddRegion( rLineComment )
perl.AddRegion( rBlockComment )

Set rDATA=perl.CreateRegion( COLOR_COMMENT1, "^__(DATA|END)__", "\", True )
perl.AddRegion( rDATA )

'string
Set rString2=perl.CreateStringRegion( COLOR_STRING2, """", "\", False )
Set rString1=perl.CreateStringRegion( COLOR_STRING1, "'", "\", False )
perl.AddRegion( rString2 )
perl.AddRegion( rString1 )


'Reserved words
perl.AddWord( perl.CreateWord(COLOR_WORD1, "continue do else elsif for foreach given goto if last local lock map my next our package redo require return state sub unless until use while STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG TRUE FALSE __FILE__ __LINE__ __PACKAGE__ __END__ __DATA__ lt gt le ge eq ne cmp x not and or xor q qq qx qw", True, "_" ) )

'Built-in functions
perl.AddWord( perl.CreateWord(COLOR_WORD2, "abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir connect cos crypt dbmclose dbmopen defined delete die dump each eof eval exec exists exit exp fcntl fileno flock fork format formline getc getlogin getpeername getpgrp getppid getpriority getpwnam getgrnam gethostbyname getnetbyname getprotobyname getpwuid getgrgid getservbyname gethostbyaddr getnetbyaddr getprotobynumber getservbyport getpwent getgrent gethostent getnetent getprotoent getservent setpwent setgrent sethostent setnetent setprotoent setservent endpwent endgrent endhostent endnetent endprotoent endservent getsockname getsockopt glob gmtime grep hex import index int ioctl join keys kill lc lcfirst length link listen localtime log lstat mkdir msgctl msgget msgsnd msgrcv no oct open opendir ord pack pipe pop pos print printf prototype push quotemeta rand read readdir readlink recv ref rename reset reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setpgrp setpriority setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times truncate uc ucfirst umask undef unlink unpack untie unshift utime values vec wait waitpid wantarray warn write", True ) )

'number
perl.AddItem( perl.CreateItem(COLOR_NUMBER, "\b\d+\b", False) )


perl.AddItem( perl.CreateItem(COLOR_VAR, "\$\w+", False) )
perl.AddItem( perl.CreateItem(COLOR_WORD3, "@\w+", False) )
perl.AddItem( perl.CreateItem(COLOR_WORD4, "%\w+", False) )

perl.SetPairs "[]{}()""""''"
perl.CommentLine "#"

perl.AddSnippet "perl.snippet"
perl.AddCallTip "perl.ecp", True
