blob: 4ef8b9b82e43631d5ce2a5896469cbe92d3607ee [file] [log] [blame]
Clement Escoffierbc69a4e2009-07-21 11:44:30 +00001dp.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
21dp.sh.Brushes.JScript.prototype = new dp.sh.Highlighter();
22dp.sh.Brushes.JScript.Aliases = ['js', 'jscript', 'javascript'];