diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-06-26 14:30:03 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-06-26 14:30:03 -0400 |
| commit | bfa0be0bbc67047e2ec3f3d457bffdc372e0bcf9 (patch) | |
| tree | a9c91a3f75d58b15ed2bf28a04b131b84fe4d100 /spec/token.md | |
| parent | f34e14170e1fb9b962d88316b7089192e07b2025 (diff) | |
Add header grammar to 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 8e695139..430869ac 100644 --- a/spec/token.md +++ b/spec/token.md @@ -6,7 +6,7 @@ A BQN *character literal* consists of a single character between single quotes, A comment consists of the lamp 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`. Any sequence of adjacent numeric and alphabetic characters 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. +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 or composition, 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. @@ -17,7 +17,7 @@ Otherwise, a single character forms a token. Only the specified set of character | Primitive Function | `+-×÷⋆√⌊⌈\|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔` | Primitive Modifier | `` ˜˘¨⌜⁼´` `` | Primitive Composition | `∘○⊸⟜⌾⊘◶⎉⚇⍟` -| Parameter | `𝕨𝕩𝕗𝕘𝕎𝕏𝔽𝔾` +| Special name | `𝕨𝕩𝕗𝕘𝕤𝕎𝕏𝔽𝔾𝕊` | 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 parameters are handled specially. The uppercase versions `𝕎𝕏𝔽𝔾` and lowercase versions `𝕨𝕩𝕗𝕘` are two spellings of the four underlying parameters. +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. |
