Skip to content

Commit e082bf3

Browse files
committed
Fix syntax highlighting.
1 parent effd706 commit e082bf3

File tree

8 files changed

+103
-7158
lines changed

8 files changed

+103
-7158
lines changed

build/2025/05/26/access-control-syntax/index.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,15 @@ <h3>Sigils at the declaration</h3>
252252
<p>In Oberon, top-level declarations are private by default and only accessible
253253
to the containing module. If you want to make a declaration public, you mark
254254
the declaration with an asterisk:</p>
255-
<div class="highlight"><pre><code class="language-oberon" data-lang="oberon">MODULE Hello;
256-
IMPORT Out;
257-
258-
PROCEDURE SayHello*;
259-
BEGIN
260-
Out.String(&quot;Hello World!&quot;);
261-
Out.Ln;
262-
END SayHello;
263-
END Hello.
255+
<div class="highlight"><pre><code class="language-oberon" data-lang="oberon"><span class="k">MODULE</span> <span class="i">Hello</span><span class="p">;</span>
256+
<span class="k">IMPORT</span> <span class="i">Out</span><span class="p">;</span>
257+
258+
<span class="k">PROCEDURE</span> <span class="i">SayHello</span><span class="o">*</span><span class="p">;</span>
259+
<span class="k">BEGIN</span>
260+
<span class="i">Out</span><span class="p">.</span><span class="i">String</span><span class="p">(</span><span class="s">&quot;Hello World!&quot;</span><span class="p">);</span>
261+
<span class="i">Out</span><span class="p">.</span><span class="i">Ln</span><span class="p">;</span>
262+
<span class="k">END</span> <span class="i">SayHello</span><span class="p">;</span>
263+
<span class="k">END</span> <span class="i">Hello</span><span class="p">.</span>
264264
</code></pre></div>
265265
<p>Here, the <code>*</code> after <code>PROCEDURE SayHello</code> means that <code>SayHello</code> is public. Note
266266
that this marker is only at the declaration. It&rsquo;s not part of the name. At
@@ -422,16 +422,16 @@ <h3>Maybe sigils at the declaration</h3>
422422
<p>This is declaring a private <code>+</code> function. It would probably look equally weird
423423
to have <code>*</code> after the name in a record declaration:</p>
424424
<div class="highlight"><pre><code class="language-vgs" data-lang="vgs"><span class="k">rec</span> <span class="t">Vec</span><span class="o">*</span>
425-
<span class="i">val</span> <span class="i">left</span> <span class="t">Int</span>
426-
<span class="i">val</span> <span class="i">right</span> <span class="t">Int</span>
425+
<span class="k">val</span> <span class="i">left</span> <span class="t">Int</span>
426+
<span class="k">val</span> <span class="i">right</span> <span class="t">Int</span>
427427
<span class="k">end</span>
428428
</code></pre></div>
429429
<p>That led me to thinking the sigil should be by the declaration keyword. In my
430430
language, every declaration form does start with a leading keyword (unlike, say,
431431
C where function declarations don&rsquo;t have one), so it&rsquo;s feasible. Something like:</p>
432432
<div class="highlight"><pre><code class="language-vgs" data-lang="vgs"><span class="k">rec</span><span class="o">*</span> <span class="t">Vec</span>
433-
<span class="i">val</span> <span class="i">left</span> <span class="t">Int</span>
434-
<span class="i">val</span> <span class="i">right</span> <span class="t">Int</span>
433+
<span class="k">val</span> <span class="i">left</span> <span class="t">Int</span>
434+
<span class="k">val</span> <span class="i">right</span> <span class="t">Int</span>
435435
<span class="k">end</span>
436436

437437
<span class="k">def</span><span class="o">*</span> <span class="i">sayHi</span><span class="p">()</span>
@@ -447,12 +447,12 @@ <h3>Maybe alternate keywords</h3>
447447
<p>That led to my last idea which I can&rsquo;t decide if I like or not. Given Python and
448448
Dart, it seems like underscore vaguely conveys &ldquo;private&rdquo; to some people. So
449449
maybe use that? It looks like:</p>
450-
<div class="highlight"><pre><code class="language-vgs" data-lang="vgs"><span class="i">rec_</span> <span class="t">Vec</span>
451-
<span class="i">val</span> <span class="i">left</span> <span class="t">Int</span>
452-
<span class="i">val</span> <span class="i">right</span> <span class="t">Int</span>
450+
<div class="highlight"><pre><code class="language-vgs" data-lang="vgs"><span class="k">rec_</span> <span class="t">Vec</span>
451+
<span class="k">val</span> <span class="i">left</span> <span class="t">Int</span>
452+
<span class="k">val</span> <span class="i">right</span> <span class="t">Int</span>
453453
<span class="k">end</span>
454454

455-
<span class="i">def_</span> <span class="i">sayHi</span><span class="p">()</span>
455+
<span class="k">def_</span> <span class="i">sayHi</span><span class="p">()</span>
456456
<span class="i">print</span><span class="p">(</span><span class="s">&quot;Hello!&quot;</span><span class="p">)</span>
457457
<span class="k">end</span>
458458
</code></pre></div>

build/atom.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>journal.stuffwithstuff.com</title>
55
<link href="http://journal.stuffwithstuff.com/"/>
66
<link type="application/atom+xml" rel="self" href="http://journal.stuffwithstuff.com/atom.xml"/>
7-
<updated>2025-05-26T20:57:16.073926Z</updated>
7+
<updated>2025-05-27T00:57:24.071903Z</updated>
88
<id>http://journal.stuffwithstuff.com/</id>
99
<author>
1010
<name>Robert Nystrom</name>
@@ -242,15 +242,15 @@ Niklaus Wirth&amp;rsquo;s magnum opus language &lt;a href=&quot;https://oberon.o
242242
&lt;p&gt;In Oberon, top-level declarations are private by default and only accessible
243243
to the containing module. If you want to make a declaration public, you mark
244244
the declaration with an asterisk:&lt;/p&gt;
245-
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-oberon&quot; data-lang=&quot;oberon&quot;&gt;MODULE Hello;
246-
IMPORT Out;
247-
248-
PROCEDURE SayHello*;
249-
BEGIN
250-
Out.String(&amp;quot;Hello World!&amp;quot;);
251-
Out.Ln;
252-
END SayHello;
253-
END Hello.
245+
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-oberon&quot; data-lang=&quot;oberon&quot;&gt;&lt;span class=&quot;k&quot;&gt;MODULE&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
246+
&lt;span class=&quot;k&quot;&gt;IMPORT&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
247+
248+
&lt;span class=&quot;k&quot;&gt;PROCEDURE&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;SayHello&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
249+
&lt;span class=&quot;k&quot;&gt;BEGIN&lt;/span&gt;
250+
&lt;span class=&quot;i&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Hello World!&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
251+
&lt;span class=&quot;i&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Ln&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
252+
&lt;span class=&quot;k&quot;&gt;END&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;SayHello&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
253+
&lt;span class=&quot;k&quot;&gt;END&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
254254
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
255255
&lt;p&gt;Here, the &lt;code&gt;*&lt;/code&gt; after &lt;code&gt;PROCEDURE SayHello&lt;/code&gt; means that &lt;code&gt;SayHello&lt;/code&gt; is public. Note
256256
that this marker is only at the declaration. It&amp;rsquo;s not part of the name. At
@@ -412,16 +412,16 @@ be confusing to have &lt;code&gt;*&lt;/code&gt; right after other punctuation:&l
412412
&lt;p&gt;This is declaring a private &lt;code&gt;+&lt;/code&gt; function. It would probably look equally weird
413413
to have &lt;code&gt;*&lt;/code&gt; after the name in a record declaration:&lt;/p&gt;
414414
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vgs&quot; data-lang=&quot;vgs&quot;&gt;&lt;span class=&quot;k&quot;&gt;rec&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Vec&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
415-
&lt;span class=&quot;i&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
416-
&lt;span class=&quot;i&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
415+
&lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
416+
&lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
417417
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
418418
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
419419
&lt;p&gt;That led me to thinking the sigil should be by the declaration keyword. In my
420420
language, every declaration form does start with a leading keyword (unlike, say,
421421
C where function declarations don&amp;rsquo;t have one), so it&amp;rsquo;s feasible. Something like:&lt;/p&gt;
422422
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vgs&quot; data-lang=&quot;vgs&quot;&gt;&lt;span class=&quot;k&quot;&gt;rec&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Vec&lt;/span&gt;
423-
&lt;span class=&quot;i&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
424-
&lt;span class=&quot;i&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
423+
&lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
424+
&lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
425425
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
426426

427427
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;sayHi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
@@ -437,12 +437,12 @@ to emphasize the declaration (which is what it does in Oberon where it means
437437
&lt;p&gt;That led to my last idea which I can&amp;rsquo;t decide if I like or not. Given Python and
438438
Dart, it seems like underscore vaguely conveys &amp;ldquo;private&amp;rdquo; to some people. So
439439
maybe use that? It looks like:&lt;/p&gt;
440-
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vgs&quot; data-lang=&quot;vgs&quot;&gt;&lt;span class=&quot;i&quot;&gt;rec_&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Vec&lt;/span&gt;
441-
&lt;span class=&quot;i&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
442-
&lt;span class=&quot;i&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
440+
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vgs&quot; data-lang=&quot;vgs&quot;&gt;&lt;span class=&quot;k&quot;&gt;rec_&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Vec&lt;/span&gt;
441+
&lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
442+
&lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;t&quot;&gt;Int&lt;/span&gt;
443443
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
444444

445-
&lt;span class=&quot;i&quot;&gt;def_&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;sayHi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
445+
&lt;span class=&quot;k&quot;&gt;def_&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;sayHi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
446446
&lt;span class=&quot;i&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Hello!&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
447447
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
448448
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

0 commit comments

Comments
 (0)