File indexing completed on 2024-05-19 15:23:13

0001 <!DOCTYPE html>
0002 <html><head>
0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
0004 <title>highlight.boo</title>
0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (Boo) - Theme (Breeze Light)"/>
0006 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
0007 <span style="color:#898887;">&quot;&quot;&quot;module docstring&quot;&quot;&quot;</span>
0008 
0009 <span style="color:#924c9d;">namespace</span> My.NameSpace <span style="color:#898887;">#optional namespace declaration</span>
0010 
0011 <span style="color:#924c9d;">import</span> Assembly.Reference <span style="color:#898887;">#import statements</span>
0012 
0013 <span style="color:#898887;">#followed by the Members of this module (classes, methods, etc.)</span>
0014 <span style="font-weight:bold;">class</span> MyClass:
0015     <span style="font-weight:bold;">pass</span>
0016 
0017 <span style="font-weight:bold;">def</span> domyfunction<span style="color:#ca60ca;">(</span>it<span style="color:#ca60ca;">)</span>:
0018     <span style="color:#0057ae;">print</span><span style="color:#ca60ca;">(</span>it<span style="color:#ca60ca;">)</span>
0019 
0020 <span style="color:#898887;">#start &quot;main&quot; section that is executed when script is run</span>
0021 x <span style="color:#924c9d;">as</span> <span style="color:#0057ae;">int</span>
0022 x <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">3</span>
0023 domyfunction<span style="color:#ca60ca;">(</span>x<span style="color:#ca60ca;">)</span>
0024 
0025 <span style="color:#898887;">#optional assembly attribute declarations used when compiling</span>
0026 [assembly: AssemblyTitle<span style="color:#ca60ca;">(</span><span style="color:#bf0303;">'foo'</span><span style="color:#ca60ca;">)</span>]
0027 [assembly: AssemblyDescription<span style="color:#ca60ca;">(</span><span style="color:#bf0303;">'bar'</span><span style="color:#ca60ca;">)</span>]
0028 
0029 <span style="color:#924c9d;">import</span> MyLibrary
0030 <span style="color:#0057ae;">print</span> <span style="color:#ca60ca;">(</span>Version<span style="color:#ca60ca;">)</span>
0031 doit<span style="color:#ca60ca;">()</span>
0032 
0033 [Module]
0034 <span style="font-weight:bold;">class</span> MainClass:
0035     <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>
0036 
0037     <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>:
0038         Version <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">&quot;0.1&quot;</span>
0039 
0040 <span style="font-weight:bold;">def</span> doit<span style="color:#ca60ca;">()</span>:
0041     <span style="color:#898887;">#you can refer to &quot;globals&quot; from within your library, too:</span>
0042     <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>
0043 
0044 </pre></body></html>