diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-15 16:59:32 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-15 16:59:32 -0400 |
| commit | 4f618598f2f31bc466343e4d304f35b53a366da6 (patch) | |
| tree | f645f16425939a45ac82fcd0b3b477f9030bc7d9 /spec/token.md | |
| parent | e858f41dffaee272ffcf4b2cb63a49ad25ebf7d7 (diff) | |
Finish namespace specification
Diffstat (limited to 'spec/token.md')
| -rw-r--r-- | spec/token.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/token.md b/spec/token.md index 91608c47..d97a6a73 100644 --- a/spec/token.md +++ b/spec/token.md @@ -10,7 +10,7 @@ A BQN *character literal* consists of a single character between single quotes, A comment consists of the hash character `#` and any following text until (not including) the next newline character. The initial `#` must not be part of a string literal started earlier. Comments are ignored entirely and do not form tokens. -Identifiers and numeric literals share the same token formation rule. These tokens are formed from the *numeric characters* `Β―βΟ.0123456789` and *alphabetic characters* `_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` and the oddball `π£`. Any sequence of these characters adjacent to each other forms a single token, which is a *numeric literal* if it begins with a numeric character and an *identifier* if it begins with an alphabetic character. If a token begins with an underscore then its first non-underscore character must be alphabetic: for example, `_99` is not a valid token. Numeric literals are also subject to [numeric literal rules](literal.md), which specify which numeric literals are valid and which numbers they represent. If the token contains `π£` it must be either `π£`, `_π£`, or `_π£_` and is considered a special name (see below). As the value taken by this identifier can only be a modifier, the uppercase character `β` is not allowed. +Identifiers and numeric literals share the same token formation rule. These tokens are formed from the *numeric characters* `Β―βΟ0123456789` and *alphabetic characters* `_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` and the oddball `π£`. Additionally, `.` is considered a numeric character if it is followed immediately by a digit (`0123456789`); otherwise it forms its own token. Any sequence of these characters adjacent to each other forms a single token, which is a *numeric literal* if it begins with a numeric character and an *identifier* if it begins with an alphabetic character. If a token begins with an underscore then its first non-underscore character must be alphabetic: for example, `_99` is not a valid token. Numeric literals are also subject to [numeric literal rules](literal.md), which specify which numeric literals are valid and which numbers they represent. If the token contains `π£` it must be either `π£`, `_π£`, or `_π£_` and is considered a special name (see below). As the value taken by this identifier can only be a modifier, the uppercase character `β` is not allowed. Following this step, the whitespace characters space and tab are ignored, and do not form tokens. Only these whitespace characters, and the newline character, which does form a token, are allowed. @@ -19,10 +19,10 @@ Otherwise, a single character forms a token. Only the specified set of character | Class | Characters |-----------------------|------------ | Null literal | `@` -| Primitive Function | `+-ΓΓ·ββββ\|Β¬β§β¨<>β =β€β₯β‘β’β£β’β₯βΎββββ«»β½β/ββββββββ·β` +| Primitive Function | `+-ΓΓ·ββββ\|Β¬β§β¨<>β =β€β₯β‘β’β£β’β₯βΎββββ«»β½β/ββββββββ·β!` | Primitive 1-Modifier | `` ΛΛΛΒ¨ββΌΒ΄Λ` `` | Primitive 2-Modifier | `βββΈββΎββΆβββ` | Special name | `π¨π©πππ€πππ½πΎπ` -| Punctuation | `βββ©β(){}β¨β©βΏβ,` and newline +| Punctuation | `βββ©β(){}β¨β©βΏβ,.` and newline In the BQN [grammar specification](grammar.md), the three primitive classes are grouped into terminals `Fl`, `_ml`, and `_cl`, while the punctuation characters are identified separately as keywords such as `"β"`. The special names are handled specially. The uppercase versions `πππ½πΎπ` and lowercase versions `π¨π©πππ€` are two spellings of the five underlying inputs and function. |
