tomlrb 1.2.9 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tomlrb/generated_parser.rb +187 -159
- data/lib/tomlrb/handler.rb +1 -1
- data/lib/tomlrb/parser.y +3 -1
- data/lib/tomlrb/scanner.rb +4 -0
- data/lib/tomlrb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e20834bda3dbc4762e7d56591de51add2029e519b0a1ca66c618a9e7be835c28
|
4
|
+
data.tar.gz: 267d7ced648a3d6e4d2838f72c046f946312aa3a20500e5329bd7188e49c7e4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce211ca850dc37f887fe221edbd99e76642241594a830ed2d6127e082a017f2d438fd5813cc2663f713f6733d9f92039434eb82b6cc7ede2e153cc6c96419509
|
7
|
+
data.tar.gz: de744d50bbf6b8d8dbf718b5148aae265b69644f7f9c38e495174b7b0f42448c5dfc0e59629be305db5f282af9f57f02563602266d21d7d2da335d2007c16ac5
|
@@ -10,150 +10,160 @@ module Tomlrb
|
|
10
10
|
##### State transition tables begin ###
|
11
11
|
|
12
12
|
racc_action_table = [
|
13
|
-
2,
|
14
|
-
15, 16, 8,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
10,
|
25
|
-
46, nil, nil, 10,
|
26
|
-
|
27
|
-
nil,
|
28
|
-
|
13
|
+
2, 17, 11, 31, 12, 31, 13, 79, 14, 40,
|
14
|
+
41, 80, 15, 16, 8, 71, 72, 10, 27, 29,
|
15
|
+
32, 29, 59, 60, 61, 62, 58, 55, 52, 53,
|
16
|
+
54, 56, 57, 46, 33, 34, 10, 59, 60, 61,
|
17
|
+
62, 58, 55, 52, 53, 54, 56, 57, 46, 35,
|
18
|
+
36, 10, 59, 60, 61, 62, 58, 55, 52, 53,
|
19
|
+
54, 56, 57, 46, 37, 38, 10, 59, 60, 61,
|
20
|
+
62, 58, 55, 52, 53, 54, 56, 57, 46, 43,
|
21
|
+
68, 10, 59, 60, 61, 62, 58, 55, 52, 53,
|
22
|
+
54, 56, 57, 46, nil, nil, 10, 59, 60, 61,
|
23
|
+
62, 58, 55, 52, 53, 54, 56, 57, 46, nil,
|
24
|
+
nil, 10, 59, 60, 61, 62, 58, 55, 52, 53,
|
25
|
+
54, 56, 57, 46, nil, nil, 10, 59, 60, 61,
|
26
|
+
62, 58, 55, 52, 53, 54, 56, 57, 46, 75,
|
27
|
+
nil, 10, 59, 60, 61, 62, 58, 55, 52, 53,
|
28
|
+
54, 56, 57, 46, 75, 21, 10, 22, nil, 23,
|
29
|
+
nil, 24, nil, nil, nil, 25, 26, 21, 19, 22,
|
30
|
+
nil, 23, nil, 24, nil, nil, nil, 25, 26, nil,
|
31
|
+
19 ]
|
29
32
|
|
30
33
|
racc_action_check = [
|
31
|
-
1,
|
32
|
-
1, 1, 1,
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
34, 34, 34, 34,
|
38
|
-
|
39
|
-
|
40
|
-
36, 36, 36, 36,
|
41
|
-
37, 37, 37, 37, 37, 37, 37, 37,
|
42
|
-
37, 43, 43, 43, 43, 43, 43, 43, 43,
|
43
|
-
43, nil, nil, 43, 45, 45, 45,
|
44
|
-
45, 45, 45, 45, 45,
|
45
|
-
nil,
|
46
|
-
|
34
|
+
1, 2, 1, 9, 1, 72, 1, 76, 1, 20,
|
35
|
+
20, 76, 1, 1, 1, 42, 42, 1, 8, 9,
|
36
|
+
11, 72, 32, 32, 32, 32, 32, 32, 32, 32,
|
37
|
+
32, 32, 32, 32, 12, 13, 32, 33, 33, 33,
|
38
|
+
33, 33, 33, 33, 33, 33, 33, 33, 33, 14,
|
39
|
+
15, 33, 34, 34, 34, 34, 34, 34, 34, 34,
|
40
|
+
34, 34, 34, 34, 16, 19, 34, 35, 35, 35,
|
41
|
+
35, 35, 35, 35, 35, 35, 35, 35, 35, 30,
|
42
|
+
40, 35, 36, 36, 36, 36, 36, 36, 36, 36,
|
43
|
+
36, 36, 36, 36, nil, nil, 36, 37, 37, 37,
|
44
|
+
37, 37, 37, 37, 37, 37, 37, 37, 37, nil,
|
45
|
+
nil, 37, 43, 43, 43, 43, 43, 43, 43, 43,
|
46
|
+
43, 43, 43, 43, nil, nil, 43, 45, 45, 45,
|
47
|
+
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
|
48
|
+
nil, 45, 80, 80, 80, 80, 80, 80, 80, 80,
|
49
|
+
80, 80, 80, 80, 80, 7, 80, 7, nil, 7,
|
50
|
+
nil, 7, nil, nil, nil, 7, 7, 41, 7, 41,
|
51
|
+
nil, 41, nil, 41, nil, nil, nil, 41, 41, nil,
|
52
|
+
41 ]
|
47
53
|
|
48
54
|
racc_action_pointer = [
|
49
|
-
nil, 0,
|
50
|
-
nil,
|
51
|
-
|
52
|
-
|
53
|
-
|
55
|
+
nil, 0, 1, nil, nil, nil, nil, 153, 4, 1,
|
56
|
+
nil, 0, 14, 15, 29, 30, 44, nil, nil, 50,
|
57
|
+
-6, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
58
|
+
59, nil, 19, 34, 49, 64, 79, 94, nil, nil,
|
59
|
+
65, 165, -3, 109, nil, 124, nil, nil, nil, nil,
|
54
60
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
55
61
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
56
|
-
3, nil, nil, nil, -
|
62
|
+
nil, nil, 3, nil, nil, nil, -8, nil, nil, nil,
|
63
|
+
139, nil ]
|
57
64
|
|
58
65
|
racc_action_default = [
|
59
|
-
-1, -
|
60
|
-
-22, -
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-13, -
|
66
|
+
-1, -58, -58, -2, -3, -4, -5, -58, -8, -58,
|
67
|
+
-22, -58, -58, -58, -58, -58, -58, 82, -6, -10,
|
68
|
+
-58, -15, -16, -17, -18, -19, -20, -7, -21, -23,
|
69
|
+
-58, -27, -46, -46, -46, -46, -46, -46, -9, -11,
|
70
|
+
-13, -58, -58, -46, -29, -46, -40, -41, -42, -43,
|
64
71
|
-44, -45, -47, -48, -49, -50, -51, -52, -53, -54,
|
65
|
-
-55, -30, -31, -32, -33, -34, -12, -14,
|
66
|
-
-
|
72
|
+
-55, -56, -57, -30, -31, -32, -33, -34, -12, -14,
|
73
|
+
-24, -25, -58, -28, -35, -36, -58, -26, -37, -38,
|
74
|
+
-46, -39 ]
|
67
75
|
|
68
76
|
racc_goto_table = [
|
69
|
-
28,
|
70
|
-
|
77
|
+
28, 74, 1, 18, 44, 63, 64, 65, 66, 67,
|
78
|
+
3, 4, 5, 6, 7, 73, 39, 42, 70, 78,
|
71
79
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
72
|
-
nil, nil, nil, nil, nil,
|
80
|
+
nil, nil, nil, nil, nil, nil, 81, 69, nil, nil,
|
73
81
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
74
82
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
75
|
-
nil,
|
83
|
+
nil, nil, nil, 77 ]
|
76
84
|
|
77
85
|
racc_goto_check = [
|
78
|
-
11,
|
79
|
-
6, 9, 13, 14,
|
86
|
+
11, 18, 1, 7, 15, 15, 15, 15, 15, 15,
|
87
|
+
2, 3, 4, 5, 6, 15, 9, 13, 14, 19,
|
80
88
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
81
|
-
nil, nil, nil, nil, nil,
|
89
|
+
nil, nil, nil, nil, nil, nil, 18, 7, nil, nil,
|
82
90
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
83
91
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
84
|
-
nil, 11 ]
|
92
|
+
nil, nil, nil, 11 ]
|
85
93
|
|
86
94
|
racc_goto_pointer = [
|
87
|
-
nil,
|
88
|
-
nil, -9, nil, -
|
95
|
+
nil, 2, 9, 10, 11, 12, 13, -4, nil, -4,
|
96
|
+
nil, -9, nil, -13, -24, -28, nil, nil, -44, -57,
|
89
97
|
nil, nil, nil ]
|
90
98
|
|
91
99
|
racc_goto_default = [
|
92
100
|
nil, nil, nil, nil, nil, 49, nil, nil, 20, nil,
|
93
|
-
9, nil, 30, nil, nil,
|
101
|
+
9, nil, 30, nil, nil, 76, 48, 45, nil, nil,
|
94
102
|
47, 50, 51 ]
|
95
103
|
|
96
104
|
racc_reduce_table = [
|
97
105
|
0, 0, :racc_error,
|
98
|
-
0,
|
99
|
-
2, 20, :_reduce_none,
|
100
|
-
1, 21, :_reduce_none,
|
101
|
-
1, 21, :_reduce_none,
|
102
|
-
1, 21, :_reduce_none,
|
106
|
+
0, 22, :_reduce_none,
|
103
107
|
2, 22, :_reduce_none,
|
104
|
-
|
105
|
-
1,
|
106
|
-
|
107
|
-
1, 26, :_reduce_10,
|
108
|
-
2, 26, :_reduce_none,
|
109
|
-
2, 28, :_reduce_12,
|
110
|
-
1, 28, :_reduce_13,
|
111
|
-
2, 28, :_reduce_none,
|
112
|
-
1, 27, :_reduce_15,
|
113
|
-
1, 27, :_reduce_16,
|
114
|
-
1, 27, :_reduce_17,
|
115
|
-
1, 27, :_reduce_18,
|
116
|
-
1, 27, :_reduce_19,
|
117
|
-
1, 27, :_reduce_20,
|
108
|
+
1, 23, :_reduce_none,
|
109
|
+
1, 23, :_reduce_none,
|
110
|
+
1, 23, :_reduce_none,
|
118
111
|
2, 24, :_reduce_none,
|
119
|
-
|
120
|
-
1,
|
121
|
-
|
122
|
-
1,
|
123
|
-
2,
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
112
|
+
2, 27, :_reduce_7,
|
113
|
+
1, 27, :_reduce_8,
|
114
|
+
2, 28, :_reduce_9,
|
115
|
+
1, 28, :_reduce_10,
|
116
|
+
2, 28, :_reduce_none,
|
117
|
+
2, 30, :_reduce_12,
|
118
|
+
1, 30, :_reduce_13,
|
119
|
+
2, 30, :_reduce_none,
|
120
|
+
1, 29, :_reduce_15,
|
121
|
+
1, 29, :_reduce_16,
|
122
|
+
1, 29, :_reduce_17,
|
123
|
+
1, 29, :_reduce_18,
|
124
|
+
1, 29, :_reduce_19,
|
125
|
+
1, 29, :_reduce_20,
|
126
|
+
2, 26, :_reduce_none,
|
127
|
+
1, 31, :_reduce_22,
|
128
|
+
1, 32, :_reduce_23,
|
129
|
+
3, 32, :_reduce_none,
|
130
|
+
1, 35, :_reduce_25,
|
132
131
|
2, 35, :_reduce_none,
|
133
|
-
1,
|
132
|
+
1, 33, :_reduce_27,
|
133
|
+
2, 34, :_reduce_none,
|
134
|
+
3, 25, :_reduce_29,
|
135
|
+
3, 25, :_reduce_30,
|
136
|
+
3, 25, :_reduce_31,
|
137
|
+
3, 25, :_reduce_32,
|
138
|
+
3, 25, :_reduce_33,
|
139
|
+
3, 25, :_reduce_34,
|
134
140
|
2, 37, :_reduce_none,
|
135
|
-
1,
|
136
|
-
2,
|
137
|
-
1,
|
138
|
-
|
139
|
-
1,
|
140
|
-
1,
|
141
|
-
1,
|
142
|
-
1,
|
143
|
-
|
144
|
-
1, 41, :
|
145
|
-
|
146
|
-
1,
|
147
|
-
1,
|
148
|
-
1,
|
149
|
-
1,
|
150
|
-
1,
|
151
|
-
1,
|
152
|
-
1,
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
141
|
+
1, 39, :_reduce_36,
|
142
|
+
2, 39, :_reduce_none,
|
143
|
+
1, 40, :_reduce_38,
|
144
|
+
2, 40, :_reduce_none,
|
145
|
+
1, 38, :_reduce_40,
|
146
|
+
1, 36, :_reduce_41,
|
147
|
+
1, 36, :_reduce_none,
|
148
|
+
1, 36, :_reduce_none,
|
149
|
+
1, 41, :_reduce_none,
|
150
|
+
1, 41, :_reduce_none,
|
151
|
+
0, 43, :_reduce_none,
|
152
|
+
1, 43, :_reduce_47,
|
153
|
+
1, 43, :_reduce_48,
|
154
|
+
1, 43, :_reduce_49,
|
155
|
+
1, 43, :_reduce_50,
|
156
|
+
1, 43, :_reduce_51,
|
157
|
+
1, 43, :_reduce_52,
|
158
|
+
1, 43, :_reduce_53,
|
159
|
+
1, 42, :_reduce_54,
|
160
|
+
1, 42, :_reduce_55,
|
161
|
+
1, 42, :_reduce_56,
|
162
|
+
1, 42, :_reduce_57 ]
|
163
|
+
|
164
|
+
racc_reduce_n = 58
|
165
|
+
|
166
|
+
racc_shift_n = 82
|
157
167
|
|
158
168
|
racc_token_table = {
|
159
169
|
false => 0,
|
@@ -166,17 +176,19 @@ racc_token_table = {
|
|
166
176
|
:DATETIME => 7,
|
167
177
|
:INTEGER => 8,
|
168
178
|
:FLOAT => 9,
|
169
|
-
:
|
170
|
-
:
|
171
|
-
|
172
|
-
|
173
|
-
"
|
174
|
-
"
|
175
|
-
"
|
176
|
-
"
|
177
|
-
"
|
178
|
-
|
179
|
-
|
179
|
+
:FLOAT_INF => 10,
|
180
|
+
:FLOAT_NAN => 11,
|
181
|
+
:TRUE => 12,
|
182
|
+
:FALSE => 13,
|
183
|
+
"[" => 14,
|
184
|
+
"]" => 15,
|
185
|
+
"." => 16,
|
186
|
+
"{" => 17,
|
187
|
+
"}" => 18,
|
188
|
+
"," => 19,
|
189
|
+
"=" => 20 }
|
190
|
+
|
191
|
+
racc_nt_base = 21
|
180
192
|
|
181
193
|
racc_use_result_var = true
|
182
194
|
|
@@ -207,6 +219,8 @@ Racc_token_to_s_table = [
|
|
207
219
|
"DATETIME",
|
208
220
|
"INTEGER",
|
209
221
|
"FLOAT",
|
222
|
+
"FLOAT_INF",
|
223
|
+
"FLOAT_NAN",
|
210
224
|
"TRUE",
|
211
225
|
"FALSE",
|
212
226
|
"\"[\"",
|
@@ -260,28 +274,28 @@ Racc_debug_parser = false
|
|
260
274
|
|
261
275
|
module_eval(<<'.,.,', 'parser.y', 15)
|
262
276
|
def _reduce_7(val, _values, result)
|
263
|
-
@handler.start_(:array_of_tables)
|
277
|
+
@handler.start_(:array_of_tables)
|
264
278
|
result
|
265
279
|
end
|
266
280
|
.,.,
|
267
281
|
|
268
282
|
module_eval(<<'.,.,', 'parser.y', 16)
|
269
283
|
def _reduce_8(val, _values, result)
|
270
|
-
@handler.start_(:table)
|
284
|
+
@handler.start_(:table)
|
271
285
|
result
|
272
286
|
end
|
273
287
|
.,.,
|
274
288
|
|
275
289
|
module_eval(<<'.,.,', 'parser.y', 19)
|
276
290
|
def _reduce_9(val, _values, result)
|
277
|
-
array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
|
291
|
+
array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
|
278
292
|
result
|
279
293
|
end
|
280
294
|
.,.,
|
281
295
|
|
282
296
|
module_eval(<<'.,.,', 'parser.y', 20)
|
283
297
|
def _reduce_10(val, _values, result)
|
284
|
-
array = @handler.end_(:table); @handler.set_context(array)
|
298
|
+
array = @handler.end_(:table); @handler.set_context(array)
|
285
299
|
result
|
286
300
|
end
|
287
301
|
.,.,
|
@@ -290,14 +304,14 @@ module_eval(<<'.,.,', 'parser.y', 20)
|
|
290
304
|
|
291
305
|
module_eval(<<'.,.,', 'parser.y', 24)
|
292
306
|
def _reduce_12(val, _values, result)
|
293
|
-
array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
|
307
|
+
array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
|
294
308
|
result
|
295
309
|
end
|
296
310
|
.,.,
|
297
311
|
|
298
312
|
module_eval(<<'.,.,', 'parser.y', 25)
|
299
313
|
def _reduce_13(val, _values, result)
|
300
|
-
array = @handler.end_(:table); @handler.set_context(array)
|
314
|
+
array = @handler.end_(:table); @handler.set_context(array)
|
301
315
|
result
|
302
316
|
end
|
303
317
|
.,.,
|
@@ -306,42 +320,42 @@ module_eval(<<'.,.,', 'parser.y', 25)
|
|
306
320
|
|
307
321
|
module_eval(<<'.,.,', 'parser.y', 29)
|
308
322
|
def _reduce_15(val, _values, result)
|
309
|
-
@handler.push(val[0])
|
323
|
+
@handler.push(val[0])
|
310
324
|
result
|
311
325
|
end
|
312
326
|
.,.,
|
313
327
|
|
314
328
|
module_eval(<<'.,.,', 'parser.y', 30)
|
315
329
|
def _reduce_16(val, _values, result)
|
316
|
-
@handler.push(val[0])
|
330
|
+
@handler.push(val[0])
|
317
331
|
result
|
318
332
|
end
|
319
333
|
.,.,
|
320
334
|
|
321
335
|
module_eval(<<'.,.,', 'parser.y', 31)
|
322
336
|
def _reduce_17(val, _values, result)
|
323
|
-
@handler.push(val[0])
|
337
|
+
@handler.push(val[0])
|
324
338
|
result
|
325
339
|
end
|
326
340
|
.,.,
|
327
341
|
|
328
342
|
module_eval(<<'.,.,', 'parser.y', 32)
|
329
343
|
def _reduce_18(val, _values, result)
|
330
|
-
@handler.push(val[0])
|
344
|
+
@handler.push(val[0])
|
331
345
|
result
|
332
346
|
end
|
333
347
|
.,.,
|
334
348
|
|
335
349
|
module_eval(<<'.,.,', 'parser.y', 33)
|
336
350
|
def _reduce_19(val, _values, result)
|
337
|
-
@handler.push(val[0])
|
351
|
+
@handler.push(val[0])
|
338
352
|
result
|
339
353
|
end
|
340
354
|
.,.,
|
341
355
|
|
342
356
|
module_eval(<<'.,.,', 'parser.y', 34)
|
343
357
|
def _reduce_20(val, _values, result)
|
344
|
-
@handler.push(val[0])
|
358
|
+
@handler.push(val[0])
|
345
359
|
result
|
346
360
|
end
|
347
361
|
.,.,
|
@@ -350,14 +364,14 @@ module_eval(<<'.,.,', 'parser.y', 34)
|
|
350
364
|
|
351
365
|
module_eval(<<'.,.,', 'parser.y', 40)
|
352
366
|
def _reduce_22(val, _values, result)
|
353
|
-
@handler.start_(:inline)
|
367
|
+
@handler.start_(:inline)
|
354
368
|
result
|
355
369
|
end
|
356
370
|
.,.,
|
357
371
|
|
358
372
|
module_eval(<<'.,.,', 'parser.y', 43)
|
359
373
|
def _reduce_23(val, _values, result)
|
360
|
-
array = @handler.end_(:inline); @handler.push(Hash[*array])
|
374
|
+
array = @handler.end_(:inline); @handler.push(Hash[*array])
|
361
375
|
result
|
362
376
|
end
|
363
377
|
.,.,
|
@@ -369,7 +383,7 @@ module_eval(<<'.,.,', 'parser.y', 48)
|
|
369
383
|
array = @handler.end_(:inline)
|
370
384
|
array.map!.with_index{ |n,i| i.even? ? n.to_sym : n } if @handler.symbolize_keys
|
371
385
|
@handler.push(Hash[*array])
|
372
|
-
|
386
|
+
|
373
387
|
result
|
374
388
|
end
|
375
389
|
.,.,
|
@@ -378,7 +392,7 @@ module_eval(<<'.,.,', 'parser.y', 48)
|
|
378
392
|
|
379
393
|
module_eval(<<'.,.,', 'parser.y', 55)
|
380
394
|
def _reduce_27(val, _values, result)
|
381
|
-
@handler.push(val[0])
|
395
|
+
@handler.push(val[0])
|
382
396
|
result
|
383
397
|
end
|
384
398
|
.,.,
|
@@ -387,42 +401,42 @@ module_eval(<<'.,.,', 'parser.y', 55)
|
|
387
401
|
|
388
402
|
module_eval(<<'.,.,', 'parser.y', 61)
|
389
403
|
def _reduce_29(val, _values, result)
|
390
|
-
@handler.assign(val[0])
|
404
|
+
@handler.assign(val[0])
|
391
405
|
result
|
392
406
|
end
|
393
407
|
.,.,
|
394
408
|
|
395
409
|
module_eval(<<'.,.,', 'parser.y', 62)
|
396
410
|
def _reduce_30(val, _values, result)
|
397
|
-
@handler.assign(val[0])
|
411
|
+
@handler.assign(val[0])
|
398
412
|
result
|
399
413
|
end
|
400
414
|
.,.,
|
401
415
|
|
402
416
|
module_eval(<<'.,.,', 'parser.y', 63)
|
403
417
|
def _reduce_31(val, _values, result)
|
404
|
-
@handler.assign(val[0])
|
418
|
+
@handler.assign(val[0])
|
405
419
|
result
|
406
420
|
end
|
407
421
|
.,.,
|
408
422
|
|
409
423
|
module_eval(<<'.,.,', 'parser.y', 64)
|
410
424
|
def _reduce_32(val, _values, result)
|
411
|
-
@handler.assign(val[0])
|
425
|
+
@handler.assign(val[0])
|
412
426
|
result
|
413
427
|
end
|
414
428
|
.,.,
|
415
429
|
|
416
430
|
module_eval(<<'.,.,', 'parser.y', 65)
|
417
431
|
def _reduce_33(val, _values, result)
|
418
|
-
@handler.assign(val[0])
|
432
|
+
@handler.assign(val[0])
|
419
433
|
result
|
420
434
|
end
|
421
435
|
.,.,
|
422
436
|
|
423
437
|
module_eval(<<'.,.,', 'parser.y', 66)
|
424
438
|
def _reduce_34(val, _values, result)
|
425
|
-
@handler.assign(val[0])
|
439
|
+
@handler.assign(val[0])
|
426
440
|
result
|
427
441
|
end
|
428
442
|
.,.,
|
@@ -431,7 +445,7 @@ module_eval(<<'.,.,', 'parser.y', 66)
|
|
431
445
|
|
432
446
|
module_eval(<<'.,.,', 'parser.y', 72)
|
433
447
|
def _reduce_36(val, _values, result)
|
434
|
-
array = @handler.end_(:array); @handler.push(array)
|
448
|
+
array = @handler.end_(:array); @handler.push(array)
|
435
449
|
result
|
436
450
|
end
|
437
451
|
.,.,
|
@@ -440,7 +454,7 @@ module_eval(<<'.,.,', 'parser.y', 72)
|
|
440
454
|
|
441
455
|
module_eval(<<'.,.,', 'parser.y', 76)
|
442
456
|
def _reduce_38(val, _values, result)
|
443
|
-
array = @handler.end_(:array); @handler.push(array)
|
457
|
+
array = @handler.end_(:array); @handler.push(array)
|
444
458
|
result
|
445
459
|
end
|
446
460
|
.,.,
|
@@ -449,14 +463,14 @@ module_eval(<<'.,.,', 'parser.y', 76)
|
|
449
463
|
|
450
464
|
module_eval(<<'.,.,', 'parser.y', 80)
|
451
465
|
def _reduce_40(val, _values, result)
|
452
|
-
@handler.start_(:array)
|
466
|
+
@handler.start_(:array)
|
453
467
|
result
|
454
468
|
end
|
455
469
|
.,.,
|
456
470
|
|
457
471
|
module_eval(<<'.,.,', 'parser.y', 83)
|
458
472
|
def _reduce_41(val, _values, result)
|
459
|
-
@handler.push(val[0])
|
473
|
+
@handler.push(val[0])
|
460
474
|
result
|
461
475
|
end
|
462
476
|
.,.,
|
@@ -473,63 +487,77 @@ module_eval(<<'.,.,', 'parser.y', 83)
|
|
473
487
|
|
474
488
|
module_eval(<<'.,.,', 'parser.y', 92)
|
475
489
|
def _reduce_47(val, _values, result)
|
476
|
-
result = val[0].to_f
|
490
|
+
result = val[0].to_f
|
477
491
|
result
|
478
492
|
end
|
479
493
|
.,.,
|
480
494
|
|
481
495
|
module_eval(<<'.,.,', 'parser.y', 93)
|
482
496
|
def _reduce_48(val, _values, result)
|
483
|
-
result = val[0]
|
497
|
+
result = (val[0][0] == '-' ? -1 : 1) * Float::INFINITY
|
484
498
|
result
|
485
499
|
end
|
486
500
|
.,.,
|
487
501
|
|
488
502
|
module_eval(<<'.,.,', 'parser.y', 94)
|
489
503
|
def _reduce_49(val, _values, result)
|
490
|
-
result =
|
504
|
+
result = Float::NAN
|
491
505
|
result
|
492
506
|
end
|
493
507
|
.,.,
|
494
508
|
|
495
509
|
module_eval(<<'.,.,', 'parser.y', 95)
|
496
510
|
def _reduce_50(val, _values, result)
|
497
|
-
result =
|
511
|
+
result = val[0].to_i
|
498
512
|
result
|
499
513
|
end
|
500
514
|
.,.,
|
501
515
|
|
502
516
|
module_eval(<<'.,.,', 'parser.y', 96)
|
503
517
|
def _reduce_51(val, _values, result)
|
504
|
-
result =
|
518
|
+
result = true
|
505
519
|
result
|
506
520
|
end
|
507
521
|
.,.,
|
508
522
|
|
509
|
-
module_eval(<<'.,.,', 'parser.y',
|
523
|
+
module_eval(<<'.,.,', 'parser.y', 97)
|
510
524
|
def _reduce_52(val, _values, result)
|
511
|
-
result =
|
525
|
+
result = false
|
512
526
|
result
|
513
527
|
end
|
514
528
|
.,.,
|
515
529
|
|
516
|
-
module_eval(<<'.,.,', 'parser.y',
|
530
|
+
module_eval(<<'.,.,', 'parser.y', 98)
|
517
531
|
def _reduce_53(val, _values, result)
|
518
|
-
result =
|
532
|
+
result = Time.new(*val[0])
|
519
533
|
result
|
520
534
|
end
|
521
535
|
.,.,
|
522
536
|
|
523
537
|
module_eval(<<'.,.,', 'parser.y', 101)
|
524
538
|
def _reduce_54(val, _values, result)
|
525
|
-
result = StringUtils.
|
539
|
+
result = StringUtils.replace_escaped_chars(StringUtils.multiline_replacements(val[0]))
|
526
540
|
result
|
527
541
|
end
|
528
542
|
.,.,
|
529
543
|
|
530
544
|
module_eval(<<'.,.,', 'parser.y', 102)
|
531
545
|
def _reduce_55(val, _values, result)
|
532
|
-
result = val[0]
|
546
|
+
result = StringUtils.replace_escaped_chars(val[0])
|
547
|
+
result
|
548
|
+
end
|
549
|
+
.,.,
|
550
|
+
|
551
|
+
module_eval(<<'.,.,', 'parser.y', 103)
|
552
|
+
def _reduce_56(val, _values, result)
|
553
|
+
result = StringUtils.strip_spaces(val[0])
|
554
|
+
result
|
555
|
+
end
|
556
|
+
.,.,
|
557
|
+
|
558
|
+
module_eval(<<'.,.,', 'parser.y', 104)
|
559
|
+
def _reduce_57(val, _values, result)
|
560
|
+
result = val[0]
|
533
561
|
result
|
534
562
|
end
|
535
563
|
.,.,
|
data/lib/tomlrb/handler.rb
CHANGED
data/lib/tomlrb/parser.y
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Tomlrb::GeneratedParser
|
2
|
-
token IDENTIFIER STRING_MULTI STRING_BASIC STRING_LITERAL_MULTI STRING_LITERAL DATETIME INTEGER FLOAT TRUE FALSE
|
2
|
+
token IDENTIFIER STRING_MULTI STRING_BASIC STRING_LITERAL_MULTI STRING_LITERAL DATETIME INTEGER FLOAT FLOAT_INF FLOAT_NAN TRUE FALSE
|
3
3
|
rule
|
4
4
|
expressions
|
5
5
|
| expressions expression
|
@@ -91,6 +91,8 @@ rule
|
|
91
91
|
;
|
92
92
|
literal
|
93
93
|
| FLOAT { result = val[0].to_f }
|
94
|
+
| FLOAT_INF { result = (val[0][0] == '-' ? -1 : 1) * Float::INFINITY }
|
95
|
+
| FLOAT_NAN { result = Float::NAN }
|
94
96
|
| INTEGER { result = val[0].to_i }
|
95
97
|
| TRUE { result = true }
|
96
98
|
| FALSE { result = false }
|
data/lib/tomlrb/scanner.rb
CHANGED
@@ -11,6 +11,8 @@ module Tomlrb
|
|
11
11
|
STRING_LITERAL_MULTI = /'{3}([\s\S]*?'{3})/m
|
12
12
|
DATETIME = /(-?\d{4})-(\d{2})-(\d{2})(?:(?:t|\s)(\d{2}):(\d{2}):(\d{2}(?:\.\d+)?))?(z|[-+]\d{2}:\d{2})?/i
|
13
13
|
FLOAT = /[+-]?(?:[0-9_]+\.[0-9_]*|\d+(?=[eE]))(?:[eE][+-]?[0-9_]+)?/
|
14
|
+
FLOAT_INF = /[+-]?inf/
|
15
|
+
FLOAT_NAN = /[+-]?nan/
|
14
16
|
INTEGER = /[+-]?([1-9](_?\d)*|0)(?![A-Za-z0-9_-]+)/
|
15
17
|
TRUE = /true/
|
16
18
|
FALSE = /false/
|
@@ -31,6 +33,8 @@ module Tomlrb
|
|
31
33
|
when text = @ss.scan(STRING_LITERAL_MULTI) then [:STRING_LITERAL_MULTI, text[3..-4]]
|
32
34
|
when text = @ss.scan(STRING_LITERAL) then [:STRING_LITERAL, text[1..-2]]
|
33
35
|
when text = @ss.scan(FLOAT) then [:FLOAT, text]
|
36
|
+
when text = @ss.scan(FLOAT_INF) then [:FLOAT_INF, text]
|
37
|
+
when text = @ss.scan(FLOAT_NAN) then [:FLOAT_NAN, text]
|
34
38
|
when text = @ss.scan(INTEGER) then [:INTEGER, text]
|
35
39
|
when text = @ss.scan(TRUE) then [:TRUE, text]
|
36
40
|
when text = @ss.scan(FALSE) then [:FALSE, text]
|
data/lib/tomlrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomlrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francois Bernier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A racc based toml parser
|
14
14
|
email:
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
requirements: []
|
48
|
-
rubygems_version: 3.0.
|
48
|
+
rubygems_version: 3.0.6
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: A racc based toml parser
|