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 # Program used to test the Nit highlighter
21 redef fun do_work
(mainmodule
, mmodules
, mb
)
23 var v
= new HighlightVisitor
25 <meta charset="utf-8">
26 <style type="text/css">
33 for mm
in mmodules
do for cd
in mm
.mclassdefs
do for pd
in cd
.mpropdefs
do
34 var n
= mb
.mpropdef2node
(pd
)
35 if not n
isa APropdef then continue
36 var hl
= new HighlightVisitor
38 print
"<h1>{pd.full_name}</h1>"
40 hl
.html
.write_to
(stdout
)
45 var thlv
= new THLVisitor
47 var n
= mb
.mmodule2node
(mm
)
52 print
"</body></html>"
57 var seen
= new HashSet[String]
61 if not seen
.has
(cn
) then
64 var hl
= new HighlightVisitor
66 print
"<h2>AST node: {cn} at {n.location}</h2>"
68 hl
.html
.write_to
(stdout
)