UNPKG

ecmarkup

Version:

Custom element definitions and core utilities for markup that specifies ECMAScript and related technologies.

440 lines (382 loc) 48.3 kB
<!doctype html> <head><meta charset="utf8"> <title>Ecmarkup</title> <script src="ecmarkup.js"></script> <link rel="stylesheet" href="elements.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/solarized_light.min.css"> </head><body><div id="menu-toggle"></div><div id="menu"><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#intro" title="Introduction"><span class="secnum"></span> Introduction</a></li><li><span class="item-toggle-none"></span><a href="#getting-started" title="Getting Started"><span class="secnum">1</span> Getting Started</a></li><li><span class="item-toggle-none"></span><a href="#metadata" title="Metadata"><span class="secnum">2</span> Metadata</a></li><li><span class="item-toggle"></span><a href="#clauses" title="Clauses"><span class="secnum">3</span> Clauses</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#emu-intro" title="emu-intro"><span class="secnum">3.1</span> emu-intro</a></li><li><span class="item-toggle-none"></span><a href="#emu-clause" title="emu-clause"><span class="secnum">3.2</span> emu-clause</a></li><li><span class="item-toggle-none"></span><a href="#emu-annex" title="emu-annex"><span class="secnum">3.3</span> emu-annex</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#emu-alg" title="emu-alg"><span class="secnum">4</span> emu-alg</a></li><li><span class="item-toggle-none"></span><a href="#emu-eqn" title="emu-eqn"><span class="secnum">5</span> emu-eqn</a></li><li><span class="item-toggle-none"></span><a href="#emu-note" title="emu-note"><span class="secnum">6</span> emu-note</a></li><li><span class="item-toggle-none"></span><a href="#emu-xref" title="emu-xref"><span class="secnum">7</span> emu-xref</a></li><li><span class="item-toggle-none"></span><a href="#emu-figure" title="emu-figure"><span class="secnum">8</span> emu-figure</a></li><li><span class="item-toggle-none"></span><a href="#emu-table" title="emu-table"><span class="secnum">9</span> emu-table</a></li><li><span class="item-toggle-none"></span><a href="#emu-example" title="emu-example"><span class="secnum">10</span> emu-example</a></li><li><span class="item-toggle-none"></span><a href="#emu-biblio" title="emu-biblio"><span class="secnum">11</span> emu-biblio</a></li><li><span class="item-toggle"></span><a href="#grammar" title="Specifying Grammar"><span class="secnum">12</span> Specifying Grammar</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#emu-grammar" title="emu-grammar"><span class="secnum">12.1</span> emu-grammar</a></li><li><span class="item-toggle-none"></span><a href="#emu-production" title="emu-production"><span class="secnum">12.2</span> emu-production</a></li><li><span class="item-toggle-none"></span><a href="#emu-rhs" title="emu-rhs"><span class="secnum">12.3</span> emu-rhs</a></li><li><span class="item-toggle-none"></span><a href="#emu-nt" title="emu-nt"><span class="secnum">12.4</span> emu-nt</a></li><li><span class="item-toggle-none"></span><a href="#emu-t" title="emu-t"><span class="secnum">12.5</span> emu-t</a></li><li><span class="item-toggle-none"></span><a href="#emu-gmod" title="emu-gmod"><span class="secnum">12.6</span> emu-gmod</a></li><li><span class="item-toggle-none"></span><a href="#emu-gann" title="emu-gann"><span class="secnum">12.7</span> emu-gann</a></li><li><span class="item-toggle-none"></span><a href="#emu-gprose" title="emu-gprose"><span class="secnum">12.8</span> emu-gprose</a></li><li><span class="item-toggle-none"></span><a href="#emu-prodref" title="emu-prodref"><span class="secnum">12.9</span> emu-prodref</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#imports" title="Imports"><span class="secnum">13</span> Imports</a></li><li><span class="item-toggle"></span><a href="#css" title="Other Styles &amp; Conventions"><span class="secnum">14</span> Other Styles &amp; Conventions</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#ins-del" title="ins &amp; del"><span class="secnum">14.1</span> ins &amp; del</a></li></ol></li></ol></div></div> <emu-biblio href="./biblio.json"></emu-biblio> <h1>Ecmarkup Documentation</h1> <emu-intro id="intro"> <h1><span class="secnum"></span>Introduction<span class="utils"><span class="anchor"><a href="#intro">#</a></span></span></h1> <p><a href="https://github.com/bterlson/ecmarkup">Ecmarkup</a> is a number of custom elements and a toolchain suitable for formally specifying semantics for ECMAScript proposals.</p> <p>Ecmarkup offers the following conveniences (among many others):</p> <ul> <li><a href="https://github.com/domenic/ecmarkdown">Ecmarkdown</a> syntax for paragraphs and algorithms</li> <li><a href="https://github.com/rbuckton/grammarkdown">Grammarkdown</a> for specifying grammar</li> <li>Terse markup for the authoring conventions used in ECMAScript specifications including clauses, notes, examples, figures, tables, and more.</li> <li>Easy cross-references by element ID to clauses, abstract operations, examples, figures, tables, and etc. in the current document, ES6, and other specs.</li> <li>Generates table of contents</li> <li>Generates clause ids based on document position</li> <li>Auto-links abstract operations and terms based on name with support for external bibliographies for cross-referencing between specs</li> <li>Source code syntax highlighting inside pre code blocks</li> </ul> <p>This document is itself written using Ecmarkup. Its source can be viewed <a href="https://github.com/bterlson/ecmarkup/blob/master/spec/index.html">on github</a>. Additionally, you can view the <a href="https://tc39.github.io/Array.prototype.includes/">Array.prototype.includes proposal</a> in Ecmarkup format.</p> </emu-intro> <emu-clause id="getting-started"> <h1><span class="secnum">1</span>Getting Started<span class="utils"><span class="anchor"><a href="#getting-started">#</a></span></span></h1> <pre>npm install -g ecmarkup ecmarkup --help ecmarkup spec.html out.html </pre> <h2>Stylesheet</h2> <p>Styles are provided by <code>elements.css</code> under the <code>css</code> directory. The --css command line option will emit the CSS file to a location of your choosing. You may also link to https://bterlson.github.io/ecmarkup/elements.css which will contain the latest styles for the forseeable future (though I don't promise this won't break you if you're not tracking the latest version).</p> </emu-clause> <emu-clause id="metadata"> <h1><span class="secnum">2</span>Metadata<span class="utils"><span class="anchor"><a href="#metadata">#</a></span></span></h1> <p>There are a number of settings that allow customizations or enable generation of boilerplate. Metadata can be included in the document and passed on the command line, for example <code>--no-toc --title "Document 1"</code>. Metadata given on the command line takes precedence.</p> <p>To add metadata to your document, use yaml syntax inside a <code>&lt;pre class=metadata&gt;</code> element somewhere in the root of your document.</p> <p>The following table lists the currently supported metadata:</p> <table> <tbody><tr><th>Option</th><th>Description</th></tr> <tr><td>toc</td><td>Emit table of contents. Boolean, default true.</td></tr> </tbody></table> <h2>Example document with metadata</h2> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">pre</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">metadata</span>&gt;</span> Title: Document 1 toc: false <span class="hljs-tag">&lt;/<span class="hljs-title">pre</span>&gt;</span> </code></pre> </emu-clause> <emu-clause id="clauses"> <h1><span class="secnum">3</span>Clauses<span class="utils"><span class="anchor"><a href="#clauses">#</a></span></span></h1> <p>Clauses are referenced using their id and are numbered automatically based on document position. Ecmarkdown syntax can be used in descendent text nodes as well. Text nodes are parsed as Ecmarkdown Fragments.</p> <emu-clause id="emu-intro"> <h1><span class="secnum">3.1</span>emu-intro<span class="utils"><span class="anchor"><a href="#emu-intro">#</a></span></span></h1> <p>Non-normative introductory information.</p> <h2>Attributes</h2> <p><b>id:</b> Clause id. Must be unique.</p> <p><b>aoid:</b> Abstract operation ID. A unique name identifying this clause as an abstract operation. Algorithm steps will auto-link calls to this abstract operation to this clause. If left blank, the aoid will be <emu-xref href="#sec-set-o-p-v-throw"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-set-o-p-v-throw">set</a></emu-xref> to the id of this clause.</p> </emu-clause> <emu-clause id="emu-clause"> <h1><span class="secnum">3.2</span>emu-clause<span class="utils"><span class="anchor"><a href="#emu-clause">#</a></span></span></h1> <p>Normative clause.</p> <h2>Attributes</h2> <p><b>id:</b> Clause id. Must be unique.</p> <p><b>aoid:</b> Abstract operation ID. A unique name identifying this clause as an abstract operation. Algorithm steps will auto-link calls to this abstract operation to this clause. If left blank, the aoid will be <emu-xref href="#sec-set-o-p-v-throw"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-set-o-p-v-throw">set</a></emu-xref> to the id of this clause.</p> </emu-clause> <emu-clause id="emu-annex"> <h1><span class="secnum">3.3</span>emu-annex<span class="utils"><span class="anchor"><a href="#emu-annex">#</a></span></span></h1> <p>Annex clause.</p> <h2>Attributes</h2> <p><b>normative:</b> If present, annex is normative. Default is non-normative.</p> <p><b>id:</b> Clause id. Must be unique.</p> <p><b>aoid:</b> Abstract operation ID. A unique name identifying this clause as an abstract operation. Algorithm steps will auto-link calls to this abstract operation to this clause. If left blank, the aoid will be <emu-xref href="#sec-set-o-p-v-throw"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-set-o-p-v-throw">set</a></emu-xref> to the id of this clause.</p> </emu-clause> </emu-clause> <emu-clause id="emu-alg" aoid="EmuAlg"> <h1><span class="secnum">4</span>emu-alg<span class="utils"><span class="anchor"><a href="#emu-alg">#</a></span></span></h1> <p>Algorithm steps. Should not contain any HTML. The node's textContent is parsed as an Ecmarkdown document. Additionally, calls to abstract operations inside algorithm steps are automatically linked to their definitions by first checking for any clauses or algorithms with the appropriate "aoid" in the current spec, and afterwards checking any linked <a href="#emu-biblio">bibliography files</a>.</p> <h2>Example</h2> <emu-note><span class="note">Note</span>The emu-alg clause has an aoid of "EmuAlg".</emu-note> <h3>Element</h3> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">emu-alg</span> <span class="hljs-attribute">aoid</span>=<span class="hljs-value">"EmuAlgExample"</span>&gt;</span> 1. let _clauseAbstractOp_ be the result of calling EmuAlg() 2. Step 2 1. let _recurse_ be the result of calling EmuAlgExample(`true`) 2. Return the result of evaluating this |NonTerminalProduction| <span class="hljs-tag">&lt;/<span class="hljs-title">emu-alg</span>&gt;</span> </code></pre> <h3>Result</h3> <emu-alg aoid="EmuAlgExample"><ol><li>let <var>clauseAbstractOp</var> be the result of calling <a href="#emu-alg">EmuAlg</a>()</li><li>Step 2<ol><li>let <var>recurse</var> be the result of calling EmuAlgExample(<code>true</code>)</li><li>Return the result of evaluating this <emu-nt>NonTerminalProduction</emu-nt></li></ol></li></ol></emu-alg> </emu-clause> <emu-clause id="emu-eqn"> <h1><span class="secnum">5</span>emu-eqn<span class="utils"><span class="anchor"><a href="#emu-eqn">#</a></span></span></h1> <p>An equation, similar to those found in ES6 <emu-xref href="#sec-year-number"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-year-number">20.3.1.3</a></emu-xref>.</p> <h2>Attributes</h2> <p><b>aoid:</b> Required: the abstract operation id that this equation defines.</p> </emu-clause> <emu-clause id="emu-note"> <h1><span class="secnum">6</span>emu-note<span class="utils"><span class="anchor"><a href="#emu-note">#</a></span></span></h1> <p>Non-normative explanatory text.</p> <h2>Example</h2> <p>For authentication only, servers and clients MUST support SASL Salted Challenge Response Authentication Mechanism [SCRAM].</p> <emu-note><span class="note">Note</span>But we know you won't.</emu-note> </emu-clause> <emu-clause id="emu-xref"> <h1><span class="secnum">7</span>emu-xref<span class="utils"><span class="anchor"><a href="#emu-xref">#</a></span></span></h1> <p>Cross-<emu-xref href="#sec-reference-specification-type"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-reference-specification-type">reference</a></emu-xref> another clause, production, note, example, or abstract operation. If the text content of this element is empty, a suitable default is used. The <code>title</code> attribute controls this default - when present, clauses are referred to using their title rather than number. This also applies to examples which are indexed first by their containing clause and then their example number.</p> <p>Cross-references to an id check for clauses, productions, and examples in this order. For each <emu-xref href="#sec-ecmascript-data-types-and-values"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values">type</a></emu-xref>, the local document is consulted before looking for external sources including the default ES6 biblio.</p> <h2>Attributes</h2> <p><b>href:</b> Optional: URL of the target clause, production, or example to cross-<emu-xref href="#sec-reference-specification-type"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-reference-specification-type">reference</a></emu-xref>.</p> <p><b>title:</b> Optional: If present, xref will be filled in with the referenced clause's title. Otherwise, the clause's section number is used.</p> <p><b>aoid:</b> Optional: aoid of an abstract operation to <emu-xref href="#sec-reference-specification-type"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-reference-specification-type">reference</a></emu-xref>.</p> <p>One of aoid or href must be specified.</p> <h2>Example</h2> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>The clause element is specified in <span class="hljs-tag">&lt;<span class="hljs-title">emu-xref</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"#emu-clause"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-xref</span>&gt;</span>.<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>See <span class="hljs-tag">&lt;<span class="hljs-title">emu-xref</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"#emu-note"</span> <span class="hljs-attribute">title</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-xref</span>&gt;</span> for information on the emu-note element.<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>The <span class="hljs-tag">&lt;<span class="hljs-title">emu-xref</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"#emu-biblio"</span>&gt;</span>biblio element<span class="hljs-tag">&lt;/<span class="hljs-title">emu-xref</span>&gt;</span> supports xref to external specs.<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-xref</span> <span class="hljs-attribute">aoid</span>=<span class="hljs-value">"Get"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-xref</span>&gt;</span> is an abstract operation from ES6<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span> </code></pre> <b>Result</b> <p>The clause element is specified in <emu-xref href="#emu-clause"><a href="#emu-clause">3.2</a></emu-xref>.</p> <p>See <emu-xref href="#emu-note" title=""><a href="#emu-note">emu-note</a></emu-xref> for information on the emu-note element.</p> <p>The <emu-xref href="#emu-biblio"><a href="#emu-biblio">biblio element</a></emu-xref> will eventually support xref to external specs.</p> <p><emu-xref aoid="Get"><a href="http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-o-p">Get</a></emu-xref> is an abstract operation from ES6</p> </emu-clause> <emu-clause id="emu-figure"> <h1><span class="secnum">8</span>emu-figure<span class="utils"><span class="anchor"><a href="#emu-figure">#</a></span></span></h1> <p>Creates a figure that can be xrefed by ID using the <code>emu-xref</code> element.</p> <h2>Attributes</h2> <p><b>caption:</b> Optional: Caption for the example</p> <p><b>informative:</b> Optional: If present, the figure is informative. Otherwise it is normative.</p> <h2>Example</h2> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">emu-figure</span> <span class="hljs-attribute">caption</span>=<span class="hljs-value">"Example figure"</span>&gt;</span> [[insert some awesome graphic here, maybe something like figure 2]] <span class="hljs-tag">&lt;/<span class="hljs-title">emu-figure</span>&gt;</span> </code></pre> <emu-figure caption="Example figure"><figure><figcaption>Figure 1: Example figure</figcaption> [[insert some awesome graphic here, maybe something like figure 2]] </figure></emu-figure> </emu-clause> <emu-clause id="emu-table"> <h1><span class="secnum">9</span>emu-table<span class="utils"><span class="anchor"><a href="#emu-table">#</a></span></span></h1> <p>Creates a table that can be xrefed by ID using the <code>emu-xref</code> element.</p> <h2>Attributes</h2> <p><b>caption:</b> Optional: Caption for the example</p> <p><b>informative:</b> Optional: If present, the table is informative. Otherwise it is normative.</p> <h2>Example</h2> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">emu-table</span> <span class="hljs-attribute">caption</span>=<span class="hljs-value">"Example table"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">table</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">tr</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">th</span>&gt;</span>Column 1<span class="hljs-tag">&lt;/<span class="hljs-title">th</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">th</span>&gt;</span>Column 2<span class="hljs-tag">&lt;/<span class="hljs-title">th</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">tr</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">tr</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value 2<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">tr</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">tr</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value 2<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">tr</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">tr</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value 2<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">tr</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">tr</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">td</span>&gt;</span>Value 2<span class="hljs-tag">&lt;/<span class="hljs-title">td</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">tr</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">table</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-table</span>&gt;</span> </code></pre> <emu-table caption="Example table"><figure><figcaption>Table 1: Example table</figcaption> <table> <tbody><tr><th>Column 1</th><th>Column 2</th></tr> <tr><td>Value</td><td>Value 2</td></tr> <tr><td>Value</td><td>Value 2</td></tr> <tr><td>Value</td><td>Value 2</td></tr> <tr><td>Value</td><td>Value 2</td></tr> </tbody></table> </figure></emu-table> </emu-clause> <emu-clause id="emu-example"> <h1><span class="secnum">10</span>emu-example<span class="utils"><span class="anchor"><a href="#emu-example">#</a></span></span></h1> <p>Creates an informative example. Examples are numbered based on how many are present in the example's containing clause. Can be xrefed by ID using <code>emu-xref</code>.</p> <h2>Attributes</h2> <p><b>caption:</b> Optional: Caption for the example</p> <h2>Example</h2> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">emu-example</span> <span class="hljs-attribute">caption</span>=<span class="hljs-value">"Example Example"</span>&gt;</span> This is an example. <span class="hljs-tag">&lt;/<span class="hljs-title">emu-example</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-example</span> <span class="hljs-attribute">caption</span>=<span class="hljs-value">"Another Example Example"</span>&gt;</span> This is also an example. <span class="hljs-tag">&lt;/<span class="hljs-title">emu-example</span>&gt;</span> </code></pre> <emu-example caption="Example Example"><figure><figcaption>Example 1 (Informative): Example Example</figcaption> This is an example. </figure></emu-example> <emu-example caption="Another Example Example"><figure><figcaption>Example 2 (Informative): Another Example Example</figcaption> This is also an example. </figure></emu-example> </emu-clause> <emu-clause id="emu-biblio"> <h1><span class="secnum">11</span>emu-biblio<span class="utils"><span class="anchor"><a href="#emu-biblio">#</a></span></span></h1> <p>Links a bibliography file. The bibliography file is a JSON document containing URLs for referenced documents along with any algorithms they define.</p> <h2>Attributes</h2> <p><b>href:</b> Required: URL to the biblio file.</p> <h2>Example</h2> <b>biblio.js</b> <pre><code class="language-json hljs">{ "<span class="hljs-attribute">http://people.mozilla.org/~jorendorff/es6-draft.html</span>": <span class="hljs-value">{ "<span class="hljs-attribute">abstract operations</span>": <span class="hljs-value">{ "<span class="hljs-attribute">ReturnIfAbrupt</span>": <span class="hljs-value"><span class="hljs-string">"#sec-returnifabrupt"</span></span>, "<span class="hljs-attribute">Get</span>": <span class="hljs-value"><span class="hljs-string">"#sec-get-o-p"</span> </span>} </span>} </span>}</code></pre> <b>spec.js</b> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">emu-biblio</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"./spec.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-biblio</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-alg</span>&gt;</span> 1. let _res_ be some value. 2. ReturnIfAbrupt(_res_) <span class="hljs-tag">&lt;/<span class="hljs-title">emu-alg</span>&gt;</span> </code></pre> <b>Result</b> <emu-alg><ol><li>let <var>res</var> be <a href="http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-o-p">Get</a>(<var>obj</var>, <var>key</var>).</li><li><a href="http://people.mozilla.org/~jorendorff/es6-draft.html#sec-returnifabrupt">ReturnIfAbrupt</a>(<var>res</var>);</li></ol></emu-alg> </emu-clause> <emu-clause id="grammar"> <h1><span class="secnum">12</span>Specifying Grammar<span class="utils"><span class="anchor"><a href="#grammar">#</a></span></span></h1> <p>There are two ways to specify grammar in Ecmarkup: using the <a href="#emu-production">emu-production</a> element and related elements, or by using the <a href="#emu-grammar">emu-grammar</a> element which allows specifying grammar using a plaintext format.</p> <h2>Examples</h2> <b>WhileStatement</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"WhileStatement"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span>while ( <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>Expression<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span> ) <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>Statement<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="WhileStatement" id="prod-WhileStatement"> <emu-nt><a href="#prod-WhileStatement">WhileStatement</a><emu-mods></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-t>while</emu-t><emu-t>(</emu-t><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-Expression">Expression</a><emu-mods></emu-mods></emu-nt><emu-t>)</emu-t><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-Statement">Statement</a><emu-mods></emu-mods></emu-nt></emu-rhs> </emu-production> <b>ArgumentList</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"ArgumentList"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>AssignmentExpression<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>ArgumentList<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span> , <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>AssignmentExpression<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="ArgumentList" id="prod-ArgumentList"> <emu-nt><a href="#prod-ArgumentList">ArgumentList</a><emu-mods></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods></emu-mods></emu-nt></emu-rhs> <emu-rhs><emu-nt><a href="#prod-ArgumentList">ArgumentList</a><emu-mods></emu-mods></emu-nt><emu-t>,</emu-t><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods></emu-mods></emu-nt></emu-rhs> </emu-production> <b>IterationStatement</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"IterationStatement"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span>for ( <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>LexicalDeclaration<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span> ; <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span> <span class="hljs-attribute">optional</span>&gt;</span>Expression<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span> ; <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span> <span class="hljs-attribute">optional</span>&gt;</span>Expression<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span> ) <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>Statement<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="IterationStatement" id="prod-IterationStatement"> <emu-nt><a href="#prod-IterationStatement">IterationStatement</a><emu-mods></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-t>for</emu-t><emu-t>(</emu-t><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-LexicalDeclaration">LexicalDeclaration</a><emu-mods></emu-mods></emu-nt><emu-t>;</emu-t><emu-nt optional=""><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt><emu-t>;</emu-t><emu-nt optional=""><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt><emu-t>)</emu-t><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-Statement">Statement</a><emu-mods></emu-mods></emu-nt></emu-rhs> </emu-production> <b>Identifier</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"Identifier"</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"lexical"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>IdentifierName<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-gmod</span>&gt;</span>but not <span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>ReservedWord<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-gmod</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="Identifier" type="lexical" id="prod-Identifier"> <emu-nt><a href="#prod-Identifier">Identifier</a><emu-mods></emu-mods></emu-nt><emu-geq>::</emu-geq><emu-rhs><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-IdentifierName">IdentifierName</a><emu-mods></emu-mods></emu-nt><emu-gmod>but not <emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-ReservedWord">ReservedWord</a><emu-mods></emu-mods></emu-nt></emu-gmod></emu-rhs> </emu-production> <b>SourceCharacter</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"SourceCharacter"</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"lexical"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-gprose</span>&gt;</span>any Unicode code point<span class="hljs-tag">&lt;/<span class="hljs-title">emu-gprose</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="SourceCharacter" type="lexical" id="prod-SourceCharacter"> <emu-nt><a href="#prod-SourceCharacter">SourceCharacter</a><emu-mods></emu-mods></emu-nt><emu-geq>::</emu-geq><emu-rhs><emu-gprose>any Unicode code point</emu-gprose></emu-rhs> </emu-production> <b>ExpressionStatement</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"ExpressionStatement"</span> <span class="hljs-attribute">params</span>=<span class="hljs-value">"Yield"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-gann</span>&gt;</span>lookahead ∉ { <span class="hljs-tag">&lt;<span class="hljs-title">emu-t</span>&gt;</span>{<span class="hljs-tag">&lt;/<span class="hljs-title">emu-t</span>&gt;</span>, <span class="hljs-tag">&lt;<span class="hljs-title">emu-t</span>&gt;</span>function<span class="hljs-tag">&lt;/<span class="hljs-title">emu-t</span>&gt;</span>, <span class="hljs-tag">&lt;<span class="hljs-title">emu-t</span>&gt;</span>class<span class="hljs-tag">&lt;/<span class="hljs-title">emu-t</span>&gt;</span>, <span class="hljs-tag">&lt;<span class="hljs-title">emu-t</span>&gt;</span>let [<span class="hljs-tag">&lt;/<span class="hljs-title">emu-t</span>&gt;</span> }<span class="hljs-tag">&lt;/<span class="hljs-title">emu-gann</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="ExpressionStatement" params="Yield" id="prod-ExpressionStatement"> <emu-nt params="Yield"><a href="#prod-ExpressionStatement">ExpressionStatement</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-gann>[lookahead ∉ { <emu-t>{</emu-t>, <emu-t>function</emu-t>, <emu-t>class</emu-t>, <emu-t>let [</emu-t> }]</emu-gann></emu-rhs> </emu-production> <b>DecimalDigit</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"DecimalDigit"</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"lexical"</span> <span class="hljs-attribute">oneof</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span>0 1 2 3 4 5 6 7 8 9<span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="DecimalDigit" type="lexical" oneof="" id="prod-DecimalDigit"> <emu-nt><a href="#prod-DecimalDigit">DecimalDigit</a><emu-mods></emu-mods></emu-nt><emu-geq>::</emu-geq><emu-oneof>one of</emu-oneof><emu-rhs><emu-t>0</emu-t><emu-t>1</emu-t><emu-t>2</emu-t><emu-t>3</emu-t><emu-t>4</emu-t><emu-t>5</emu-t><emu-t>6</emu-t><emu-t>7</emu-t><emu-t>8</emu-t><emu-t>9</emu-t></emu-rhs> </emu-production> <b>StatementList</b> <pre><code class="language-html hljs"><span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"StatementList"</span> <span class="hljs-attribute">params</span>=<span class="hljs-value">"Return, In"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span> <span class="hljs-attribute">constraints</span>=<span class="hljs-value">"~Return"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>ReturnStatement<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>ExpressionStatement<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span></code></pre> <emu-production name="StatementList" params="Return, In" id="prod-StatementList"> <emu-nt params="Return, In"><a href="#prod-StatementList">StatementList</a><emu-mods><emu-params>[Return, In]</emu-params></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs constraints="~Return"><emu-constraints>[~Return]</emu-constraints><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-ReturnStatement">ReturnStatement</a><emu-mods></emu-mods></emu-nt></emu-rhs> <emu-rhs><emu-nt><a href="#prod-ExpressionStatement">ExpressionStatement</a><emu-mods></emu-mods></emu-nt></emu-rhs> </emu-production> <emu-clause id="emu-grammar"> <h1><span class="secnum">12.1</span>emu-grammar<span class="utils"><span class="anchor"><a href="#emu-grammar">#</a></span></span></h1> <p>Text inside emu-grammar elements is parsed using <a href="https://github.com/rbuckton/grammarkdown">Grammarkdown</a>. The syntax is essentially identical to the notational conventions in ECMAScript (minus formatting). See the <a href="https://github.com/rbuckton/grammarkdown">Grammarkdown readme</a>.</p> </emu-clause> <emu-clause id="emu-production"> <h1><span class="secnum">12.2</span>emu-production<span class="utils"><span class="anchor"><a href="#emu-production">#</a></span></span></h1> <p>This is the top level element that contains all grammar productions. Each production MUST include at least one right-hand side (see <a href="#emu-rhs">emu-rhs</a>).</p> <h2>Attributes</h2> <p><b>Name:</b> Required. Name of the production (i.e. the non-terminal on the LHS).</p> <p><b>Params:</b> Parameters for this production. Multiple parameters separated by commas.</p> <p><b><emu-xref href="#sec-ecmascript-data-types-and-values"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values">Type</a></emu-xref>:</b> <emu-xref href="#sec-ecmascript-data-types-and-values"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values">Type</a></emu-xref> of production, either "lexical" or "regexp". Default is blank (normal).</p> <p><b>oneof:</b> If present, production is a one-of production. See DecimalDigit example above.</p> </emu-clause> <emu-clause id="emu-rhs"> <h1><span class="secnum">12.3</span>emu-rhs<span class="utils"><span class="anchor"><a href="#emu-rhs">#</a></span></span></h1> <p>Describes one right-hand-side alternative of a production. Text nodes inside of an rhs are split on each space and turned into terminals. For example, </p><pre>&lt;emu-rhs&gt;a b c&lt;/emu-rhs&gt;</pre> is semantically equivalent to <pre>&lt;emu-rhs&gt;&lt;emu-t&gt;a&lt;/emu-t&gt; &lt;emu-t&gt;b&lt;/emu-t&gt; &lt;emu-t&gt;c&lt;/emu-t&gt;</pre><p></p> <h2>Attributes</h2> <p><b>constraints:</b> any constraints for this RHS. Multiple constraints separated by commas. See StatementList example above.</p> <p><b>a:</b> Optional alternative id used to <emu-xref href="#sec-reference-specification-type"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-reference-specification-type">reference</a></emu-xref> a particular RHS via <code>emu-prodref</code>. Must be unique for all <code>emu-rhs</code> elements inside an emu-production. Example might be `<emu-rhs a="1">`.</emu-rhs></p> </emu-clause> <emu-clause id="emu-nt"> <h1><span class="secnum">12.4</span>emu-nt<span class="utils"><span class="anchor"><a href="#emu-nt">#</a></span></span></h1> <p>Non-terminal. Alpha characters only.</p> <h2>Attributes</h2> <p><b>Params:</b> Parameters for this production. Multiple parameters separated by commas.</p> <p><b>oneof:</b> If present, production is a one-of production (see DecimalDigit example above).</p> </emu-clause> <emu-clause id="emu-t"> <h1><span class="secnum">12.5</span>emu-t<span class="utils"><span class="anchor"><a href="#emu-t">#</a></span></span></h1> <p>Terminal. No attributes available. Mostly don't need to create these elements manually as <a href="#emu-rhs">they are created automatically inside emu-rhs elements</a>.</p> </emu-clause> <emu-clause id="emu-gmod"> <h1><span class="secnum">12.6</span>emu-gmod<span class="utils"><span class="anchor"><a href="#emu-gmod">#</a></span></span></h1> <p>Contains well-known modifiers to a right-hand side of a production. The only well-known modifier at present is the "but not" modifier. See the Identifier example above.</p> </emu-clause> <emu-clause id="emu-gann"> <h1><span class="secnum">12.7</span>emu-gann<span class="utils"><span class="anchor"><a href="#emu-gann">#</a></span></span></h1> <p>Contains well-known annotations to to a right-hand side of a production. The only well-known modifiers at present are "lookahead" and "empty". See the ExpressionStatement example above. Any text inside a gann element is wrapped in square brackets.</p> </emu-clause> <emu-clause id="emu-gprose"> <h1><span class="secnum">12.8</span>emu-gprose<span class="utils"><span class="anchor"><a href="#emu-gprose">#</a></span></span></h1> <p>Contains any prose text that describes a production. See SourceCharacter example above.</p> </emu-clause> <emu-clause id="emu-prodref"> <h1><span class="secnum">12.9</span>emu-prodref<span class="utils"><span class="anchor"><a href="#emu-prodref">#</a></span></span></h1> <p>References a production defined elsewhere in the document. Ecmarkup will insert either the entire production or a particular RHS depending on attributes.</p> <h2>Attributes</h2> <p><b>name:</b> Required. Name of the production to <emu-xref href="#sec-reference-specification-type"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-reference-specification-type">reference</a></emu-xref>.</p> <p><b>a:</b> Optional. If present, specified a particular alternative ID to <emu-xref href="#sec-reference-specification-type"><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-reference-specification-type">reference</a></emu-xref>.</p> </emu-clause> </emu-clause> <emu-clause id="imports"> <h1><span class="secnum">13</span>Imports<span class="utils"><span class="anchor"><a href="#imports">#</a></span></span></h1> <p>HTML Imports are treated specially in an ecmarkup document. Every import is inlined into its parent document at the location of the import tag. This is useful for breaking your spec document up into many smaller pieces.</p> </emu-clause> <emu-clause id="css"> <h1><span class="secnum">14</span>Other Styles &amp; Conventions<span class="utils"><span class="anchor"><a href="#css">#</a></span></span></h1> <emu-clause id="ins-del"> <h1><span class="secnum">14.1</span>ins &amp; del<span class="utils"><span class="anchor"><a href="#ins-del">#</a></span></span></h1> <p>The <code>ins</code> and <code>del</code> HTML tags can be used to mark insertions and deletions respectively. When adding or removing block content (such as entire list items, paragrpahs, clauses, grammar RHSes, etc.), use a class of "block".</p> <h2>Inline Example:</h2> <pre><code class="language-html hljs">ECMAScript <span class="hljs-tag">&lt;<span class="hljs-title">del</span>&gt;</span>6<span class="hljs-tag">&lt;/<span class="hljs-title">del</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">ins</span>&gt;</span>2015<span class="hljs-tag">&lt;/<span class="hljs-title">ins</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">del</span>&gt;</span>will be ratified<span class="hljs-tag">&lt;/<span class="hljs-title">del</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">ins</span>&gt;</span>was ratified<span class="hljs-tag">&lt;/<span class="hljs-title">ins</span>&gt;</span> in June, 2015.</code></pre> <h3>Result:</h3> <p>ECMAScript <del>6</del><ins>2015</ins> <del>will be ratified</del><ins>was ratified</ins> in June, 2015.</p> <h2>Block Example:</h2> <pre><code class="language-html hljs"> <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>|HoistableDeclaration| is modified as follows:<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-production</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"HoistableDeclaration"</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>FunctionDeclaration<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>GeneratorDeclaration<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span> <span class="hljs-tag">&lt;<span class="hljs-title">ins</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">"block"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">emu-nt</span>&gt;</span>AsyncFunctionDeclaration<span class="hljs-tag">&lt;/<span class="hljs-title">emu-nt</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">emu-rhs</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">ins</span>&gt;</span> <span class="hljs-tag">&lt;/<span class="hljs-title">emu-production</span>&gt;</span> </code></pre> <h3>Result:</h3> <p><emu-nt>HoistableDeclaration</emu-nt> is modified as follows:</p> <emu-production name="HoistableDeclaration" id="prod-HoistableDeclaration"> <emu-nt><a href="#prod-HoistableDeclaration">HoistableDeclaration</a><emu-mods></emu-mods></emu-nt><emu-geq>:</emu-geq><emu-rhs><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods></emu-mods></emu-nt></emu-rhs> <emu-rhs><emu-nt><a href="http://www.ecma-international.org/ecma-262/6.0/index.html#prod-GeneratorDeclaration">GeneratorDeclaration</a><emu-mods></emu-mods></emu-nt></emu-rhs> <ins class="block"><emu-rhs><emu-nt>AsyncFunctionDeclaration<emu-mods></emu-mods></emu-nt></emu-rhs></ins> </emu-production> </emu-clause> </emu-clause> </body>