Debian Codegraph @

autotests/html/highlight.boo.html

raw
1 <!DOCTYPE html>
2 <html><head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <title>highlight.boo</title>
5 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (Boo) - Theme (Breeze Light)"/>
6 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
7 <span style="color:#898887;">&quot;&quot;&quot;module docstring&quot;&quot;&quot;</span>
8
9 <span style="color:#924c9d;">namespace</span> My.NameSpace <span style="color:#898887;">#optional namespace declaration</span>
10
11 <span style="color:#924c9d;">import</span> Assembly.Reference <span style="color:#898887;">#import statements</span>
12
13 <span style="color:#898887;">#followed by the Members of this module (classes, methods, etc.)</span>
14 <span style="font-weight:bold;">class</span> MyClass:
15 <span style="font-weight:bold;">pass</span>
16
17 <span style="font-weight:bold;">def</span> domyfunction<span style="color:#ca60ca;">(</span>it<span style="color:#ca60ca;">)</span>:
18 <span style="color:#0057ae;">print</span><span style="color:#ca60ca;">(</span>it<span style="color:#ca60ca;">)</span>
19
20 <span style="color:#898887;">#start &quot;main&quot; section that is executed when script is run</span>
21 x <span style="color:#924c9d;">as</span> <span style="color:#0057ae;">int</span>
22 x <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">3</span>
23 domyfunction<span style="color:#ca60ca;">(</span>x<span style="color:#ca60ca;">)</span>
24
25 <span style="color:#898887;">#optional assembly attribute declarations used when compiling</span>
26 [assembly: AssemblyTitle<span style="color:#ca60ca;">(</span><span style="color:#bf0303;">'foo'</span><span style="color:#ca60ca;">)</span>]
27 [assembly: AssemblyDescription<span style="color:#ca60ca;">(</span><span style="color:#bf0303;">'bar'</span><span style="color:#ca60ca;">)</span>]
28
29 <span style="color:#924c9d;">import</span> MyLibrary
30 <span style="color:#0057ae;">print</span> <span style="color:#ca60ca;">(</span>Version<span style="color:#ca60ca;">)</span>
31 doit<span style="color:#ca60ca;">()</span>
32
33 [Module]
34 <span style="font-weight:bold;">class</span> MainClass:
35 <span style="font-weight:bold;">public</span> <span style="font-weight:bold;">static</span> Version <span style="color:#924c9d;">as</span> <span style="color:#0057ae;">string</span>
36
37 <span style="font-weight:bold;">static</span> <span style="font-weight:bold;">def</span> <span style="font-weight:bold;">constructor</span><span style="color:#ca60ca;">()</span>:
38 Version <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">&quot;0.1&quot;</span>
39
40 <span style="font-weight:bold;">def</span> doit<span style="color:#ca60ca;">()</span>:
41 <span style="color:#898887;">#you can refer to &quot;globals&quot; from within your library, too:</span>
42 <span style="color:#0057ae;">print</span><span style="color:#ca60ca;">(</span><span style="color:#bf0303;">&quot;This library's version is: &quot;</span><span style="color:#ca60ca;">+</span>MainClass.Version<span style="color:#ca60ca;">)</span>
43
44 </pre></body></html>