/**
 * Code Syntax Highlighter for Perl.
 * Version 0.0.1
 * Copyright (C) 2008 Yanto Suryono
 * 
 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General 
 * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) 
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to 
 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 */

dp.sh.Brushes.Perl = function()
{
	var keywords = 
	'do if each elsif else sub while unless for foreach eq ne ' +
	'accept alarm atan2 bind binmode caller chdir chmod chop chown chroot close closedir connect cos crypt ' +
	'dbmclose dbmopen defined delete die dump eof eval exec exit exp fcntl fileno ' +
	'flock fork getc getlogin getpeername getpgrp getppid getpriority getxxxxx getsockname getsockopt gmtime ' +
	'goto grep hex index int ioctl join keys kill last length link listen local localtime log lstat ' +
	'm mkdir msgctl msgget msgsnd msgrcv next oct open opendir ord pack pipe pop print printf push q ' +
	'rand read readdir readlink recv redo rename require reset return reverse rewinddir rindex rmdir s ' +
	'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 sysread system syswrite tell telldir time times tr y truncate ' +
	'umask undef unlink unpack unshift utime values vec wait waitpid wantarray warn write';

	this.regexList = [
		{ regex: new RegExp('[^\\\$]#.*$', 'gm'),   			css: 'comment' },			// one line comments
		{ regex: new RegExp('^#.*$', 'gm'),   			        css: 'comment' },			// one line comments
		{ regex: dp.sh.RegexLib.DoubleQuotedString,			css: 'string' },			// strings
		{ regex: dp.sh.RegexLib.SingleQuotedString,			css: 'string' },			// strings
		{ regex: new RegExp('\\$[^\\s=\\[;\\(\\)]+', 'gm'),   		css: 'variable' },			// variables
		{ regex: new RegExp(this.GetKeywords(keywords), 'gm'),		css: 'keyword' }
		];

	this.CssClass = 'dp-perl';
	this.Style =	'.dp-perl .datatypes { color: #2E8B57; font-weight: bold; }';
}

dp.sh.Brushes.Perl.prototype	= new dp.sh.Highlighter();
dp.sh.Brushes.Perl.Aliases	= ['perl', 'pl'];
