Debian Codegraph @

tests/languages/bqn/words.test

raw
1 1464
2 1.618
3 1.314E1
4 ∞
5 π
6 2π
7 ¯∞
8 TheAboveAreNumbersNotNames
9 ThereAre4Symbols_¯∞πAllowedInNames
10 ThisIs.aNamespace
11 •System_¯∞πFunction
12 𝕣
13 _𝕣
14 _𝕣_
15 This𝕣IsNotASingleName
16
17 ----------------------------------------------------
18
19 [
20 ["word-number", "1464"],
21 ["word-number", "1.618"],
22 ["word-number-scientific", "1.314E1"],
23 ["word-number", "∞"],
24 ["word-number", "π"],
25 ["word-number", "2"],
26 ["word-number", "π"],
27 ["word-number", "¯∞"],
28 ["word-name", "TheAboveAreNumbersNotNames"],
29 ["word-name", "ThereAre4Symbols_¯∞πAllowedInNames"],
30 ["dot-notation-on-name", "ThisIs."],
31 ["word-name", "aNamespace"],
32 ["function", "•System_¯∞πFunction"],
33 ["special-name", "𝕣"],
34 ["special-name", "_𝕣"],
35 ["special-name", "_𝕣_"],
36 ["word-name", "This"],
37 ["special-name", "𝕣"],
38 ["word-name", "IsNotASingleName"]
39 ]
40
41 ----------------------------------------------------
42
43 Numbers and variable names share a token formation rule, and are collectively
44 called words. A word is a number if it starts with a digit or numeric
45 character ¯∞π, and a name otherwise.
46
47 Words are formed from digits, letters, and the characters _.¯∞π. All these
48 characters stick together, so that you need to separate words with whitespace
49 in order to write them next to each other. But . only counts if it's followed
50 by a digit: otherwise it forms its own token to support namespace syntax
51 ns.field. A word may be preceded by • to form a system name.
52
53 The character 𝕣 also sticks with other word-forming characters, but is only
54 allowed form the special names 𝕣, _𝕣, and _𝕣_.