1 /* This file is part of NIT ( http://www.nitlanguage.org ).
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
15 * Nit Brush for SyntaxHighlighter
16 * see http://alexgorbatchev.com/SyntaxHighlighter
22 typeof(require
) != 'undefined' ? SyntaxHighlighter
= require('shCore').SyntaxHighlighter
: null;
26 var keywords
= 'abort abstract and as assert break class continue do else end enum extern false for fun' +
27 'if import in init interface intrude is isa isset label loop module new null nullable not' +
28 'once or protected private redef return self super then type true universal var' +
29 'when while writable';
30 var builtins
= 'exit sys args get_time getc getcwd gets print printn';
33 { regex
: SyntaxHighlighter
.regexLib
.singleLinePerlComments
, css
: 'comments' }, // one line comments
34 { regex
: SyntaxHighlighter
.regexLib
.doubleQuotedString
, css
: 'string' }, // double quoted strings
35 { regex
: SyntaxHighlighter
.regexLib
.singleQuotedString
, css
: 'string' }, // single quoted strings
36 { regex
: /\b[A
-Z0
-9_
]+\b/g
, css
: 'constants' }, // types
37 { regex
: /[A
-Z
][A
-Za
-z0
-9_
]*/g
, css
: 'color2' }, // classes
38 { regex
: new RegExp(this.getKeywords(keywords
), 'gm'), css
: 'keyword' }, // keywords
39 { regex
: new RegExp(this.getKeywords(builtins
), 'gm'), css
: 'color3' } // builtins
41 this.forHtmlScript(SyntaxHighlighter
.regexLib
.aspScriptTags
);
44 Brush
.prototype = new SyntaxHighlighter
.Highlighter();
45 Brush
.aliases
= ['nit'];
47 SyntaxHighlighter
.brushes
.Nit
= Brush
;
50 typeof(exports
) != 'undefined' ? exports
.Brush
= Brush
: null;