/**
 *	AS3 Syntax
 *	@author Mark Walters
 *	http://www.digitalflipbook.com
 * 
 *	Custom mods by Og2t
 */
dp.sh.Brushes.AS3 = function()
{
	var definitions =	'class interface package';
	
	var keywords =	'Array Boolean Date decodeURI decodeURIComponent encodeURI encodeURIComponent escape ' +
					'int isFinite isNaN isXMLName Number Object parseFloat parseInt ' +
					'Event MouseEvent TimerEvent ' +
					'String trace uint unescape XML XMLList addEventListener removeEventListener dispatchEvent ' + 
					//'BitmapData Bitmap IBitmapDrawable ' + //global functions
					
					'Infinity -Infinity NaN undefined ' + //global constants
					
					'as delete instanceof is new typeof ' + //operators
					
					'break case catch continue default do each else finally for if in ' +
					'label return super switch throw try while with ' + //statements
					
					'dynamic final internal native override private protected public static ' + //attributes
					
					'...rest const extends function var get implements namespace set ' + //definitions
					
					'import include use ' + //directives
					
					'AS3 flash_proxy object_proxy ' + //namespaces
					
					'false null this true ' + //expressions
					
					'void Null'; //types
	
	this.regexList = [
		{ regex: dp.sh.RegexLib.SingleLineCComments,							css: 'comment' },			// one line comments
		{ regex: dp.sh.RegexLib.MultiLineCComments,								css: 'blockcomment' },		// multiline comments
		{ regex: dp.sh.RegexLib.DoubleQuotedString,								css: 'string' },			// double quoted strings
		{ regex: dp.sh.RegexLib.SingleQuotedString,								css: 'string' },			// single quoted strings
		{ regex: new RegExp('(\\,|\\-|\\+|\\*|\\=|\\||\\^)', 'gm'),				css: 'operator' },			// operator
		{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'),	css: 'number' },			// hex number
		{ regex: new RegExp('^\\s*#.*', 'gm'),									css: 'preprocessor' },		// preprocessor tags like #region and #endregion
		{ regex: new RegExp(this.GetKeywords(definitions), 'gm'),				css: 'definition' },		// definitions
		{ regex: new RegExp(this.GetKeywords(keywords), 'gm'),					css: 'keyword' },			// keywords
		//{ regex: new RegExp('\\b(function)\s+([a-zA-Z0-9_]\w*)\s*', 'gm'),		css: 'function' },			// function
		// { regex: new RegExp('\\b\\.([A-Za-z0-9_]+\w*)', 'gm'),					css: 'uppercase' },			// uppercase
		// { regex: new RegExp('\\b\\:([A-Za-z]+\w*)', 'g'),						css: 'keyword' },			// uppercase
		{ regex: new RegExp('(\\{|\\[|\\(|\\}|\\]|\\))', 'gm'),					css: 'bracket' }			// brackets
		];

	this.CssClass = 'dp-as';
	this.Style =	'.dp-highlighter ol li span { color: #ffffff; }' +
					'.dp-highlighter ol li.alt { background-color: #141728; }' +
					'.dp-highlighter ol li, .dp-highlighter .columns div { background-color: #141728; }' +
					'.dp-as .comment { color: #237763; }' +
					'.dp-as .blockcomment { color: #ffcc33; }' +
					'.dp-as .string { color: #ee8800; }' +
					'.dp-as .preprocessor { color: #cc0000; }' +
					'.dp-as .definition { color: #ffcc33; font-weight: normal; }' +
					'.dp-as .keyword { color: #00ccff; }' +
					'.dp-as .uppercase { color: #bbccee; }' +
					'.dp-as .bracket { color: #ffcc00; }' +
					'.dp-as .number { color: #ff6644; }' +
					'.dp-as .operator { color: #6699cc; }' +
					'.dp-as .function { color: #00ff00; }'
}

dp.sh.Brushes.AS3.prototype	= new dp.sh.Highlighter();
dp.sh.Brushes.AS3.Aliases	= ['as', 'actionscript', 'ActionScript', 'as3', 'AS3'];
