diff options
-rw-r--r-- | _build/content/articles/asciideck.asciidoc | 4 | ||||
-rw-r--r-- | articles/asciideck/index.html | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/_build/content/articles/asciideck.asciidoc b/_build/content/articles/asciideck.asciidoc index c79dcd2a..3a70bd17 100644 --- a/_build/content/articles/asciideck.asciidoc +++ b/_build/content/articles/asciideck.asciidoc @@ -48,9 +48,9 @@ Asciidoc document. Take this function for example: [source,erlang] ---- comment_line(St) → - «"//", Comment0/bits» = read_line(St), + <<"//", Comment0/bits>> = read_line(St), Comment = trim(Comment0), - {comment_line, #{«"subs"» ⇒ «"verbatim"»}, Comment, ann(St)}. + {comment_line, #{<<"subs">> => <<"verbatim">>}, Comment, ann(St)}. ---- When the line begins with `//` this matches: we have diff --git a/articles/asciideck/index.html b/articles/asciideck/index.html index a7b09d70..17efbfcb 100644 --- a/articles/asciideck/index.html +++ b/articles/asciideck/index.html @@ -80,9 +80,9 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt><b><font color="#000000">comment_line</font></b>(<font color="#009900">St</font>) → - «<font color="#FF0000">"//"</font>, <font color="#009900">Comment0</font><font color="#990000">/</font><font color="#FF6600">bits</font>» <font color="#990000">=</font> <b><font color="#000000">read_line</font></b>(<font color="#009900">St</font>), + <font color="#990000"><<</font><font color="#FF0000">"//"</font>, <font color="#009900">Comment0</font><font color="#990000">/</font><font color="#FF6600">bits</font><font color="#990000">>></font> <font color="#990000">=</font> <b><font color="#000000">read_line</font></b>(<font color="#009900">St</font>), <font color="#009900">Comment</font> <font color="#990000">=</font> <b><font color="#000000">trim</font></b>(<font color="#009900">Comment0</font>), - {<font color="#FF6600">comment_line</font>, #{«<font color="#FF0000">"subs"</font>» ⇒ «<font color="#FF0000">"verbatim"</font>»}, <font color="#009900">Comment</font>, <b><font color="#000000">ann</font></b>(<font color="#009900">St</font>)}<font color="#990000">.</font></tt></pre> + {<font color="#FF6600">comment_line</font>, #{<font color="#990000"><<</font><font color="#FF0000">"subs"</font><font color="#990000">>></font> <font color="#990000">=></font> <font color="#990000"><<</font><font color="#FF0000">"verbatim"</font><font color="#990000">>></font>}, <font color="#009900">Comment</font>, <b><font color="#000000">ann</font></b>(<font color="#009900">St</font>)}<font color="#990000">.</font></tt></pre> </div></div> <p>When the line begins with <code>//</code> this matches: we have a comment line and we return the block we just parsed. When the line doesn't begin with <code>//</code> the function will crash and Asciideck will try the next parse function in the list.</p> <p>This makes the code easy to read and improve. I am very happy with how it turned out.</p> |