aboutsummaryrefslogtreecommitdiff
path: root/docs/spec/literal.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-18 18:26:52 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-18 18:29:59 -0400
commit229e2cd2f5c78b13c483a8559dead2c8f31d8e42 (patch)
tree9d6a1ff0100bda7632948987352b3d6614c3eeb5 /docs/spec/literal.html
parent010b97c8cf346dfeafc289ae66f77e8c61cd9865 (diff)
Terminology changes: subject, 1/2-modifier, Box/Unbox to Enclose/Merge, blocks
Diffstat (limited to 'docs/spec/literal.html')
-rw-r--r--docs/spec/literal.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/spec/literal.html b/docs/spec/literal.html
index c4914753..2d03bc68 100644
--- a/docs/spec/literal.html
+++ b/docs/spec/literal.html
@@ -1,5 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
-<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 data of a value type, <a href="primitive.html">primitives</a> indicate data of a function type: function, modifier, or composition.</p>
+<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 (&quot;characters&quot;), 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>'</code> and its value is identical to the single character between them. A <em>string literal</em> is enclosed in double quotes <code>&quot;</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>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: &quot;i&quot;, which separates the real and imaginary components of a complex number, &quot;e&quot;, 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'>&quot;i&quot;</span> <span class='Function'>|</span> <span class='String'>&quot;I&quot;</span> <span class='Paren'>)</span> <span class='Value'>component</span> <span class='Paren'>)</span><span class='Value'>?</span>