forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 2
/
literals.ts
100 lines (98 loc) · 872 Bytes
/
literals.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
0;
1;
2;
3;
4;
5;
6;
7;
8;
9;
2147483647;
0x0;
0x1;
0x2;
0x3;
0x4;
0x5;
0x6;
0x7;
0x8;
0x9;
0xA;
0xB;
0xC;
0xD;
0xE;
0xF;
0x7FFFFFFF;
0xa;
0xb;
0xc;
0xd;
0xe;
0xf;
0x7fffffff;
0o0;
0o1;
0o2;
0o3;
0o4;
0o5;
0o6;
0o7;
0o17777777777;
0b0;
0b1;
0b1111111111111111111111111111111;
0.0;
0.123;
.0;
.123;
12.34;
1e1;
1.0e1;
1e+1;
1.0e+1;
1e-1;
1.0e-1;
"";
"\"";
"123";
"1\"23";
"1\"2\\3";
"\0\n\\n\r";
``;
`123`;
`123${a}`;
`123${a}456`;
`123${a}456${b}`;
`123${a}456${b}789`;
`${a}`;
`${a}456`;
`${a}456${b}`;
`${a}456${b}789`;
`${a}${b}`;
`${a}456${b}`;
`123${a}${b}`;
`${a}${b}789`;
`\``;
`\`${a}\`${b}\``;
tag`123`;
ns.tag`123`;
tag`\unicode\xGG\u\x`; // see https://tc39.es/proposal-template-literal-revision/
// invalid
1..;
3u8;
4b;
5-;
6=;
7_;
1.a;
2.0b;
`\unicode\xGG\u\x`;
// technically invalid, but not handled by AS yet, TS1005: ';' expected
3 4;
5 c;
6.7 d;
a b;