Clement Escoffier | 580d190 | 2009-07-21 12:06:46 +0000 | [diff] [blame] | 1 | dp.sh.Brushes.Java = function() |
| 2 | { |
| 3 | var keywords = 'abstract assert boolean break byte case catch char class const' + |
| 4 | 'continue default do double else enum extends false final finally float' + |
| 5 | 'for goto if implements import instanceof inst interface log native' + |
| 6 | 'new null package private protected public return short static strictfp super' + |
| 7 | 'switch synchronized this throw throws transient true try void volatile while'; |
| 8 | |
| 9 | this.regexList = [ |
| 10 | { regex: new RegExp('//.*$', 'gm'), css: 'comment' }, // one line comments |
| 11 | { regex: new RegExp('/\\*[\\s\\S]*?\\*/', 'g'), css: 'comment' }, // multiline comments |
| 12 | { regex: new RegExp('"(?:[^"\n]|[\"])*?"', 'g'), css: 'string' }, // double quoted strings |
| 13 | { regex: new RegExp("'(?:[^'\n]|[\'])*?'", 'g'), css: 'string' }, // single quoted strings |
| 14 | { regex: new RegExp('^\\s*@.*', 'gm'), css: 'preprocessor' }, // preprocessor tags like @see |
| 15 | { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keywords |
| 16 | ]; |
| 17 | |
| 18 | this.CssClass = 'dp-c'; |
| 19 | } |
| 20 | |
| 21 | dp.sh.Brushes.Java.prototype = new dp.sh.Highlighter(); |
| 22 | dp.sh.Brushes.Java.Aliases = ['java']; |