commit ee0dcc1e0bcfb93856f7c2bf06b70f2b498b5917
parent 9d7545b558af2dc2347c8a78cf7216787691d70c
Author: lash <dev@holbrook.no>
Date: Sat, 31 Aug 2024 19:10:27 +0100
Add quitter example to docs
Diffstat:
5 files changed, 114 insertions(+), 90 deletions(-)
diff --git a/doc/build/cookbook.html b/doc/build/cookbook.html
@@ -16,8 +16,7 @@
<link href="index.html" rel="start" title="Top">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
-<link href="dev.html" rel="next" title="dev">
-<link href="exceptions.html" rel="prev" title="exceptions">
+<link href="dev.html" rel="prev" title="dev">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
@@ -34,10 +33,10 @@ ul.mark-bullet {list-style-type: disc}
<div class="chapter-level-extent" id="cookbook">
<div class="nav-panel">
<p>
-Next: <a href="dev.html" accesskey="n" rel="next">Developing with vise</a>, Previous: <a href="exceptions.html" accesskey="p" rel="prev">Exceptional states</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+Previous: <a href="dev.html" accesskey="p" rel="prev">Developing with vise</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
-<h2 class="chapter" id="Common-patterns"><span>11 Common patterns<a class="copiable-link" href="#Common-patterns"> ¶</a></span></h2>
+<h2 class="chapter" id="Common-patterns"><span>12 Common patterns<a class="copiable-link" href="#Common-patterns"> ¶</a></span></h2>
<ul class="mini-toc">
@@ -47,9 +46,10 @@ Next: <a href="dev.html" accesskey="n" rel="next">Developing with vise</a>, Prev
<li><a href="#Multiple-pages" accesskey="4">Multiple pages</a></li>
<li><a href="#Multi_002dpage-menus" accesskey="5">Multi-page menus</a></li>
<li><a href="#Default-input-handler" accesskey="6">Default input handler</a></li>
+<li><a href="#Graceful-quit" accesskey="7">Graceful quit</a></li>
</ul>
<div class="section-level-extent" id="Hello-world">
-<h3 class="section"><span>11.1 Hello world<a class="copiable-link" href="#Hello-world"> ¶</a></span></h3>
+<h3 class="section"><span>12.1 Hello world<a class="copiable-link" href="#Hello-world"> ¶</a></span></h3>
<div class="example">
<pre class="example-preformatted">HALT
@@ -60,7 +60,7 @@ Next: <a href="dev.html" accesskey="n" rel="next">Developing with vise</a>, Prev
<a class="anchor" id="handling_005fmenus"></a></div>
<div class="section-level-extent" id="Handling-menus-and-inputs">
-<h3 class="section"><span>11.2 Handling menus and inputs<a class="copiable-link" href="#Handling-menus-and-inputs"> ¶</a></span></h3>
+<h3 class="section"><span>12.2 Handling menus and inputs<a class="copiable-link" href="#Handling-menus-and-inputs"> ¶</a></span></h3>
<div class="example">
<pre class="example-preformatted">MOUT to_foo 0
@@ -87,7 +87,7 @@ INCMP _ 2
<li><a href="#Menu-batch-version" accesskey="1">Menu batch version</a></li>
</ul>
<div class="subsection-level-extent" id="Menu-batch-version">
-<h4 class="subsection"><span>11.2.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version"> ¶</a></span></h4>
+<h4 class="subsection"><span>12.2.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">DOWN foo 0 to_foo
@@ -101,7 +101,7 @@ UP 2 upup
</div>
</div>
<div class="section-level-extent" id="Signal-flow-control">
-<h3 class="section"><span>11.3 Signal flow control<a class="copiable-link" href="#Signal-flow-control"> ¶</a></span></h3>
+<h3 class="section"><span>12.3 Signal flow control<a class="copiable-link" href="#Signal-flow-control"> ¶</a></span></h3>
<div class="example">
<pre class="example-preformatted">LOAD foo 1
@@ -116,7 +116,7 @@ MOVE baz
<a class="anchor" id="multiple_005fpages"></a></div>
<div class="section-level-extent" id="Multiple-pages">
-<h3 class="section"><span>11.4 Multiple pages<a class="copiable-link" href="#Multiple-pages"> ¶</a></span></h3>
+<h3 class="section"><span>12.4 Multiple pages<a class="copiable-link" href="#Multiple-pages"> ¶</a></span></h3>
<div class="example">
<pre class="example-preformatted">LOAD foo 0
@@ -137,7 +137,7 @@ INCMP < 22
<li><a href="#Menu-batch-version-1" accesskey="1">Menu batch version</a></li>
</ul>
<div class="subsection-level-extent" id="Menu-batch-version-1">
-<h4 class="subsection"><span>11.4.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-1"> ¶</a></span></h4>
+<h4 class="subsection"><span>12.4.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-1"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">LOAD foo 0
@@ -151,7 +151,7 @@ PREVIOUS 22 to_back
<a class="anchor" id="multiple_005fmenus"></a></div>
</div>
<div class="section-level-extent" id="Multi_002dpage-menus">
-<h3 class="section"><span>11.5 Multi-page menus<a class="copiable-link" href="#Multi_002dpage-menus"> ¶</a></span></h3>
+<h3 class="section"><span>12.5 Multi-page menus<a class="copiable-link" href="#Multi_002dpage-menus"> ¶</a></span></h3>
<div class="example">
<pre class="example-preformatted">MSINK
@@ -183,7 +183,7 @@ INCMP bar 7
<li><a href="#Menu-batch-version-2" accesskey="1">Menu batch version</a></li>
</ul>
<div class="subsection-level-extent" id="Menu-batch-version-2">
-<h4 class="subsection"><span>11.5.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-2"> ¶</a></span></h4>
+<h4 class="subsection"><span>12.5.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-2"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">MSINK
@@ -205,7 +205,7 @@ DOWN bar 7 pu
</div>
</div>
<div class="section-level-extent" id="Default-input-handler">
-<h3 class="section"><span>11.6 Default input handler<a class="copiable-link" href="#Default-input-handler"> ¶</a></span></h3>
+<h3 class="section"><span>12.6 Default input handler<a class="copiable-link" href="#Default-input-handler"> ¶</a></span></h3>
<div class="example">
<pre class="example-preformatted">MOUT to_foo 0
@@ -215,12 +215,24 @@ INCMP bar *
</pre></div>
<p>If input is <code class="code">0</code>, route to the <code class="code">foo</code>. Any other input will route to the <code class="code">bar</code> node.
+</p>
+
+</div>
+<div class="section-level-extent" id="Graceful-quit">
+<h3 class="section"><span>12.7 Graceful quit<a class="copiable-link" href="#Graceful-quit"> ¶</a></span></h3>
+
+<div class="example">
+<pre class="example-preformatted">LOAD msg 0
+HALT
+</pre></div>
+
+<p>Execution will stop (without error) and the node template render will be displayed. Any content returned from the execution of the <code class="code">msg</code> symbol will be appended to the render. Lastly the <code class="code">MOVE ^</code> will be appended automatically to the state bytecode.
</p></div>
</div>
<hr>
<div class="nav-panel">
<p>
-Next: <a href="dev.html">Developing with vise</a>, Previous: <a href="exceptions.html">Exceptional states</a>, Up: <a href="index.html">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+Previous: <a href="dev.html">Developing with vise</a>, Up: <a href="index.html">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
diff --git a/doc/build/dev.html b/doc/build/dev.html
@@ -16,7 +16,8 @@
<link href="index.html" rel="start" title="Top">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
-<link href="cookbook.html" rel="prev" title="cookbook">
+<link href="cookbook.html" rel="next" title="cookbook">
+<link href="exceptions.html" rel="prev" title="exceptions">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
@@ -33,10 +34,10 @@ ul.mark-bullet {list-style-type: disc}
<div class="chapter-level-extent" id="dev">
<div class="nav-panel">
<p>
-Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+Next: <a href="cookbook.html" accesskey="n" rel="next">Common patterns</a>, Previous: <a href="exceptions.html" accesskey="p" rel="prev">Exceptional states</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<hr>
-<h2 class="chapter" id="Developing-with-vise"><span>12 Developing with vise<a class="copiable-link" href="#Developing-with-vise"> ¶</a></span></h2>
+<h2 class="chapter" id="Developing-with-vise"><span>11 Developing with vise<a class="copiable-link" href="#Developing-with-vise"> ¶</a></span></h2>
<ul class="mini-toc">
@@ -49,7 +50,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#Bytecode-example" accesskey="7">Bytecode example</a></li>
</ul>
<div class="section-level-extent" id="Code-repository-structure">
-<h3 class="section"><span>12.1 Code repository structure<a class="copiable-link" href="#Code-repository-structure"> ¶</a></span></h3>
+<h3 class="section"><span>11.1 Code repository structure<a class="copiable-link" href="#Code-repository-structure"> ¶</a></span></h3>
<dl class="table">
<dt><code class="code">asm</code></dt>
@@ -90,7 +91,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="section-level-extent" id="Interacting-with-vise">
-<h3 class="section"><span>12.2 Interacting with <code class="code">vise</code><a class="copiable-link" href="#Interacting-with-vise"> ¶</a></span></h3>
+<h3 class="section"><span>11.2 Interacting with <code class="code">vise</code><a class="copiable-link" href="#Interacting-with-vise"> ¶</a></span></h3>
<p>Implementers of <code class="code">vise</code> should interface with the system using the <code class="code">engine</code> module.
</p>
@@ -105,7 +106,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#Blocking-execution" accesskey="5">Blocking execution</a></li>
</ul>
<div class="subsection-level-extent" id="Modes-of-operation">
-<h4 class="subsection"><span>12.2.1 Modes of operation<a class="copiable-link" href="#Modes-of-operation"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.2.1 Modes of operation<a class="copiable-link" href="#Modes-of-operation"> ¶</a></span></h4>
<p>The <code class="code">engine</code> module provides three different modes of operation for the engine implementations.
</p>
@@ -116,7 +117,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#Asynchronous-one_002dshot" accesskey="3">Asynchronous one-shot</a></li>
</ul>
<div class="subsubsection-level-extent" id="Manual-operation">
-<h4 class="subsubsection"><span>12.2.1.1 Manual operation<a class="copiable-link" href="#Manual-operation"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.2.1.1 Manual operation<a class="copiable-link" href="#Manual-operation"> ¶</a></span></h4>
<p>Directly interaction with an <code class="code">engine.Engine</code> instance.
</p>
@@ -129,7 +130,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsubsection-level-extent" id="Synchronous-loop">
-<h4 class="subsubsection"><span>12.2.1.2 Synchronous loop<a class="copiable-link" href="#Synchronous-loop"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.2.1.2 Synchronous loop<a class="copiable-link" href="#Synchronous-loop"> ¶</a></span></h4>
<p>Receives input from a reader and writes into to a writer, and executes the underlying <code class="code">engine.Engine</code> with given inputs until execution is terminated.
</p>
@@ -140,7 +141,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsubsection-level-extent" id="Asynchronous-one_002dshot">
-<h4 class="subsubsection"><span>12.2.1.3 Asynchronous one-shot<a class="copiable-link" href="#Asynchronous-one_002dshot"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.2.1.3 Asynchronous one-shot<a class="copiable-link" href="#Asynchronous-one_002dshot"> ¶</a></span></h4>
<p>Compatible with e.g. a network socket or HTTP frontend. The <code class="code">engine.RunPersisted</code> method restores a persisted state and runs one single input until VM yield after which the new state is persisted.
</p>
@@ -150,7 +151,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
</div>
<div class="subsection-level-extent" id="Configuration">
-<h4 class="subsection"><span>12.2.2 Configuration<a class="copiable-link" href="#Configuration"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.2.2 Configuration<a class="copiable-link" href="#Configuration"> ¶</a></span></h4>
<p>The engine configuration defines the top-level parameters for the execution environment, including maximum output size, default language, execution entry point and more.
</p>
@@ -159,7 +160,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Sessions">
-<h4 class="subsection"><span>12.2.3 Sessions<a class="copiable-link" href="#Sessions"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.2.3 Sessions<a class="copiable-link" href="#Sessions"> ¶</a></span></h4>
<p>The <code class="code">engine.Config.SessionId</code> is used to disambiguate the end-user that is interacting with the engine.
</p>
@@ -168,7 +169,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<a class="anchor" id="execution_005fcontext"></a></div>
<div class="subsection-level-extent" id="Execution-context">
-<h4 class="subsection"><span>12.2.4 Execution context<a class="copiable-link" href="#Execution-context"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.2.4 Execution context<a class="copiable-link" href="#Execution-context"> ¶</a></span></h4>
<p>The engine stores the <code class="code">SessionId</code> aswell as the current chosen <code class="code">lang.Language</code> in the execution context. This is passed through to the VM operation, and is available for client code, specifically:
</p>
@@ -181,7 +182,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Blocking-execution">
-<h4 class="subsection"><span>12.2.5 Blocking execution<a class="copiable-link" href="#Blocking-execution"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.2.5 Blocking execution<a class="copiable-link" href="#Blocking-execution"> ¶</a></span></h4>
<p>Using the <code class="code">engine.SetFirst()</code> method, a function may be defined that executes before the pending bytecode in the VM state.
</p>
@@ -195,7 +196,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
</div>
<div class="section-level-extent" id="Resolving-resources">
-<h3 class="section"><span>12.3 Resolving resources<a class="copiable-link" href="#Resolving-resources"> ¶</a></span></h3>
+<h3 class="section"><span>11.3 Resolving resources<a class="copiable-link" href="#Resolving-resources"> ¶</a></span></h3>
<p>The core of implementation code is defined by implementing the <code class="code">resource.Resource</code> interface. This is also described in the <a class="ref" href="cache.html#load_005fhandler">LOAD handler</a> section.
</p>
@@ -206,7 +207,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#Filesystem-resource-implementation" accesskey="2">Filesystem resource implementation</a></li>
</ul>
<div class="subsection-level-extent" id="Memory-resource-implementation">
-<h4 class="subsection"><span>12.3.1 Memory resource implementation<a class="copiable-link" href="#Memory-resource-implementation"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.3.1 Memory resource implementation<a class="copiable-link" href="#Memory-resource-implementation"> ¶</a></span></h4>
<p>One of two reference implementations of <code class="code">resource.Resource</code> is the <code class="code">resource.MemResource</code> class. It enables the client to register all node and symbol resolutions at runtime, using its functions prefixed with <code class="code">Add...</code>.
</p>
@@ -215,7 +216,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Filesystem-resource-implementation">
-<h4 class="subsection"><span>12.3.2 Filesystem resource implementation<a class="copiable-link" href="#Filesystem-resource-implementation"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.3.2 Filesystem resource implementation<a class="copiable-link" href="#Filesystem-resource-implementation"> ¶</a></span></h4>
<p>The Filesystem based resource implemementation is used by the <code class="code">dev/interactive</code> tool, aswell as the executable examples in <samp class="file">examples/</samp> directory.
</p>
@@ -229,14 +230,14 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#External-symbols-_0028resource_002eResource_002eFuncFor_0029" accesskey="4">External symbols (<code class="code">resource.Resource.FuncFor</code>)</a></li>
</ul>
<div class="subsubsection-level-extent" id="Bytecode-_0028resource_002eResource_002eGetCode_0029">
-<h4 class="subsubsection"><span>12.3.2.1 Bytecode (<code class="code">resource.Resource.GetCode</code>)<a class="copiable-link" href="#Bytecode-_0028resource_002eResource_002eGetCode_0029"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.3.2.1 Bytecode (<code class="code">resource.Resource.GetCode</code>)<a class="copiable-link" href="#Bytecode-_0028resource_002eResource_002eGetCode_0029"> ¶</a></span></h4>
<p>Read from <samp class="file">basedir/<node>.bin</samp>.
</p>
</div>
<div class="subsubsection-level-extent" id="Templates-_0028resource_002eResource_002eGetTemplate_0029">
-<h4 class="subsubsection"><span>12.3.2.2 Templates (<code class="code">resource.Resource.GetTemplate</code>)<a class="copiable-link" href="#Templates-_0028resource_002eResource_002eGetTemplate_0029"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.3.2.2 Templates (<code class="code">resource.Resource.GetTemplate</code>)<a class="copiable-link" href="#Templates-_0028resource_002eResource_002eGetTemplate_0029"> ¶</a></span></h4>
<p>If language has been set, the template will be read from <samp class="file">basedir/<node>_<lang></samp>. For example, the <em class="emph">norwegian</em> template for the node <code class="code">root</code> will be read from <samp class="file">basedir/root_nor</samp>.
</p>
@@ -247,7 +248,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsubsection-level-extent" id="Menus-_0028resource_002eResource_002eGetMenu_0029">
-<h4 class="subsubsection"><span>12.3.2.3 Menus (<code class="code">resource.Resource.GetMenu</code>)<a class="copiable-link" href="#Menus-_0028resource_002eResource_002eGetMenu_0029"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.3.2.3 Menus (<code class="code">resource.Resource.GetMenu</code>)<a class="copiable-link" href="#Menus-_0028resource_002eResource_002eGetMenu_0029"> ¶</a></span></h4>
<p>If language has been set, the template will be read from <samp class="file">basedir/<label>_<lang>_menu</samp>. For example, the <em class="emph">norwegian</em> template for the menu label <code class="code">foo</code> will be read from <samp class="file">basedir/foo_nor_menu</samp>.
</p>
@@ -258,7 +259,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsubsection-level-extent" id="External-symbols-_0028resource_002eResource_002eFuncFor_0029">
-<h4 class="subsubsection"><span>12.3.2.4 External symbols (<code class="code">resource.Resource.FuncFor</code>)<a class="copiable-link" href="#External-symbols-_0028resource_002eResource_002eFuncFor_0029"> ¶</a></span></h4>
+<h4 class="subsubsection"><span>11.3.2.4 External symbols (<code class="code">resource.Resource.FuncFor</code>)<a class="copiable-link" href="#External-symbols-_0028resource_002eResource_002eFuncFor_0029"> ¶</a></span></h4>
<p>The implementation allows setting resolver functions for symbols at runtime, using the <code class="code">resource.FsResource.AddLocalFunc</code> method. This registers an <code class="code">resource.FsResource.EntryFunc</code> with the lookup symbol as key. Note that the <code class="code">EntryFunc</code> receives the language setting through the execution context.
</p>
@@ -275,7 +276,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
</div>
<div class="section-level-extent" id="Logging">
-<h3 class="section"><span>12.4 Logging<a class="copiable-link" href="#Logging"> ¶</a></span></h3>
+<h3 class="section"><span>11.4 Logging<a class="copiable-link" href="#Logging"> ¶</a></span></h3>
<p>Loglevels are set at compile-time using the following build tags:
</p>
@@ -297,7 +298,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="section-level-extent" id="Tools">
-<h3 class="section"><span>12.5 Tools<a class="copiable-link" href="#Tools"> ¶</a></span></h3>
+<h3 class="section"><span>11.5 Tools<a class="copiable-link" href="#Tools"> ¶</a></span></h3>
<p>Located in the <samp class="file">dev/</samp> directory of the source code repository.
</p>
@@ -310,7 +311,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#Interactive-case-examples" accesskey="5">Interactive case examples</a></li>
</ul>
<div class="subsection-level-extent" id="Test-data-generation">
-<h4 class="subsection"><span>12.5.1 Test data generation<a class="copiable-link" href="#Test-data-generation"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.5.1 Test data generation<a class="copiable-link" href="#Test-data-generation"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">go run ./dev/gendata/ <directory>
@@ -321,7 +322,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Interactive-runner">
-<h4 class="subsection"><span>12.5.2 Interactive runner<a class="copiable-link" href="#Interactive-runner"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.5.2 Interactive runner<a class="copiable-link" href="#Interactive-runner"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">go run ./dev/interactive [-d <data_directory>] [--root <root_symbol>] [--session-id <session_id>] [--persist]
@@ -342,7 +343,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Assembler">
-<h4 class="subsection"><span>12.5.3 Assembler<a class="copiable-link" href="#Assembler"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.5.3 Assembler<a class="copiable-link" href="#Assembler"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">go run ./dev/asm <assembly_file>
@@ -353,7 +354,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Disassembler">
-<h4 class="subsection"><span>12.5.4 Disassembler<a class="copiable-link" href="#Disassembler"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.5.4 Disassembler<a class="copiable-link" href="#Disassembler"> ¶</a></span></h4>
<div class="example">
<pre class="example-preformatted">go run ./dev/disasm/ <binary_file>
@@ -364,7 +365,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
<div class="subsection-level-extent" id="Interactive-case-examples">
-<h4 class="subsection"><span>12.5.5 Interactive case examples<a class="copiable-link" href="#Interactive-case-examples"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.5.5 Interactive case examples<a class="copiable-link" href="#Interactive-case-examples"> ¶</a></span></h4>
<p>Found in <samp class="file">examples/</samp>.
</p>
@@ -405,14 +406,14 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
</div>
</div>
<div class="section-level-extent" id="Assembly-examples">
-<h3 class="section"><span>12.6 Assembly examples<a class="copiable-link" href="#Assembly-examples"> ¶</a></span></h3>
+<h3 class="section"><span>11.6 Assembly examples<a class="copiable-link" href="#Assembly-examples"> ¶</a></span></h3>
<p>See <samp class="file">testdata/*.vis</samp>
</p>
</div>
<div class="section-level-extent" id="Bytecode-example">
-<h3 class="section"><span>12.7 Bytecode example<a class="copiable-link" href="#Bytecode-example"> ¶</a></span></h3>
+<h3 class="section"><span>11.7 Bytecode example<a class="copiable-link" href="#Bytecode-example"> ¶</a></span></h3>
<p>Currently the following rules apply for encoding in version <code class="code">0</code>:
</p>
@@ -428,7 +429,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<li><a href="#Example" accesskey="1">Example</a></li>
</ul>
<div class="subsection-level-extent" id="Example">
-<h4 class="subsection"><span>12.7.1 Example<a class="copiable-link" href="#Example"> ¶</a></span></h4>
+<h4 class="subsection"><span>11.7.1 Example<a class="copiable-link" href="#Example"> ¶</a></span></h4>
<p>(Minimal, WIP)
</p>
@@ -447,7 +448,7 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>,
<hr>
<div class="nav-panel">
<p>
-Previous: <a href="cookbook.html">Common patterns</a>, Up: <a href="index.html">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
+Next: <a href="cookbook.html">Common patterns</a>, Previous: <a href="exceptions.html">Exceptional states</a>, Up: <a href="index.html">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
diff --git a/doc/build/index.html b/doc/build/index.html
@@ -184,65 +184,66 @@ Next: <a href="overview.html" accesskey="n" rel="next">Overview</a> [<a h
<li><a id="toc-After-termination" href="exceptions.html#After-termination">10.2.2 After termination</a></li>
</ul></li>
</ul></li>
- <li><a id="toc-Common-patterns" href="cookbook.html">11 Common patterns</a>
+ <li><a id="toc-Developing-with-vise" href="dev.html">11 Developing with vise</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Hello-world" href="cookbook.html#Hello-world">11.1 Hello world</a></li>
- <li><a id="toc-Handling-menus-and-inputs" href="cookbook.html#Handling-menus-and-inputs">11.2 Handling menus and inputs</a>
+ <li><a id="toc-Code-repository-structure" href="dev.html#Code-repository-structure">11.1 Code repository structure</a></li>
+ <li><a id="toc-Interacting-with-vise" href="dev.html#Interacting-with-vise">11.2 Interacting with <code class="code">vise</code></a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Menu-batch-version" href="cookbook.html#Menu-batch-version">11.2.1 Menu batch version</a></li>
+ <li><a id="toc-Modes-of-operation" href="dev.html#Modes-of-operation">11.2.1 Modes of operation</a>
+ <ul class="toc-numbered-mark">
+ <li><a id="toc-Manual-operation" href="dev.html#Manual-operation">11.2.1.1 Manual operation</a></li>
+ <li><a id="toc-Synchronous-loop" href="dev.html#Synchronous-loop">11.2.1.2 Synchronous loop</a></li>
+ <li><a id="toc-Asynchronous-one_002dshot" href="dev.html#Asynchronous-one_002dshot">11.2.1.3 Asynchronous one-shot</a></li>
+ </ul></li>
+ <li><a id="toc-Configuration" href="dev.html#Configuration">11.2.2 Configuration</a></li>
+ <li><a id="toc-Sessions" href="dev.html#Sessions">11.2.3 Sessions</a></li>
+ <li><a id="toc-Execution-context" href="dev.html#Execution-context">11.2.4 Execution context</a></li>
+ <li><a id="toc-Blocking-execution" href="dev.html#Blocking-execution">11.2.5 Blocking execution</a></li>
</ul></li>
- <li><a id="toc-Signal-flow-control" href="cookbook.html#Signal-flow-control">11.3 Signal flow control</a></li>
- <li><a id="toc-Multiple-pages" href="cookbook.html#Multiple-pages">11.4 Multiple pages</a>
+ <li><a id="toc-Resolving-resources" href="dev.html#Resolving-resources">11.3 Resolving resources</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Menu-batch-version-1" href="cookbook.html#Menu-batch-version-1">11.4.1 Menu batch version</a></li>
+ <li><a id="toc-Memory-resource-implementation" href="dev.html#Memory-resource-implementation">11.3.1 Memory resource implementation</a></li>
+ <li><a id="toc-Filesystem-resource-implementation" href="dev.html#Filesystem-resource-implementation">11.3.2 Filesystem resource implementation</a>
+ <ul class="toc-numbered-mark">
+ <li><a id="toc-Bytecode-_0028resource_002eResource_002eGetCode_0029" href="dev.html#Bytecode-_0028resource_002eResource_002eGetCode_0029">11.3.2.1 Bytecode (<code class="code">resource.Resource.GetCode</code>)</a></li>
+ <li><a id="toc-Templates-_0028resource_002eResource_002eGetTemplate_0029" href="dev.html#Templates-_0028resource_002eResource_002eGetTemplate_0029">11.3.2.2 Templates (<code class="code">resource.Resource.GetTemplate</code>)</a></li>
+ <li><a id="toc-Menus-_0028resource_002eResource_002eGetMenu_0029" href="dev.html#Menus-_0028resource_002eResource_002eGetMenu_0029">11.3.2.3 Menus (<code class="code">resource.Resource.GetMenu</code>)</a></li>
+ <li><a id="toc-External-symbols-_0028resource_002eResource_002eFuncFor_0029" href="dev.html#External-symbols-_0028resource_002eResource_002eFuncFor_0029">11.3.2.4 External symbols (<code class="code">resource.Resource.FuncFor</code>)</a></li>
+ </ul></li>
</ul></li>
- <li><a id="toc-Multi_002dpage-menus" href="cookbook.html#Multi_002dpage-menus">11.5 Multi-page menus</a>
+ <li><a id="toc-Logging" href="dev.html#Logging">11.4 Logging</a></li>
+ <li><a id="toc-Tools" href="dev.html#Tools">11.5 Tools</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Menu-batch-version-2" href="cookbook.html#Menu-batch-version-2">11.5.1 Menu batch version</a></li>
+ <li><a id="toc-Test-data-generation" href="dev.html#Test-data-generation">11.5.1 Test data generation</a></li>
+ <li><a id="toc-Interactive-runner" href="dev.html#Interactive-runner">11.5.2 Interactive runner</a></li>
+ <li><a id="toc-Assembler" href="dev.html#Assembler">11.5.3 Assembler</a></li>
+ <li><a id="toc-Disassembler" href="dev.html#Disassembler">11.5.4 Disassembler</a></li>
+ <li><a id="toc-Interactive-case-examples" href="dev.html#Interactive-case-examples">11.5.5 Interactive case examples</a></li>
</ul></li>
- <li><a id="toc-Default-input-handler" href="cookbook.html#Default-input-handler">11.6 Default input handler</a></li>
- </ul></li>
- <li><a id="toc-Developing-with-vise" href="dev.html">12 Developing with vise</a>
- <ul class="toc-numbered-mark">
- <li><a id="toc-Code-repository-structure" href="dev.html#Code-repository-structure">12.1 Code repository structure</a></li>
- <li><a id="toc-Interacting-with-vise" href="dev.html#Interacting-with-vise">12.2 Interacting with <code class="code">vise</code></a>
+ <li><a id="toc-Assembly-examples" href="dev.html#Assembly-examples">11.6 Assembly examples</a></li>
+ <li><a id="toc-Bytecode-example" href="dev.html#Bytecode-example">11.7 Bytecode example</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Modes-of-operation" href="dev.html#Modes-of-operation">12.2.1 Modes of operation</a>
- <ul class="toc-numbered-mark">
- <li><a id="toc-Manual-operation" href="dev.html#Manual-operation">12.2.1.1 Manual operation</a></li>
- <li><a id="toc-Synchronous-loop" href="dev.html#Synchronous-loop">12.2.1.2 Synchronous loop</a></li>
- <li><a id="toc-Asynchronous-one_002dshot" href="dev.html#Asynchronous-one_002dshot">12.2.1.3 Asynchronous one-shot</a></li>
- </ul></li>
- <li><a id="toc-Configuration" href="dev.html#Configuration">12.2.2 Configuration</a></li>
- <li><a id="toc-Sessions" href="dev.html#Sessions">12.2.3 Sessions</a></li>
- <li><a id="toc-Execution-context" href="dev.html#Execution-context">12.2.4 Execution context</a></li>
- <li><a id="toc-Blocking-execution" href="dev.html#Blocking-execution">12.2.5 Blocking execution</a></li>
+ <li><a id="toc-Example" href="dev.html#Example">11.7.1 Example</a></li>
</ul></li>
- <li><a id="toc-Resolving-resources" href="dev.html#Resolving-resources">12.3 Resolving resources</a>
+ </ul></li>
+ <li><a id="toc-Common-patterns" href="cookbook.html">12 Common patterns</a>
+ <ul class="toc-numbered-mark">
+ <li><a id="toc-Hello-world" href="cookbook.html#Hello-world">12.1 Hello world</a></li>
+ <li><a id="toc-Handling-menus-and-inputs" href="cookbook.html#Handling-menus-and-inputs">12.2 Handling menus and inputs</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Memory-resource-implementation" href="dev.html#Memory-resource-implementation">12.3.1 Memory resource implementation</a></li>
- <li><a id="toc-Filesystem-resource-implementation" href="dev.html#Filesystem-resource-implementation">12.3.2 Filesystem resource implementation</a>
- <ul class="toc-numbered-mark">
- <li><a id="toc-Bytecode-_0028resource_002eResource_002eGetCode_0029" href="dev.html#Bytecode-_0028resource_002eResource_002eGetCode_0029">12.3.2.1 Bytecode (<code class="code">resource.Resource.GetCode</code>)</a></li>
- <li><a id="toc-Templates-_0028resource_002eResource_002eGetTemplate_0029" href="dev.html#Templates-_0028resource_002eResource_002eGetTemplate_0029">12.3.2.2 Templates (<code class="code">resource.Resource.GetTemplate</code>)</a></li>
- <li><a id="toc-Menus-_0028resource_002eResource_002eGetMenu_0029" href="dev.html#Menus-_0028resource_002eResource_002eGetMenu_0029">12.3.2.3 Menus (<code class="code">resource.Resource.GetMenu</code>)</a></li>
- <li><a id="toc-External-symbols-_0028resource_002eResource_002eFuncFor_0029" href="dev.html#External-symbols-_0028resource_002eResource_002eFuncFor_0029">12.3.2.4 External symbols (<code class="code">resource.Resource.FuncFor</code>)</a></li>
- </ul></li>
+ <li><a id="toc-Menu-batch-version" href="cookbook.html#Menu-batch-version">12.2.1 Menu batch version</a></li>
</ul></li>
- <li><a id="toc-Logging" href="dev.html#Logging">12.4 Logging</a></li>
- <li><a id="toc-Tools" href="dev.html#Tools">12.5 Tools</a>
+ <li><a id="toc-Signal-flow-control" href="cookbook.html#Signal-flow-control">12.3 Signal flow control</a></li>
+ <li><a id="toc-Multiple-pages" href="cookbook.html#Multiple-pages">12.4 Multiple pages</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Test-data-generation" href="dev.html#Test-data-generation">12.5.1 Test data generation</a></li>
- <li><a id="toc-Interactive-runner" href="dev.html#Interactive-runner">12.5.2 Interactive runner</a></li>
- <li><a id="toc-Assembler" href="dev.html#Assembler">12.5.3 Assembler</a></li>
- <li><a id="toc-Disassembler" href="dev.html#Disassembler">12.5.4 Disassembler</a></li>
- <li><a id="toc-Interactive-case-examples" href="dev.html#Interactive-case-examples">12.5.5 Interactive case examples</a></li>
+ <li><a id="toc-Menu-batch-version-1" href="cookbook.html#Menu-batch-version-1">12.4.1 Menu batch version</a></li>
</ul></li>
- <li><a id="toc-Assembly-examples" href="dev.html#Assembly-examples">12.6 Assembly examples</a></li>
- <li><a id="toc-Bytecode-example" href="dev.html#Bytecode-example">12.7 Bytecode example</a>
+ <li><a id="toc-Multi_002dpage-menus" href="cookbook.html#Multi_002dpage-menus">12.5 Multi-page menus</a>
<ul class="toc-numbered-mark">
- <li><a id="toc-Example" href="dev.html#Example">12.7.1 Example</a></li>
+ <li><a id="toc-Menu-batch-version-2" href="cookbook.html#Menu-batch-version-2">12.5.1 Menu batch version</a></li>
</ul></li>
+ <li><a id="toc-Default-input-handler" href="cookbook.html#Default-input-handler">12.6 Default input handler</a></li>
+ <li><a id="toc-Graceful-quit" href="cookbook.html#Graceful-quit">12.7 Graceful quit</a></li>
</ul></li>
</ul>
</div>
diff --git a/doc/texinfo/cookbook.texi b/doc/texinfo/cookbook.texi
@@ -146,3 +146,13 @@ INCMP bar *
@end example
If input is @code{0}, route to the @code{foo}. Any other input will route to the @code{bar} node.
+
+
+@section Graceful quit
+
+@example
+LOAD msg 0
+HALT
+@end example
+
+Execution will stop (without error) and the node template render will be displayed. Any content returned from the execution of the @code{msg} symbol will be appended to the render. Lastly the @code{MOVE ^} will be appended automatically to the state bytecode.
diff --git a/doc/texinfo/index.texi b/doc/texinfo/index.texi
@@ -33,5 +33,5 @@ Released 2023 under AGPL3
@include render.texi
@include language.texi
@include exceptions.texi
-@include cookbook.texi
@include dev.texi
+@include cookbook.texi