diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-03 22:25:59 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-03 22:25:59 -0400 |
| commit | 22a33e01325ba2331a6b28dfc3d466c119d0834c (patch) | |
| tree | a53bb2a61cf97ed52e7ac1fefd494dbc7dc0636c /spec | |
| parent | ceaa82c6d1564b2ca7965c4f29b51f45ad1c2933 (diff) | |
Add the null character literal @
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/literal.md | 2 | ||||
| -rw-r--r-- | spec/token.md | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/spec/literal.md b/spec/literal.md index 2d4f2225..dad93acb 100644 --- a/spec/literal.md +++ b/spec/literal.md @@ -4,7 +4,7 @@ A *literal* is a single [token](token.md) that indicates a fixed character, number, or array. While literals indicate values of a data type, [primitives](primitive.md) indicate values of an operation type: function, 1-modifier, or 2-modifier. -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 [data type](types.md), 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 *character literal* is enclosed with single quotes `'` and its value is identical to the single character between them. A *string literal* is enclosed in double quotes `"`, 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. +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 [data type](types.md), 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 *character literal* is enclosed with single quotes `'` and its value is identical to the single character between them. A *string literal* is enclosed in double quotes `"`, 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 *null literal* is the token `@` and represents the null character, code point 0. The format of a *numeric literal* is more complicated. From the [tokenization rules](token.md), a numeric literal consists of a numeric character (one of `¯∞π.0123456789`) followed by any number of numeric or alphabetic characters. Some numeric literals are *valid* and indicate a number, while others are invalid and cause an error. The grammar for valid numbers is given below in a [BNF](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form) 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. diff --git a/spec/token.md b/spec/token.md index 173756f4..11c3d1fa 100644 --- a/spec/token.md +++ b/spec/token.md @@ -18,6 +18,7 @@ Otherwise, a single character forms a token. Only the specified set of character | Class | Characters |-----------------------|------------ +| Null literal | `@` | Primitive Function | `+-×÷⋆√⌊⌈\|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔` | Primitive 1-Modifier | `` ˙˜˘¨⌜⁼´˝` `` | Primitive 1-Modifier | `∘○⊸⟜⌾⊘◶⎉⚇⍟` |
