-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathint_literals.json
142 lines (142 loc) · 2.53 KB
/
int_literals.json
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
"expect_ok": [
{
"source": "0",
"tokens": [["INT_LIT", "0"]]
},
{
"source": "0 1",
"tokens": [
["INT_LIT", "0"],
["SPACE", " "],
["INT_LIT", "1"]
]
},
{
"source": "42",
"tokens": [["INT_LIT", "42"]]
},
{
"source": "4_2",
"tokens": [["INT_LIT", "4_2"]]
},
{
"source": "-42",
"tokens": [["INT_LIT", "-42"]]
},
{
"source": "0b0",
"tokens": [["BIN_INT_LIT", "0b0"]]
},
{
"source": "0b00",
"tokens": [["BIN_INT_LIT", "0b00"]]
},
{
"source": "0b10",
"tokens": [["BIN_INT_LIT", "0b10"]]
},
{
"source": "-0b10",
"tokens": [["BIN_INT_LIT", "-0b10"]]
},
{
"source": "0o0",
"tokens": [["OCT_INT_LIT", "0o0"]]
},
{
"source": "0o00",
"tokens": [["OCT_INT_LIT", "0o00"]]
},
{
"source": "0o1234567",
"tokens": [["OCT_INT_LIT", "0o1234567"]]
},
{
"source": "-0o1234567",
"tokens": [["OCT_INT_LIT", "-0o1234567"]]
},
{
"source": "0d0",
"tokens": [["DEC_INT_LIT", "0d0"]]
},
{
"source": "0d00",
"tokens": [["DEC_INT_LIT", "0d00"]]
},
{
"source": "0d123456789",
"tokens": [["DEC_INT_LIT", "0d123456789"]]
},
{
"source": "-0d123456789",
"tokens": [["DEC_INT_LIT", "-0d123456789"]]
},
{
"source": "0x0",
"tokens": [["HEX_INT_LIT", "0x0"]]
},
{
"source": "0x00",
"tokens": [["HEX_INT_LIT", "0x00"]]
},
{
"source": "0x123456789abcdef",
"tokens": [["HEX_INT_LIT", "0x123456789abcdef"]]
},
{
"source": "-0x123456789abcdef",
"tokens": [["HEX_INT_LIT", "-0x123456789abcdef"]]
},
{
"source": "0x123456789ABCDEF",
"tokens": [["HEX_INT_LIT", "0x123456789ABCDEF"]]
},
{
"source": "-0x123456789ABCDEF",
"tokens": [["HEX_INT_LIT", "-0x123456789ABCDEF"]]
}
],
"expect_err": [
{
"source": "-",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 1}
},
{
"source": "- ",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 1}
},
{
"source": "-0",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 2}
},
{
"source": "00",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 2}
},
{
"source": "01",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 2}
},
{
"source": "0a0",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 3}
},
{
"source": "1a",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 2}
},
{
"source": "1g",
"error": "int_lit_invalid",
"error_span": {"start": 0, "len": 2}
}
]
}