Clement Escoffier | 373a57d | 2009-07-21 12:06:46 +0000 | [diff] [blame^] | 1 | dp.sh.Brushes.JScript = function()
|
| 2 | {
|
| 3 | var keywords = 'abstract boolean break byte case catch char class const continue debugger ' +
|
| 4 | 'default delete do double else enum export extends false final finally float ' +
|
| 5 | 'for function goto if implements import in instanceof int interface long native ' +
|
| 6 | 'new null package private protected public return short static super switch ' +
|
| 7 | 'synchronized this throw throws transient true try typeof var void volatile while with';
|
| 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 #region and #endregion
|
| 15 | { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keywords
|
| 16 | ];
|
| 17 |
|
| 18 | this.CssClass = 'dp-c';
|
| 19 | }
|
| 20 |
|
| 21 | dp.sh.Brushes.JScript.prototype = new dp.sh.Highlighter();
|
| 22 | dp.sh.Brushes.JScript.Aliases = ['js', 'jscript', 'javascript'];
|