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 Documentation generator for the nit language.
16 Generate API documentation in HTML format from nit source code.
19 define(['highlight'], function(hljs
) {
20 hljs
.registerLanguage('nit', function(hljs
) {
21 var METHOD_RE
= '[a-z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
23 keyword
: 'abort abstract and as assert break class continue do else end enum extern for fun ' +
24 'if import in init interface intern intrude is isa isset label loop module new nullable not ' +
25 'once or protected private redef return self super then type universal var ' +
26 'when while writable',
27 literal
: "true false null"
40 contains
: [hljs
.BACKSLASH_ESCAPE
, SUBST
],
42 {begin
: /"/, end: /"/},
47 contains
: [hljs
.BACKSLASH_ESCAPE
, SUBST
],
56 begin
: '\\(', end
: '\\)',
62 begin
: ':', end
: '$|do|is|=',
69 begin
: 'do', end
: '$|end',
73 className
: 'modifiers',
74 begin
: 'is', end
: '$',
84 beginKeywords
: 'module', end
: '$',
86 hljs
.inherit(hljs
.TITLE_MODE
, {begin
: '[a-z_]\\w*'}),
92 begin
: '(intrude )?import', end
: '$',
93 keywords
: 'intrude import',
104 begin
: '(redef |private |protected )?(abstract )?(class|interface)', end
: '$',
105 keywords
: 'redef private protected abstract class interface',
107 hljs
.inherit(hljs
.TITLE_MODE
, {begin
: '[A-Z]\\w*'}),
110 begin
: '\\bsuper', end
: '$',
119 begin
: '(redef |private |protected )?(fun|init|type)\\b', end
: '$',
128 begin
: '\\b[a-zA-Z_][a-zA-Z_]*\\b'
135 begin
: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
139 SUBST
.contains
= CONTAINS
;