/*
 * Javascript Brush for Delphi Prism's Oxygene compiler
 * http://www.remobjects.com
 * http://www.codegear.com
*/

dp.sh.Brushes.Oxygene=function()
{
	var datatypes=
	'Byte Boolean Char String WideChar WideString ShortInt Word SmallInt Integer Cardinal '+
	'LongWord Int64 UInt64 Single Double NativeInt NativeUnit Extended Real Pointer';
	
	var keywords=
	'and as assembly begin break case class const constructor continue '+
	'delegate div do downto else end ensure event except exit false finalizer finally '+ 
	'for forward function future if implementation in inherited interface invariants is '+
	'locking loop method mod module namespace new nil not nullable of old on operator '+
	'or out parllel private procedure property protected public raise record repeat require '+
	'result self set shl shr then to true try type unit until uses using var where while with '+
	'xor yield abstract add array of async default each empty enum external final finalizer '+
	'flags global has implements implies index inline iterator locked matching nested notify '+
	'override params partial pinned read readonly reintroduce remove sealed sequence of static '+
	'step unsafe virtual where write asc desc distinct equals from group by into join on '+
	'reverse select skip take';

	this.regexList=[
		{ regex: new RegExp('\\(\\*[\\s\\S]*?\\*\\)','gm'),css:'comment' },
		{ regex: new RegExp('{(?!\\$)[\\s\\S]*?}','gm'),css:'comment'},
		{ regex: dp.sh.RegexLib.SingleLineCComments,css:'comment'},
		{ regex: dp.sh.RegexLib.SingleQuotedString,css:'string'},
		{ regex: new RegExp('\\{\\$[a-zA-Z]+ .+\\}','g'),css:'directive'},
		{ regex: new RegExp('\\b[\\d\\.]+\\b','g'),css:'number'},
		{ regex: new RegExp('\\$[a-zA-Z0-9]+\\b','g'),css:'number'},
		{ regex: new RegExp(this.GetKeywords(datatypes), 'gm'),css: 'datatypes'},
		{ regex: new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}
	];

	this.CssClass='dp-oxygene';
	this.Style='.dp-oxygene .number { color: blue; }'+
				'.dp-oxygene .directive { color: #008284; }'+
				'.dp-oxygene .vars { color: #000; }'+
				'.dp-oxygene .datatypes { color: #2E8B57; }';
}
dp.sh.Brushes.Oxygene.prototype=new dp.sh.Highlighter();
dp.sh.Brushes.Oxygene.Aliases=['oxygene', 'prism', 'delphi-prism'];
