aboutsummaryrefslogtreecommitdiff
path: root/spec/token.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-30 16:40:40 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-30 16:40:40 -0500
commitafadc45f29d34de5b4bce0b1ebe751436939a77b (patch)
treeb031c85c5bf40c79d45ab41ed76d0af37a869a97 /spec/token.md
parent4fbf17eb5e9dcb3aac891832eabf63c715df4feb (diff)
Prevent names like _99 in the spec
Diffstat (limited to 'spec/token.md')
-rw-r--r--spec/token.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/token.md b/spec/token.md
index 93dd1dfa..91608c47 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. 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 `𝕣`. 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.