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 Dark)"/>
0006 </head><body style="background-color:#232629;color:#cfcfc2"><pre>
0007 <span style="color:#7a7c7d;">&quot;&quot;&quot;module docstring&quot;&quot;&quot;</span>
0008 
0009 <span style="color:#3daee9;">namespace</span> My.NameSpace <span style="color:#7a7c7d;">#optional namespace declaration</span>
0010 
0011 <span style="color:#3daee9;">import</span> Assembly.Reference <span style="color:#7a7c7d;">#import statements</span>
0012 
0013 <span style="color:#7a7c7d;">#followed by the Members of this module (classes, methods, etc.)</span>
0014 <span style="font-weight:bold;">class</span> MyClass:
0015     <span style="color:#fdbc4b;font-weight:bold;">pass</span>
0016 
0017 <span style="font-weight:bold;">def</span> domyfunction<span style="color:#3f8058;">(</span>it<span style="color:#3f8058;">)</span>:
0018     <span style="color:#2980b9;">print</span><span style="color:#3f8058;">(</span>it<span style="color:#3f8058;">)</span>
0019 
0020 <span style="color:#7a7c7d;">#start &quot;main&quot; section that is executed when script is run</span>
0021 x <span style="color:#3daee9;">as</span> <span style="color:#2980b9;">int</span>
0022 x <span style="color:#3f8058;">=</span> <span style="color:#f67400;">3</span>
0023 domyfunction<span style="color:#3f8058;">(</span>x<span style="color:#3f8058;">)</span>
0024 
0025 <span style="color:#7a7c7d;">#optional assembly attribute declarations used when compiling</span>
0026 [assembly: AssemblyTitle<span style="color:#3f8058;">(</span><span style="color:#f44f4f;">'foo'</span><span style="color:#3f8058;">)</span>]
0027 [assembly: AssemblyDescription<span style="color:#3f8058;">(</span><span style="color:#f44f4f;">'bar'</span><span style="color:#3f8058;">)</span>]
0028 
0029 <span style="color:#3daee9;">import</span> MyLibrary
0030 <span style="color:#2980b9;">print</span> <span style="color:#3f8058;">(</span>Version<span style="color:#3f8058;">)</span>
0031 doit<span style="color:#3f8058;">()</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:#3daee9;">as</span> <span style="color:#2980b9;">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:#3f8058;">()</span>:
0038         Version <span style="color:#3f8058;">=</span> <span style="color:#f44f4f;">&quot;0.1&quot;</span>
0039 
0040 <span style="font-weight:bold;">def</span> doit<span style="color:#3f8058;">()</span>:
0041     <span style="color:#7a7c7d;">#you can refer to &quot;globals&quot; from within your library, too:</span>
0042     <span style="color:#2980b9;">print</span><span style="color:#3f8058;">(</span><span style="color:#f44f4f;">&quot;This library's version is: &quot;</span><span style="color:#3f8058;">+</span>MainClass.Version<span style="color:#3f8058;">)</span>
0043 
0044 </pre></body></html>