1;(function () 2{ 3 // CommonJS 4 SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 5 6 function Brush () 7 { 8 9 var inits = 'class interface package macro enum typedef extends implements dynamic in for if while else do try switch case catch'; 10 11 var keywords = 'return break continue new throw cast using import function public private inline static untyped callback true false null Int Float String Void Std Bool Dynamic Array Vector'; 12 13 this.regexList = [ 14 { regex:SyntaxHighlighter.regexLib.singleLineCComments , css:'comments' }, 15 // one line comments 16 { regex:SyntaxHighlighter.regexLib.multiLineCComments , css:'comments' }, 17 // multiline comments 18 { regex:SyntaxHighlighter.regexLib.doubleQuotedString , css:'string' }, 19 // double quoted strings 20 { regex:SyntaxHighlighter.regexLib.singleQuotedString , css:'string' }, 21 // single quoted strings 22 { regex:/\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi , css:'value' }, 23 // numbers 24 { regex:new RegExp ( this.getKeywords ( inits ) , 'gm' ) , css:'color3' }, 25 // initializations 26 { regex:new RegExp ( this.getKeywords ( keywords ) , 'gm' ) , css:'keyword' }, 27 // keywords 28 { regex:new RegExp ( 'var' , 'gm' ) , css:'variable' }, 29 // variable 30 { regex:new RegExp ( 'trace' , 'gm' ) , css:'color1' }, 31 //compiler conditionals 32 { regex:new RegExp ( '#if' , 'gm' ) , css:'comments' }, 33 { regex:new RegExp ( '#elseif' , 'gm' ) , css:'comments' }, 34 { regex:new RegExp ( '#end' , 'gm' ) , css:'comments' }, 35 { regex:new RegExp ( '#error' , 'gm' ) , css:'comments' } 36 ]; 37 38 //standard compiler conditionals flags 39 var flags = [ 40 "debug", "error", "cpp", "js", "neko", "php", "flash", "flash8", "flash9", "flash10", "flash10", "mobile", "desktop", "web", "ios", "android", "iphone" 41 ]; 42 43 //append the flags to the array with a ! operator 44 var i; 45 var length = flags.length; 46 for ( i = 0 ; i <= length - 1 ; i ++ ) 47 { 48 this.regexList.push ( {regex:new RegExp ( flags[i] , 'gm' ) , css:'comments'} ); 49 this.regexList.push ( {regex:new RegExp ( '!' + flags[i] , 'gm' ) , css:'comments'} ); 50 } 51 52 this.forHtmlScript ( SyntaxHighlighter.regexLib.scriptScriptTags ); 53 } 54 55 ; 56 57 Brush.prototype = new SyntaxHighlighter.Highlighter (); 58 Brush.aliases = ['haxe', 'hx']; 59 60 SyntaxHighlighter.brushes.Haxe = Brush; 61 62 // CommonJS 63 typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 64}) (); 65