| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
;(function() |
| 18 |
{ |
| 19 |
|
| 20 |
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; |
| 21 |
|
| 22 |
function Brush() |
| 23 |
{ |
| 24 |
var keywords = 'abstract assert boolean break byte case catch char class const ' + |
| 25 |
'continue default do double else enum extends ' + |
| 26 |
'false final finally float for goto if implements import ' + |
| 27 |
'instanceof int interface long native new null ' + |
| 28 |
'package private protected public return ' + |
| 29 |
'short static strictfp super switch synchronized this throw throws true ' + |
| 30 |
'transient try void volatile while'; |
| 31 |
|
| 32 |
this.regexList = [ |
| 33 |
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, |
| 34 |
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, |
| 35 |
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, |
| 36 |
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, |
| 37 |
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, |
| 38 |
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, |
| 39 |
{ regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, |
| 40 |
{ regex: /\@interface\b/g, css: 'color2' }, |
| 41 |
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } |
| 42 |
]; |
| 43 |
|
| 44 |
this.forHtmlScript({ |
| 45 |
left : /(<|<)%[@!=]?/g, |
| 46 |
right : /%(>|>)/g |
| 47 |
}); |
| 48 |
}; |
| 49 |
|
| 50 |
Brush.prototype = new SyntaxHighlighter.Highlighter(); |
| 51 |
Brush.aliases = ['java']; |
| 52 |
|
| 53 |
SyntaxHighlighter.brushes.Java = Brush; |
| 54 |
|
| 55 |
|
| 56 |
typeof(exports) != 'undefined' ? exports.Brush = Brush : null; |
| 57 |
})(); |