go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

commit 9d7545b558af2dc2347c8a78cf7216787691d70c
parent 4a670a5add3dbf6094ff2bd2c7c9eafe085cf397
Author: lash <dev@holbrook.no>
Date:   Sat, 31 Aug 2024 19:03:13 +0100

Update documentation with new features

Diffstat:
Mdoc/build/cookbook.html | 26+++++++++++++-------------
Mdoc/build/dev.html | 75++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
Mdoc/build/index.html | 90++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
Mdoc/build/instructions.html | 5++++-
Mdoc/build/language.html | 4++--
Mdoc/build/navigation.html | 2+-
Mdoc/build/signals.html | 2+-
Mdoc/texinfo/dev.texi | 17+++++++++++++++--
Mdoc/texinfo/index.texi | 1+
Mdoc/texinfo/instructions.texi | 5++++-
Mdoc/texinfo/navigation.texi | 2+-
Mdoc/texinfo/signals.texi | 8++++----
Mvm/runner.go | 2+-
13 files changed, 146 insertions(+), 93 deletions(-)

diff --git a/doc/build/cookbook.html b/doc/build/cookbook.html @@ -17,7 +17,7 @@ <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="language.html" rel="prev" title="language"> +<link href="exceptions.html" rel="prev" title="exceptions"> <style type="text/css"> <!-- a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em} @@ -34,10 +34,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="language.html" accesskey="p" rel="prev">Handling languages</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</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> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> </div> <hr> -<h2 class="chapter" id="Common-patterns"><span>10 Common patterns<a class="copiable-link" href="#Common-patterns"> &para;</a></span></h2> +<h2 class="chapter" id="Common-patterns"><span>11 Common patterns<a class="copiable-link" href="#Common-patterns"> &para;</a></span></h2> <ul class="mini-toc"> @@ -49,7 +49,7 @@ Next: <a href="dev.html" accesskey="n" rel="next">Developing with vise</a>, Prev <li><a href="#Default-input-handler" accesskey="6">Default input handler</a></li> </ul> <div class="section-level-extent" id="Hello-world"> -<h3 class="section"><span>10.1 Hello world<a class="copiable-link" href="#Hello-world"> &para;</a></span></h3> +<h3 class="section"><span>11.1 Hello world<a class="copiable-link" href="#Hello-world"> &para;</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>10.2 Handling menus and inputs<a class="copiable-link" href="#Handling-menus-and-inputs"> &para;</a></span></h3> +<h3 class="section"><span>11.2 Handling menus and inputs<a class="copiable-link" href="#Handling-menus-and-inputs"> &para;</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>10.2.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version"> &para;</a></span></h4> +<h4 class="subsection"><span>11.2.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version"> &para;</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>10.3 Signal flow control<a class="copiable-link" href="#Signal-flow-control"> &para;</a></span></h3> +<h3 class="section"><span>11.3 Signal flow control<a class="copiable-link" href="#Signal-flow-control"> &para;</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>10.4 Multiple pages<a class="copiable-link" href="#Multiple-pages"> &para;</a></span></h3> +<h3 class="section"><span>11.4 Multiple pages<a class="copiable-link" href="#Multiple-pages"> &para;</a></span></h3> <div class="example"> <pre class="example-preformatted">LOAD foo 0 @@ -137,7 +137,7 @@ INCMP &lt; 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>10.4.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-1"> &para;</a></span></h4> +<h4 class="subsection"><span>11.4.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-1"> &para;</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>10.5 Multi-page menus<a class="copiable-link" href="#Multi_002dpage-menus"> &para;</a></span></h3> +<h3 class="section"><span>11.5 Multi-page menus<a class="copiable-link" href="#Multi_002dpage-menus"> &para;</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>10.5.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-2"> &para;</a></span></h4> +<h4 class="subsection"><span>11.5.1 Menu batch version<a class="copiable-link" href="#Menu-batch-version-2"> &para;</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>10.6 Default input handler<a class="copiable-link" href="#Default-input-handler"> &para;</a></span></h3> +<h3 class="section"><span>11.6 Default input handler<a class="copiable-link" href="#Default-input-handler"> &para;</a></span></h3> <div class="example"> <pre class="example-preformatted">MOUT to_foo 0 @@ -220,7 +220,7 @@ INCMP bar * <hr> <div class="nav-panel"> <p> -Next: <a href="dev.html">Developing with vise</a>, Previous: <a href="language.html">Handling languages</a>, Up: <a href="index.html">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</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> &nbsp; [<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 @@ -36,7 +36,7 @@ ul.mark-bullet {list-style-type: disc} Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> &nbsp; [<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>11 Developing with vise<a class="copiable-link" href="#Developing-with-vise"> &para;</a></span></h2> +<h2 class="chapter" id="Developing-with-vise"><span>12 Developing with vise<a class="copiable-link" href="#Developing-with-vise"> &para;</a></span></h2> <ul class="mini-toc"> @@ -49,7 +49,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>11.1 Code repository structure<a class="copiable-link" href="#Code-repository-structure"> &para;</a></span></h3> +<h3 class="section"><span>12.1 Code repository structure<a class="copiable-link" href="#Code-repository-structure"> &para;</a></span></h3> <dl class="table"> <dt><code class="code">asm</code></dt> @@ -58,6 +58,9 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>, <dt><code class="code">cache</code></dt> <dd><p>Holds and manages all loaded content. </p></dd> +<dt><code class="code">db</code></dt> +<dd><p>Provides interface and implementations for data storage and retrieval backends. +</p></dd> <dt><code class="code">engine</code></dt> <dd><p>Outermost interface. Orchestrates execution of bytecode against input. </p></dd> @@ -68,13 +71,13 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>, <dd><p>Logging interface and build tags for loglevels. </p></dd> <dt><code class="code">persist</code></dt> -<dd><p>Interface and reference implementation of &lsquo;state&lsquo; and &lsquo;cache&lsquo; persistence across asynchronous vm executions. +<dd><p>Provides &lsquo;state&lsquo; and &lsquo;cache&lsquo; persistence across asynchronous vm executions. </p></dd> <dt><code class="code">render</code></dt> <dd><p>Renders menu and templates, and enforces output size constraints. </p></dd> <dt><code class="code">resource</code></dt> -<dd><p>Retrieves data and bytecode from external symbols, and retrieves templates. +<dd><p>Resolves bytecode, translations, templates and menu symbols from external symbols. </p></dd> <dt><code class="code">state</code></dt> <dd><p>Holds the bytecode buffer, error states and navigation states. @@ -87,7 +90,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>11.2 Interacting with <code class="code">vise</code><a class="copiable-link" href="#Interacting-with-vise"> &para;</a></span></h3> +<h3 class="section"><span>12.2 Interacting with <code class="code">vise</code><a class="copiable-link" href="#Interacting-with-vise"> &para;</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> @@ -99,9 +102,10 @@ Previous: <a href="cookbook.html" accesskey="p" rel="prev">Common patterns</a>, <li><a href="#Configuration" accesskey="2">Configuration</a></li> <li><a href="#Sessions" accesskey="3">Sessions</a></li> <li><a href="#Execution-context" accesskey="4">Execution context</a></li> +<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>11.2.1 Modes of operation<a class="copiable-link" href="#Modes-of-operation"> &para;</a></span></h4> +<h4 class="subsection"><span>12.2.1 Modes of operation<a class="copiable-link" href="#Modes-of-operation"> &para;</a></span></h4> <p>The <code class="code">engine</code> module provides three different modes of operation for the engine implementations. </p> @@ -112,7 +116,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>11.2.1.1 Manual operation<a class="copiable-link" href="#Manual-operation"> &para;</a></span></h4> +<h4 class="subsubsection"><span>12.2.1.1 Manual operation<a class="copiable-link" href="#Manual-operation"> &para;</a></span></h4> <p>Directly interaction with an <code class="code">engine.Engine</code> instance. </p> @@ -125,7 +129,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>11.2.1.2 Synchronous loop<a class="copiable-link" href="#Synchronous-loop"> &para;</a></span></h4> +<h4 class="subsubsection"><span>12.2.1.2 Synchronous loop<a class="copiable-link" href="#Synchronous-loop"> &para;</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> @@ -136,7 +140,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>11.2.1.3 Asynchronous one-shot<a class="copiable-link" href="#Asynchronous-one_002dshot"> &para;</a></span></h4> +<h4 class="subsubsection"><span>12.2.1.3 Asynchronous one-shot<a class="copiable-link" href="#Asynchronous-one_002dshot"> &para;</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> @@ -146,7 +150,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>11.2.2 Configuration<a class="copiable-link" href="#Configuration"> &para;</a></span></h4> +<h4 class="subsection"><span>12.2.2 Configuration<a class="copiable-link" href="#Configuration"> &para;</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> @@ -155,7 +159,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>11.2.3 Sessions<a class="copiable-link" href="#Sessions"> &para;</a></span></h4> +<h4 class="subsection"><span>12.2.3 Sessions<a class="copiable-link" href="#Sessions"> &para;</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> @@ -164,7 +168,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>11.2.4 Execution context<a class="copiable-link" href="#Execution-context"> &para;</a></span></h4> +<h4 class="subsection"><span>12.2.4 Execution context<a class="copiable-link" href="#Execution-context"> &para;</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> @@ -176,9 +180,22 @@ 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"> &para;</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> +<p>The function uses the same signature as the external functions executed by <code class="code">resource</code> for <code class="code">LOAD</code> instructions. +</p> +<p>This can be for example be used to prevent access to execution for a blocked user account, or as an override while doing maintenance. +</p> +<p>To prevent VM execution from the pre-VM check, the flag <code class="code">TERMINATE</code> should be set in the <code class="code">resource.Result.FlagSet</code> array. +</p> + +</div> </div> <div class="section-level-extent" id="Resolving-resources"> -<h3 class="section"><span>11.3 Resolving resources<a class="copiable-link" href="#Resolving-resources"> &para;</a></span></h3> +<h3 class="section"><span>12.3 Resolving resources<a class="copiable-link" href="#Resolving-resources"> &para;</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> @@ -189,7 +206,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>11.3.1 Memory resource implementation<a class="copiable-link" href="#Memory-resource-implementation"> &para;</a></span></h4> +<h4 class="subsection"><span>12.3.1 Memory resource implementation<a class="copiable-link" href="#Memory-resource-implementation"> &para;</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> @@ -198,7 +215,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>11.3.2 Filesystem resource implementation<a class="copiable-link" href="#Filesystem-resource-implementation"> &para;</a></span></h4> +<h4 class="subsection"><span>12.3.2 Filesystem resource implementation<a class="copiable-link" href="#Filesystem-resource-implementation"> &para;</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> @@ -212,14 +229,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>11.3.2.1 Bytecode (<code class="code">resource.Resource.GetCode</code>)<a class="copiable-link" href="#Bytecode-_0028resource_002eResource_002eGetCode_0029"> &para;</a></span></h4> +<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"> &para;</a></span></h4> <p>Read from <samp class="file">basedir/&lt;node&gt;.bin</samp>. </p> </div> <div class="subsubsection-level-extent" id="Templates-_0028resource_002eResource_002eGetTemplate_0029"> -<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"> &para;</a></span></h4> +<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"> &para;</a></span></h4> <p>If language has been set, the template will be read from <samp class="file">basedir/&lt;node&gt;_&lt;lang&gt;</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> @@ -230,7 +247,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>11.3.2.3 Menus (<code class="code">resource.Resource.GetMenu</code>)<a class="copiable-link" href="#Menus-_0028resource_002eResource_002eGetMenu_0029"> &para;</a></span></h4> +<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"> &para;</a></span></h4> <p>If language has been set, the template will be read from <samp class="file">basedir/&lt;label&gt;_&lt;lang&gt;_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> @@ -241,7 +258,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>11.3.2.4 External symbols (<code class="code">resource.Resource.FuncFor</code>)<a class="copiable-link" href="#External-symbols-_0028resource_002eResource_002eFuncFor_0029"> &para;</a></span></h4> +<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"> &para;</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> @@ -258,7 +275,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>11.4 Logging<a class="copiable-link" href="#Logging"> &para;</a></span></h3> +<h3 class="section"><span>12.4 Logging<a class="copiable-link" href="#Logging"> &para;</a></span></h3> <p>Loglevels are set at compile-time using the following build tags: </p> @@ -280,7 +297,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>11.5 Tools<a class="copiable-link" href="#Tools"> &para;</a></span></h3> +<h3 class="section"><span>12.5 Tools<a class="copiable-link" href="#Tools"> &para;</a></span></h3> <p>Located in the <samp class="file">dev/</samp> directory of the source code repository. </p> @@ -293,7 +310,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>11.5.1 Test data generation<a class="copiable-link" href="#Test-data-generation"> &para;</a></span></h4> +<h4 class="subsection"><span>12.5.1 Test data generation<a class="copiable-link" href="#Test-data-generation"> &para;</a></span></h4> <div class="example"> <pre class="example-preformatted">go run ./dev/gendata/ &lt;directory&gt; @@ -304,7 +321,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>11.5.2 Interactive runner<a class="copiable-link" href="#Interactive-runner"> &para;</a></span></h4> +<h4 class="subsection"><span>12.5.2 Interactive runner<a class="copiable-link" href="#Interactive-runner"> &para;</a></span></h4> <div class="example"> <pre class="example-preformatted">go run ./dev/interactive [-d &lt;data_directory&gt;] [--root &lt;root_symbol&gt;] [--session-id &lt;session_id&gt;] [--persist] @@ -325,7 +342,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>11.5.3 Assembler<a class="copiable-link" href="#Assembler"> &para;</a></span></h4> +<h4 class="subsection"><span>12.5.3 Assembler<a class="copiable-link" href="#Assembler"> &para;</a></span></h4> <div class="example"> <pre class="example-preformatted">go run ./dev/asm &lt;assembly_file&gt; @@ -336,7 +353,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>11.5.4 Disassembler<a class="copiable-link" href="#Disassembler"> &para;</a></span></h4> +<h4 class="subsection"><span>12.5.4 Disassembler<a class="copiable-link" href="#Disassembler"> &para;</a></span></h4> <div class="example"> <pre class="example-preformatted">go run ./dev/disasm/ &lt;binary_file&gt; @@ -347,7 +364,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>11.5.5 Interactive case examples<a class="copiable-link" href="#Interactive-case-examples"> &para;</a></span></h4> +<h4 class="subsection"><span>12.5.5 Interactive case examples<a class="copiable-link" href="#Interactive-case-examples"> &para;</a></span></h4> <p>Found in <samp class="file">examples/</samp>. </p> @@ -388,14 +405,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>11.6 Assembly examples<a class="copiable-link" href="#Assembly-examples"> &para;</a></span></h3> +<h3 class="section"><span>12.6 Assembly examples<a class="copiable-link" href="#Assembly-examples"> &para;</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>11.7 Bytecode example<a class="copiable-link" href="#Bytecode-example"> &para;</a></span></h3> +<h3 class="section"><span>12.7 Bytecode example<a class="copiable-link" href="#Bytecode-example"> &para;</a></span></h3> <p>Currently the following rules apply for encoding in version <code class="code">0</code>: </p> @@ -411,7 +428,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>11.7.1 Example<a class="copiable-link" href="#Example"> &para;</a></span></h4> +<h4 class="subsection"><span>12.7.1 Example<a class="copiable-link" href="#Example"> &para;</a></span></h4> <p>(Minimal, WIP) </p> diff --git a/doc/build/index.html b/doc/build/index.html @@ -169,63 +169,79 @@ Next: <a href="overview.html" accesskey="n" rel="next">Overview</a> &nbsp; [<a h <ul class="toc-numbered-mark"> <li><a id="toc-Defining-language" href="language.html#Defining-language">9.1 Defining language</a></li> </ul></li> - <li><a id="toc-Common-patterns" href="cookbook.html">10 Common patterns</a> + <li><a id="toc-Exceptional-states" href="exceptions.html">10 Exceptional states</a> <ul class="toc-numbered-mark"> - <li><a id="toc-Hello-world" href="cookbook.html#Hello-world">10.1 Hello world</a></li> - <li><a id="toc-Handling-menus-and-inputs" href="cookbook.html#Handling-menus-and-inputs">10.2 Handling menus and inputs</a> + <li><a id="toc-Ending-execution" href="exceptions.html#Ending-execution">10.1 Ending execution</a> <ul class="toc-numbered-mark"> - <li><a id="toc-Menu-batch-version" href="cookbook.html#Menu-batch-version">10.2.1 Menu batch version</a></li> + <li><a id="toc-Halting" href="exceptions.html#Halting">10.1.1 Halting</a></li> + <li><a id="toc-Termination" href="exceptions.html#Termination">10.1.2 Termination</a></li> + <li><a id="toc-Default-error-case" href="exceptions.html#Default-error-case">10.1.3 Default error case</a></li> + <li><a id="toc-The-CROAK-instruction" href="exceptions.html#The-CROAK-instruction">10.1.4 The <code class="code">CROAK</code> instruction</a></li> </ul></li> - <li><a id="toc-Signal-flow-control" href="cookbook.html#Signal-flow-control">10.3 Signal flow control</a></li> - <li><a id="toc-Multiple-pages" href="cookbook.html#Multiple-pages">10.4 Multiple pages</a> + <li><a id="toc-Resuming-execution" href="exceptions.html#Resuming-execution">10.2 Resuming execution</a> <ul class="toc-numbered-mark"> - <li><a id="toc-Menu-batch-version-1" href="cookbook.html#Menu-batch-version-1">10.4.1 Menu batch version</a></li> + <li><a id="toc-Graceful-exit" href="exceptions.html#Graceful-exit">10.2.1 Graceful exit</a></li> + <li><a id="toc-After-termination" href="exceptions.html#After-termination">10.2.2 After termination</a></li> </ul></li> - <li><a id="toc-Multi_002dpage-menus" href="cookbook.html#Multi_002dpage-menus">10.5 Multi-page menus</a> + </ul></li> + <li><a id="toc-Common-patterns" href="cookbook.html">11 Common patterns</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> + <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> + </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> + <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> + </ul></li> + <li><a id="toc-Multi_002dpage-menus" href="cookbook.html#Multi_002dpage-menus">11.5 Multi-page menus</a> <ul class="toc-numbered-mark"> - <li><a id="toc-Menu-batch-version-2" href="cookbook.html#Menu-batch-version-2">10.5.1 Menu batch version</a></li> + <li><a id="toc-Menu-batch-version-2" href="cookbook.html#Menu-batch-version-2">11.5.1 Menu batch version</a></li> </ul></li> - <li><a id="toc-Default-input-handler" href="cookbook.html#Default-input-handler">10.6 Default input handler</a></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">11 Developing with vise</a> + <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">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> + <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> <ul class="toc-numbered-mark"> - <li><a id="toc-Modes-of-operation" href="dev.html#Modes-of-operation">11.2.1 Modes of operation</a> + <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">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> + <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">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-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> </ul></li> - <li><a id="toc-Resolving-resources" href="dev.html#Resolving-resources">11.3 Resolving resources</a> + <li><a id="toc-Resolving-resources" href="dev.html#Resolving-resources">12.3 Resolving resources</a> <ul class="toc-numbered-mark"> - <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> + <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">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> + <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> </ul></li> - <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> + <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> <ul class="toc-numbered-mark"> - <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> + <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> </ul></li> - <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> + <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> <ul class="toc-numbered-mark"> - <li><a id="toc-Example" href="dev.html#Example">11.7.1 Example</a></li> + <li><a id="toc-Example" href="dev.html#Example">12.7.1 Example</a></li> </ul></li> </ul></li> </ul> diff --git a/doc/build/instructions.html b/doc/build/instructions.html @@ -73,7 +73,7 @@ Next: <a href="navigation.html" accesskey="n" rel="next">Navigation</a>, Previou <p>Must be one or more characters long. </p> -<p>Starts with a 7-bit alphabetical character. +<p>Starts with a 7-bit alphabetical character ([a-zA-Z]). </p> <p>The remainder of the string may contain 7-bit alphanumeric characters or underscore. </p> @@ -171,6 +171,9 @@ Next: <a href="navigation.html" accesskey="n" rel="next">Navigation</a>, Previou </p> <p>Signal match is the same as for <code class="code">CATCH</code>. </p> +<p>Existing bytecode in buffer is cleared before the jump. +</p> + </div> <div class="subsection-level-extent" id="HALT"> <h4 class="subsection"><span>5.2.3 HALT<a class="copiable-link" href="#HALT"> &para;</a></span></h4> diff --git a/doc/build/language.html b/doc/build/language.html @@ -16,7 +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="cookbook.html" rel="next" title="cookbook"> +<link href="exceptions.html" rel="next" title="exceptions"> <link href="render.html" rel="prev" title="render"> <style type="text/css"> <!-- @@ -32,7 +32,7 @@ span:hover a.copiable-link {visibility: visible} <div class="chapter-level-extent" id="language"> <div class="nav-panel"> <p> -Next: <a href="cookbook.html" accesskey="n" rel="next">Common patterns</a>, Previous: <a href="render.html" accesskey="p" rel="prev">Rendering</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> +Next: <a href="exceptions.html" accesskey="n" rel="next">Exceptional states</a>, Previous: <a href="render.html" accesskey="p" rel="prev">Rendering</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> </div> <hr> <h2 class="chapter" id="Handling-languages"><span>9 Handling languages<a class="copiable-link" href="#Handling-languages"> &para;</a></span></h2> diff --git a/doc/build/navigation.html b/doc/build/navigation.html @@ -106,7 +106,7 @@ Next: <a href="cache.html" accesskey="n" rel="next">External data</a>, Previous: <dd><p>Go to the next page of a multi-page node. Will fail if used on the first (or single) page. </p></dd> <dt><code class="code">^ (0x5E)</code></dt> -<dd><p>Go to the topmost node. Will execute each intermediate node in the stack. +<dd><p>Go to the topmost node. Flushes all intermediate cache scopes (except the topmost). </p></dd> </dl> diff --git a/doc/build/signals.html b/doc/build/signals.html @@ -74,10 +74,10 @@ Next: <a href="instructions.html" accesskey="n" rel="next">Instructions</a>, Pre <thead><tr><th width="15%">Flag name</th><th width="20%">Description</th><th width="55%">Lifetime</th><th width="10%">Writeable?</th></tr></thead> <tbody><tr><td width="15%"><code class="code">READIN</code></td><td width="20%">Input is being processed.</td><td width="55%">From first <code class="code">INCMP</code> until: an <code class="code">INCMP</code> match <em class="emph">or</em> an invalid input exception is triggered.</td><td width="10%">no</td></tr> <tr><td width="15%"><code class="code">INMATCH</code></td><td width="20%">Input matched an <code class="code">INCMP</code> instruction.</td><td width="55%">Next instruction.</td><td width="10%">no</td></tr> -<tr><td width="15%"><code class="code">TERMINATE</code></td><td width="20%">Terminate execution before the following instruction.</td><td width="55%">Until explicit reseet.</td><td width="10%">no</td></tr> <tr><td width="15%"><code class="code">DIRTY</code></td><td width="20%">Rendered output is available.</td><td width="55%">Until output is processed.</td><td width="10%">no</td></tr> <tr><td width="15%"><code class="code">WAIT</code></td><td width="20%">Halt execution before the following instruction, and yield control to client.</td><td width="55%">Until control is yielded.</td><td width="10%">no</td></tr> <tr><td width="15%"><code class="code">LOADFAIL</code></td><td width="20%">An unexpected error has occurred during execution of an external code symbol.</td><td width="55%">Next instruction.</td><td width="10%">no</td></tr> +<tr><td width="15%"><code class="code">TERMINATE</code></td><td width="20%">Terminate execution before the following instruction.</td><td width="55%">Until explicit reseet.</td><td width="10%">yes</td></tr> <tr><td width="15%"><code class="code">LANG</code></td><td width="20%">Output from an external code symbol is a valid language code, and language should be changed accordingly.</td><td width="55%">Next instruction.</td><td width="10%">yes</td></tr> </tbody> </table> diff --git a/doc/texinfo/dev.texi b/doc/texinfo/dev.texi @@ -9,6 +9,8 @@ Assembly parser and compiler. @item cache Holds and manages all loaded content. +@item db +Provides interface and implementations for data storage and retrieval backends. @item engine Outermost interface. Orchestrates execution of bytecode against input. @item lang @@ -16,11 +18,11 @@ Validation and specification of language context. @item logging Logging interface and build tags for loglevels. @item persist -Interface and reference implementation of `state` and `cache` persistence across asynchronous vm executions. +Provides `state` and `cache` persistence across asynchronous vm executions. @item render Renders menu and templates, and enforces output size constraints. @item resource -Retrieves data and bytecode from external symbols, and retrieves templates. +Resolves bytecode, translations, templates and menu symbols from external symbols. @item state Holds the bytecode buffer, error states and navigation states. @item vm @@ -93,6 +95,17 @@ The engine stores the @code{SessionId} aswell as the current chosen @code{lang.L @end itemize +@subsection Blocking execution + +Using the @code{engine.SetFirst()} method, a function may be defined that executes before the pending bytecode in the VM state. + +The function uses the same signature as the external functions executed by @code{resource} for @code{LOAD} instructions. + +This can be for example be used to prevent access to execution for a blocked user account, or as an override while doing maintenance. + +To prevent VM execution from the pre-VM check, the flag @code{TERMINATE} should be set in the @code{resource.Result.FlagSet} array. + + @section Resolving resources The core of implementation code is defined by implementing the @code{resource.Resource} interface. This is also described in the @ref{load_handler, LOAD handler} section. diff --git a/doc/texinfo/index.texi b/doc/texinfo/index.texi @@ -32,5 +32,6 @@ Released 2023 under AGPL3 @include cache.texi @include render.texi @include language.texi +@include exceptions.texi @include cookbook.texi @include dev.texi diff --git a/doc/texinfo/instructions.texi b/doc/texinfo/instructions.texi @@ -16,7 +16,7 @@ Both regular and special node names exist. Must be one or more characters long. -Starts with a 7-bit alphabetical character. +Starts with a 7-bit alphabetical character ([a-zA-Z]). The remainder of the string may contain 7-bit alphanumeric characters or underscore. @@ -80,6 +80,9 @@ Clear state and restart execution from top if signal is matched. Signal match is the same as for @code{CATCH}. +Existing bytecode in buffer is cleared before the jump. + + @subsection HALT Halt execution and yield control to client. diff --git a/doc/texinfo/navigation.texi b/doc/texinfo/navigation.texi @@ -51,7 +51,7 @@ Go to the next page of a multi-page node. Will fail if used in a single-page con @item < (0x3C) Go to the next page of a multi-page node. Will fail if used on the first (or single) page. @item ^ (0x5E) -Go to the topmost node. Will execute each intermediate node in the stack. +Go to the topmost node. Flushes all intermediate cache scopes (except the topmost). @end table diff --git a/doc/texinfo/signals.texi b/doc/texinfo/signals.texi @@ -36,10 +36,6 @@ For the numeric values of the signals, please refer to the signals appendix. @tab Input matched an @code{INCMP} instruction. @tab Next instruction. @tab no -@item @code{TERMINATE} -@tab Terminate execution before the following instruction. -@tab Until explicit reseet. -@tab no @item @code{DIRTY} @tab Rendered output is available. @tab Until output is processed. @@ -52,6 +48,10 @@ For the numeric values of the signals, please refer to the signals appendix. @tab An unexpected error has occurred during execution of an external code symbol. @tab Next instruction. @tab no +@item @code{TERMINATE} +@tab Terminate execution before the following instruction. +@tab Until explicit reseet. +@tab yes @item @code{LANG} @tab Output from an external code symbol is a valid language code, and language should be changed accordingly. @tab Next instruction. diff --git a/vm/runner.go b/vm/runner.go @@ -209,7 +209,7 @@ func(vm *Vm) runDeadCheck(ctx context.Context, b []byte) ([]byte, error) { input = []byte("(no input)") } cerr := NewInvalidInputError(string(input)) - vm.pg.WithError(cerr) + vm.pg.WithError(cerr) b = NewLine(nil, MOVE, []string{"_catch"}, nil, nil) return b, nil }