aboutsummaryrefslogtreecommitdiff
path: root/spec/token.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-03-15 16:59:32 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-03-15 16:59:32 -0400
commit4f618598f2f31bc466343e4d304f35b53a366da6 (patch)
treef645f16425939a45ac82fcd0b3b477f9030bc7d9 /spec/token.md
parente858f41dffaee272ffcf4b2cb63a49ad25ebf7d7 (diff)
Finish namespace specification
Diffstat (limited to 'spec/token.md')
-rw-r--r--spec/token.md6
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.