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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7dc49f2c4a21fe5073871c84669412123b959d4cfa082d32bea1be9a8d9d23fe
4
- data.tar.gz: 374170642d697bfe82f1bac48c9e14ff83a3b09b3badbc707c62110d19153f19
3
+ metadata.gz: e20834bda3dbc4762e7d56591de51add2029e519b0a1ca66c618a9e7be835c28
4
+ data.tar.gz: 267d7ced648a3d6e4d2838f72c046f946312aa3a20500e5329bd7188e49c7e4f
5
5
  SHA512:
6
- metadata.gz: 0050d8b4e22c47f88b6e08d42edf9f301e3608e3ce22b5744087836e566fbc53af09d0291572449d6ecfb8f7a33ea29c6f8cc15d6763c017356e47669832d534
7
- data.tar.gz: 91db307e0bf1c4fc5e2ebba6ca0ef8c0a7d32632a0c219059a44c7ac83fd0e41c4e6e55cb099a3031c26993de6632ce59e9303a3035192489bde407cb8ffdc47
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, 32, 11, 31, 12, 31, 13, 33, 14, 77,
14
- 15, 16, 8, 78, 34, 10, 35, 29, 36, 29,
15
- 57, 58, 59, 60, 56, 53, 52, 54, 55, 46,
16
- 73, 37, 10, 57, 58, 59, 60, 56, 53, 52,
17
- 54, 55, 46, 69, 70, 10, 57, 58, 59, 60,
18
- 56, 53, 52, 54, 55, 46, 40, 41, 10, 57,
19
- 58, 59, 60, 56, 53, 52, 54, 55, 46, 38,
20
- 43, 10, 57, 58, 59, 60, 56, 53, 52, 54,
21
- 55, 46, 66, 17, 10, 57, 58, 59, 60, 56,
22
- 53, 52, 54, 55, 46, 27, nil, 10, 57, 58,
23
- 59, 60, 56, 53, 52, 54, 55, 46, nil, nil,
24
- 10, 57, 58, 59, 60, 56, 53, 52, 54, 55,
25
- 46, nil, nil, 10, 57, 58, 59, 60, 56, 53,
26
- 52, 54, 55, 46, 73, 21, 10, 22, nil, 23,
27
- nil, 24, nil, 25, 26, 21, 19, 22, nil, 23,
28
- nil, 24, nil, 25, 26, nil, 19 ]
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, 11, 1, 9, 1, 70, 1, 12, 1, 74,
32
- 1, 1, 1, 74, 13, 1, 14, 9, 15, 70,
33
- 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
34
- 78, 16, 78, 32, 32, 32, 32, 32, 32, 32,
35
- 32, 32, 32, 42, 42, 32, 33, 33, 33, 33,
36
- 33, 33, 33, 33, 33, 33, 20, 20, 33, 34,
37
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 19,
38
- 30, 34, 35, 35, 35, 35, 35, 35, 35, 35,
39
- 35, 35, 40, 2, 35, 36, 36, 36, 36, 36,
40
- 36, 36, 36, 36, 36, 8, nil, 36, 37, 37,
41
- 37, 37, 37, 37, 37, 37, 37, 37, nil, nil,
42
- 37, 43, 43, 43, 43, 43, 43, 43, 43, 43,
43
- 43, nil, nil, 43, 45, 45, 45, 45, 45, 45,
44
- 45, 45, 45, 45, 45, 7, 45, 7, nil, 7,
45
- nil, 7, nil, 7, 7, 41, 7, 41, nil, 41,
46
- nil, 41, nil, 41, 41, nil, 41 ]
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, 83, nil, nil, nil, nil, 133, 83, 1,
50
- nil, -17, -11, -4, -2, 0, 13, nil, nil, 56,
51
- 43, nil, nil, nil, nil, nil, nil, nil, nil, nil,
52
- 52, nil, 30, 43, 56, 69, 82, 95, nil, nil,
53
- 69, 143, 27, 108, nil, 121, nil, nil, nil, nil,
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, -4, nil, nil, nil, 17, nil ]
62
+ nil, nil, 3, nil, nil, nil, -8, nil, nil, nil,
63
+ 139, nil ]
57
64
 
58
65
  racc_action_default = [
59
- -1, -56, -56, -2, -3, -4, -5, -56, -8, -56,
60
- -22, -56, -56, -56, -56, -56, -56, 80, -6, -10,
61
- -56, -15, -16, -17, -18, -19, -20, -7, -21, -23,
62
- -56, -27, -46, -46, -46, -46, -46, -46, -9, -11,
63
- -13, -56, -56, -46, -29, -46, -40, -41, -42, -43,
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, -24, -25,
66
- -56, -28, -35, -36, -56, -26, -37, -38, -46, -39 ]
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, 18, 6, 72, 44, 61, 62, 63, 64, 65,
70
- 7, 39, 42, 68, 1, 71, 76, 3, 4, 5,
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, 67, 79, 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, 75 ]
83
+ nil, nil, nil, 77 ]
76
84
 
77
85
  racc_goto_check = [
78
- 11, 7, 5, 18, 15, 15, 15, 15, 15, 15,
79
- 6, 9, 13, 14, 1, 15, 19, 2, 3, 4,
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, 7, 18, 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, 14, 16, 17, 18, 1, 9, -6, nil, -9,
88
- nil, -9, nil, -18, -29, -28, nil, nil, -42, -58,
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, 74, 48, 45, 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, 20, :_reduce_none,
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
- 2, 25, :_reduce_7,
105
- 1, 25, :_reduce_8,
106
- 2, 26, :_reduce_9,
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
- 1, 29, :_reduce_22,
120
- 1, 30, :_reduce_23,
121
- 3, 30, :_reduce_none,
122
- 1, 33, :_reduce_25,
123
- 2, 33, :_reduce_none,
124
- 1, 31, :_reduce_27,
125
- 2, 32, :_reduce_none,
126
- 3, 23, :_reduce_29,
127
- 3, 23, :_reduce_30,
128
- 3, 23, :_reduce_31,
129
- 3, 23, :_reduce_32,
130
- 3, 23, :_reduce_33,
131
- 3, 23, :_reduce_34,
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, 37, :_reduce_36,
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, 38, :_reduce_38,
136
- 2, 38, :_reduce_none,
137
- 1, 36, :_reduce_40,
138
- 1, 34, :_reduce_41,
139
- 1, 34, :_reduce_none,
140
- 1, 34, :_reduce_none,
141
- 1, 39, :_reduce_none,
142
- 1, 39, :_reduce_none,
143
- 0, 41, :_reduce_none,
144
- 1, 41, :_reduce_47,
145
- 1, 41, :_reduce_48,
146
- 1, 41, :_reduce_49,
147
- 1, 41, :_reduce_50,
148
- 1, 41, :_reduce_51,
149
- 1, 40, :_reduce_52,
150
- 1, 40, :_reduce_53,
151
- 1, 40, :_reduce_54,
152
- 1, 40, :_reduce_55 ]
153
-
154
- racc_reduce_n = 56
155
-
156
- racc_shift_n = 80
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
- :TRUE => 10,
170
- :FALSE => 11,
171
- "[" => 12,
172
- "]" => 13,
173
- "." => 14,
174
- "{" => 15,
175
- "}" => 16,
176
- "," => 17,
177
- "=" => 18 }
178
-
179
- racc_nt_base = 19
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].to_i
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 = true
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 = false
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 = Time.new(*val[0])
518
+ result = true
505
519
  result
506
520
  end
507
521
  .,.,
508
522
 
509
- module_eval(<<'.,.,', 'parser.y', 99)
523
+ module_eval(<<'.,.,', 'parser.y', 97)
510
524
  def _reduce_52(val, _values, result)
511
- result = StringUtils.replace_escaped_chars(StringUtils.multiline_replacements(val[0]))
525
+ result = false
512
526
  result
513
527
  end
514
528
  .,.,
515
529
 
516
- module_eval(<<'.,.,', 'parser.y', 100)
530
+ module_eval(<<'.,.,', 'parser.y', 98)
517
531
  def _reduce_53(val, _values, result)
518
- result = StringUtils.replace_escaped_chars(val[0])
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.strip_spaces(val[0])
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
  .,.,
@@ -64,7 +64,7 @@ module Tomlrb
64
64
  def end_(type)
65
65
  array = []
66
66
  while (value = @stack.pop) != [type]
67
- raise ParseError, 'Unclosed table' unless value
67
+ raise ParseError, 'Unclosed table' if value.nil?
68
68
  array.unshift(value)
69
69
  end
70
70
  array
@@ -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 }
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module Tomlrb
2
- VERSION = "1.2.9"
2
+ VERSION = '1.3.0'.freeze
3
3
  end
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.2.9
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: 2019-11-22 00:00:00.000000000 Z
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.0
48
+ rubygems_version: 3.0.6
49
49
  signing_key:
50
50
  specification_version: 4
51
51
  summary: A racc based toml parser