diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-04 18:23:10 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-04 18:23:50 -0400 |
| commit | 4d61bd6a5546e4ec6687042882afa04ad37bf700 (patch) | |
| tree | a38fb23004cc98eb32c302e60e66f96dfff3ca82 /docs | |
| parent | a1bfaaa7f9bb449a35d4f5d081bc1a9d2da6d91b (diff) | |
Recompile spec after adding null literal
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/spec/literal.html | 2 | ||||
| -rw-r--r-- | docs/spec/token.html | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/spec/literal.html b/docs/spec/literal.html index 04491352..1a5fea6a 100644 --- a/docs/spec/literal.html +++ b/docs/spec/literal.html @@ -6,7 +6,7 @@ <div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> <h1 id="specification-bqn-literal-notation">Specification: BQN literal notation</h1> <p>A <em>literal</em> is a single <a href="token.html">token</a> that indicates a fixed character, number, or array. While literals indicate values of a data type, <a href="primitive.html">primitives</a> indicate values of an operation type: function, 1-modifier, or 2-modifier.</p> -<p>Two types of literal deal with text. As the source code is considered to be a sequence of unicode code points ("characters"), and these code points are also used for BQN's character <a href="types.html">data type</a>, the representation of a text literal is very similar to its value. In a text literal, the newline character is always represented using the ASCII line feed character, code point 10. A <em>character literal</em> is enclosed with single quotes <code><span class='String'>'</span></code> and its value is identical to the single character between them. A <em>string literal</em> is enclosed in double quotes <code><span class='String'>"</span></code>, and any double quotes between them must come in pairs, as a lone double quote marks the end of the literal. The value of a string literal is a rank-1 array whose elements are the characters in between the enclosing quotes, after replacing each pair of double quotes with only one such quote.</p> +<p>Two types of literal deal with text. As the source code is considered to be a sequence of unicode code points ("characters"), and these code points are also used for BQN's character <a href="types.html">data type</a>, the representation of a text literal is very similar to its value. In a text literal, the newline character is always represented using the ASCII line feed character, code point 10. A <em>character literal</em> is enclosed with single quotes <code><span class='String'>'</span></code> and its value is identical to the single character between them. A <em>string literal</em> is enclosed in double quotes <code><span class='String'>"</span></code>, and any double quotes between them must come in pairs, as a lone double quote marks the end of the literal. The value of a string literal is a rank-1 array whose elements are the characters in between the enclosing quotes, after replacing each pair of double quotes with only one such quote. The <em>null literal</em> is the token <code><span class='String'>@</span></code> and represents the null character, code point 0.</p> <p>The format of a <em>numeric literal</em> is more complicated. From the <a href="token.html">tokenization rules</a>, a numeric literal consists of a numeric character (one of <code><span class='Number'>¯∞π.0123456789</span></code>) followed by any number of numeric or alphabetic characters. Some numeric literals are <em>valid</em> and indicate a number, while others are invalid and cause an error. The grammar for valid numbers is given below in a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">BNF</a> variant. Only four alphabetic characters are allowed: "i", which separates the real and imaginary components of a complex number, "e", which functions as in scientific notation, and the uppercase versions of these letters.</p> <pre><span class='Value'>number</span> <span class='Function'>=</span> <span class='Value'>component</span> <span class='Paren'>(</span> <span class='Paren'>(</span> <span class='String'>"i"</span> <span class='Function'>|</span> <span class='String'>"I"</span> <span class='Paren'>)</span> <span class='Value'>component</span> <span class='Paren'>)</span><span class='Value'>?</span> <span class='Value'>component</span> <span class='Function'>=</span> <span class='Value'>mantissa</span> <span class='Paren'>(</span> <span class='Paren'>(</span> <span class='String'>"e"</span> <span class='Function'>|</span> <span class='String'>"E"</span> <span class='Paren'>)</span> <span class='Value'>exponent</span> <span class='Paren'>)</span><span class='Value'>?</span> diff --git a/docs/spec/token.html b/docs/spec/token.html index 010c033e..d6650376 100644 --- a/docs/spec/token.html +++ b/docs/spec/token.html @@ -21,6 +21,10 @@ </thead> <tbody> <tr> +<td>Null literal</td> +<td><code><span class='String'>@</span></code></td> +</tr> +<tr> <td>Primitive Function</td> <td><code><span class='Function'>+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔</span></code></td> </tr> |
