tomlrb 1.2.7 → 2.0.1

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: ab9d9abc1066720c536800a9ce163d4b9fbea36d45c54e3baf58d8c696f4f525
4
- data.tar.gz: 17063b96f6cc0dcf2b0afb2a320bb0b8f47a351d8eea701a56606ac50021ff1c
3
+ metadata.gz: 629b0c5e56e0d5978b6038fba1e1ac597cfd2932b6379fe84d09508defe7ce65
4
+ data.tar.gz: 5a018444a9506276d874c43d3a2b9a234f54350fb732dd5ec5c4fac901917757
5
5
  SHA512:
6
- metadata.gz: b3152a4f20f0bd1e01c22a2d07d0651f259f7b2590e23cab00a1711f361c0954a7895b55b56641d671ca5272d1830e4b47240b9cae1ca98f5c8358bd408db255
7
- data.tar.gz: ef4663e12a42e04b205bd383da8c137ed07b69685c7862eac3fc5204b59b19f7e23778e1a1d4f210c8fc3f297dd15817640750068619317b6f4d95d5712c5038
6
+ metadata.gz: 8960f08241d02b8a36d600587d148d034a229588dbb96e4738aab0c30355def92bcbf4280da4ad9966e0e3a676aff01dd8faeb0c62f16c595c4bccc32c9d3e77
7
+ data.tar.gz: 4e4179cbf1c9f88ff86ecbf15f23e2a964cd7cc3449bf420f7e8242aa125de08b7b0be9658c55d4a8c7d5c805654926144d0a30ed7d03b0d328fdb1db6a456b6
@@ -1,6 +1,9 @@
1
1
  require 'time'
2
2
  require 'stringio'
3
3
  require "tomlrb/version"
4
+ require 'tomlrb/local_date_time'
5
+ require 'tomlrb/local_date'
6
+ require 'tomlrb/local_time'
4
7
  require 'tomlrb/string_utils'
5
8
  require "tomlrb/scanner"
6
9
  require "tomlrb/parser"
@@ -18,7 +21,7 @@ module Tomlrb
18
21
  def self.parse(string_or_io, **options)
19
22
  io = string_or_io.is_a?(String) ? StringIO.new(string_or_io) : string_or_io
20
23
  scanner = Scanner.new(io)
21
- parser = Parser.new(scanner, options)
24
+ parser = Parser.new(scanner, **options)
22
25
  begin
23
26
  handler = parser.parse
24
27
  rescue Racc::ParseError => e
@@ -39,6 +42,6 @@ module Tomlrb
39
42
  # default external encoding. The default external encoding is set by
40
43
  # locale encoding or the interpreter -E option.
41
44
  tmp = File.read(path, :encoding=>'utf-8')
42
- Tomlrb.parse(tmp, options)
45
+ Tomlrb.parse(tmp, **options)
43
46
  end
44
47
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.14
4
- # from Racc grammer file "".
3
+ # This file is automatically generated by Racc 1.5.1
4
+ # from Racc grammar file "".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -10,150 +10,177 @@ module Tomlrb
10
10
  ##### State transition tables begin ###
11
11
 
12
12
  racc_action_table = [
13
- 2, 17, 11, 31, 12, 31, 13, 27, 14, 77,
14
- 15, 16, 8, 78, 32, 10, 33, 29, 34, 29,
15
- 57, 58, 59, 60, 56, 53, 52, 54, 55, 46,
16
- 40, 41, 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, 35, 36, 10, 57,
19
- 58, 59, 60, 56, 53, 52, 54, 55, 46, 37,
20
- 38, 10, 57, 58, 59, 60, 56, 53, 52, 54,
21
- 55, 46, 43, 66, 10, 57, 58, 59, 60, 56,
22
- 53, 52, 54, 55, 46, nil, 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, 73, 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, 43, 16, 41, 17, 42, 18, 44, 45, 19,
14
+ 20, 14, 21, 22, 8, 4, 10, 48, 49, 12,
15
+ 23, 39, 69, 70, 71, 72, 67, 68, 64, 65,
16
+ 62, 63, 66, 52, 36, 56, 46, 53, 12, 69,
17
+ 70, 71, 72, 67, 68, 64, 65, 62, 63, 66,
18
+ 84, 83, 56, 39, 75, 12, 69, 70, 71, 72,
19
+ 67, 68, 64, 65, 62, 63, 66, 88, 80, 56,
20
+ 86, 81, 12, 69, 70, 71, 72, 67, 68, 64,
21
+ 65, 62, 63, 66, 88, 41, 56, 86, nil, 12,
22
+ 69, 70, 71, 72, 67, 68, 64, 65, 62, 63,
23
+ 66, 88, nil, 56, 86, nil, 12, 69, 70, 71,
24
+ 72, 67, 68, 64, 65, 62, 63, 66, 88, nil,
25
+ 56, 86, 29, 12, 30, nil, 31, nil, nil, 32,
26
+ 33, 27, 34, 35, 29, nil, 30, 25, 31, nil,
27
+ nil, 32, 33, 78, 34, 35, 16, nil, 17, 25,
28
+ 18, nil, nil, 19, 20, 74, 21, 22, 93, nil,
29
+ nil, 91, nil, nil, nil, 92 ]
29
30
 
30
31
  racc_action_check = [
31
- 1, 2, 1, 9, 1, 70, 1, 8, 1, 74,
32
- 1, 1, 1, 74, 11, 1, 12, 9, 13, 70,
33
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
34
- 20, 20, 32, 33, 33, 33, 33, 33, 33, 33,
35
- 33, 33, 33, 42, 42, 33, 34, 34, 34, 34,
36
- 34, 34, 34, 34, 34, 34, 14, 15, 34, 35,
37
- 35, 35, 35, 35, 35, 35, 35, 35, 35, 16,
38
- 19, 35, 36, 36, 36, 36, 36, 36, 36, 36,
39
- 36, 36, 30, 40, 36, 37, 37, 37, 37, 37,
40
- 37, 37, 37, 37, 37, nil, nil, 37, 43, 43,
41
- 43, 43, 43, 43, 43, 43, 43, 43, nil, nil,
42
- 43, 45, 45, 45, 45, 45, 45, 45, 45, 45,
43
- 45, 45, nil, 45, 78, 78, 78, 78, 78, 78,
44
- 78, 78, 78, 78, 78, 7, 78, 7, nil, 7,
45
- nil, 7, nil, 7, 7, 41, 7, 41, nil, 41,
46
- nil, 41, nil, 41, 41, nil, 41 ]
32
+ 1, 13, 1, 11, 1, 13, 1, 24, 24, 1,
33
+ 1, 1, 1, 1, 1, 1, 1, 26, 26, 1,
34
+ 2, 11, 42, 42, 42, 42, 42, 42, 42, 42,
35
+ 42, 42, 42, 40, 10, 42, 25, 40, 42, 53,
36
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
37
+ 54, 54, 53, 38, 48, 53, 55, 55, 55, 55,
38
+ 55, 55, 55, 55, 55, 55, 55, 55, 51, 55,
39
+ 55, 52, 55, 88, 88, 88, 88, 88, 88, 88,
40
+ 88, 88, 88, 88, 88, 80, 88, 88, nil, 88,
41
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
42
+ 92, 92, nil, 92, 92, nil, 92, 93, 93, 93,
43
+ 93, 93, 93, 93, 93, 93, 93, 93, 93, nil,
44
+ 93, 93, 9, 93, 9, nil, 9, nil, nil, 9,
45
+ 9, 9, 9, 9, 49, nil, 49, 9, 49, nil,
46
+ nil, 49, 49, 49, 49, 49, 43, nil, 43, 49,
47
+ 43, nil, nil, 43, 43, 43, 43, 43, 87, nil,
48
+ nil, 87, nil, nil, nil, 87 ]
47
49
 
48
50
  racc_action_pointer = [
49
- nil, 0, 1, nil, nil, nil, nil, 133, -5, 1,
50
- nil, -4, -2, 0, 38, 39, 51, nil, nil, 57,
51
- 17, nil, nil, nil, nil, nil, nil, nil, nil, nil,
52
- 64, nil, 17, 30, 43, 56, 69, 82, nil, nil,
53
- 70, 143, 27, 95, nil, 108, nil, nil, nil, nil,
51
+ nil, 0, 20, nil, nil, nil, nil, nil, nil, 120,
52
+ 18, 1, nil, -17, nil, nil, nil, nil, nil, nil,
53
+ nil, nil, nil, nil, -7, 19, 0, nil, nil, nil,
54
+ nil, nil, nil, nil, nil, nil, nil, nil, 33, nil,
55
+ 15, nil, 19, 144, nil, nil, nil, nil, 37, 132,
56
+ nil, 47, 69, 36, 36, 53, nil, nil, nil, nil,
54
57
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
55
58
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
56
- 3, nil, nil, nil, -4, nil, nil, nil, 121, nil ]
59
+ 83, nil, nil, nil, nil, nil, nil, 144, 70, nil,
60
+ nil, nil, 87, 104, nil, nil, nil ]
57
61
 
58
62
  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,
64
- -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 ]
63
+ -1, -77, -77, -2, -3, -4, -5, -6, -7, -77,
64
+ -11, -77, -31, -77, -43, -44, -45, -46, -47, -48,
65
+ -49, -50, -51, 97, -77, -13, -77, -20, -21, -22,
66
+ -23, -24, -25, -26, -27, -28, -10, -29, -77, -32,
67
+ -77, -37, -65, -77, -8, -9, -12, -14, -16, -77,
68
+ -30, -33, -77, -65, -77, -65, -59, -60, -61, -62,
69
+ -63, -64, -66, -67, -68, -69, -70, -71, -72, -73,
70
+ -74, -75, -76, -41, -42, -15, -17, -18, -19, -34,
71
+ -77, -36, -38, -39, -40, -52, -53, -77, -65, -35,
72
+ -54, -56, -65, -65, -55, -57, -58 ]
67
73
 
68
74
  racc_goto_table = [
69
- 28, 18, 1, 72, 44, 61, 62, 63, 64, 65,
70
- 3, 4, 5, 6, 7, 71, 39, 42, 68, 76,
75
+ 38, 15, 24, 85, 28, 37, 54, 1, 3, 5,
76
+ 6, 7, 9, 47, 51, 79, 13, 82, 90, nil,
71
77
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
72
- nil, nil, nil, nil, nil, 67, 79, nil, nil, nil,
78
+ nil, nil, 50, nil, nil, nil, 94, nil, nil, nil,
79
+ 95, 96, 76, 73, 77, nil, nil, nil, nil, nil,
73
80
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
74
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
75
- nil, 75 ]
81
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 89 ]
76
82
 
77
83
  racc_goto_check = [
78
- 11, 7, 1, 18, 15, 15, 15, 15, 15, 15,
79
- 2, 3, 4, 5, 6, 15, 9, 13, 14, 19,
80
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
81
- nil, nil, nil, nil, nil, 7, 18, nil, nil, nil,
84
+ 13, 19, 7, 22, 10, 12, 17, 1, 2, 3,
85
+ 4, 5, 6, 9, 15, 16, 18, 17, 23, nil,
82
86
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
87
+ nil, nil, 12, nil, nil, nil, 22, nil, nil, nil,
88
+ 22, 22, 7, 19, 10, nil, nil, nil, nil, nil,
83
89
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
84
- nil, 11 ]
90
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 13 ]
85
91
 
86
92
  racc_goto_pointer = [
87
- nil, 2, 9, 10, 11, 12, 13, -6, nil, -4,
88
- nil, -9, nil, -13, -24, -28, nil, nil, -42, -55,
89
- nil, nil, nil ]
93
+ nil, 7, 7, 8, 9, 10, 11, -7, nil, -13,
94
+ -5, nil, -6, -11, nil, -26, -36, -36, 15, 0,
95
+ nil, nil, -52, -69, nil, nil, nil ]
90
96
 
91
97
  racc_goto_default = [
92
- nil, nil, nil, nil, nil, 49, nil, nil, 20, nil,
93
- 9, nil, 30, nil, nil, 74, 48, 45, nil, nil,
94
- 47, 50, 51 ]
98
+ nil, nil, nil, nil, nil, 59, nil, nil, 26, nil,
99
+ nil, 11, nil, nil, 40, nil, nil, 87, nil, nil,
100
+ 58, 55, nil, nil, 57, 60, 61 ]
95
101
 
96
102
  racc_reduce_table = [
97
103
  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,
103
- 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,
104
+ 0, 24, :_reduce_none,
118
105
  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,
106
+ 2, 24, :_reduce_none,
107
+ 1, 25, :_reduce_none,
108
+ 1, 25, :_reduce_none,
109
+ 1, 25, :_reduce_none,
110
+ 1, 25, :_reduce_none,
111
+ 3, 26, :_reduce_none,
112
+ 3, 26, :_reduce_none,
113
+ 2, 29, :_reduce_10,
114
+ 1, 29, :_reduce_11,
115
+ 2, 30, :_reduce_12,
116
+ 1, 30, :_reduce_13,
117
+ 2, 30, :_reduce_none,
118
+ 2, 32, :_reduce_15,
119
+ 1, 32, :_reduce_16,
125
120
  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,
132
- 2, 35, :_reduce_none,
133
- 1, 37, :_reduce_36,
134
- 2, 37, :_reduce_none,
135
- 1, 38, :_reduce_38,
121
+ 3, 31, :_reduce_18,
122
+ 3, 31, :_reduce_19,
123
+ 1, 31, :_reduce_20,
124
+ 1, 31, :_reduce_21,
125
+ 1, 33, :_reduce_none,
126
+ 1, 33, :_reduce_none,
127
+ 1, 33, :_reduce_none,
128
+ 1, 33, :_reduce_none,
129
+ 1, 33, :_reduce_none,
130
+ 1, 33, :_reduce_none,
131
+ 1, 33, :_reduce_none,
132
+ 2, 28, :_reduce_none,
133
+ 3, 28, :_reduce_none,
134
+ 1, 34, :_reduce_31,
135
+ 1, 35, :_reduce_32,
136
+ 2, 36, :_reduce_none,
137
+ 3, 36, :_reduce_none,
138
+ 2, 39, :_reduce_none,
139
+ 3, 37, :_reduce_36,
140
+ 1, 37, :_reduce_37,
136
141
  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
142
+ 4, 27, :_reduce_39,
143
+ 4, 27, :_reduce_40,
144
+ 3, 41, :_reduce_41,
145
+ 3, 41, :_reduce_42,
146
+ 1, 41, :_reduce_43,
147
+ 1, 41, :_reduce_44,
148
+ 1, 42, :_reduce_none,
149
+ 1, 42, :_reduce_none,
150
+ 1, 42, :_reduce_none,
151
+ 1, 42, :_reduce_none,
152
+ 1, 42, :_reduce_none,
153
+ 1, 42, :_reduce_none,
154
+ 1, 42, :_reduce_none,
155
+ 2, 43, :_reduce_none,
156
+ 1, 45, :_reduce_53,
157
+ 2, 45, :_reduce_none,
158
+ 2, 45, :_reduce_none,
159
+ 1, 46, :_reduce_56,
160
+ 2, 46, :_reduce_none,
161
+ 2, 46, :_reduce_none,
162
+ 1, 44, :_reduce_59,
163
+ 1, 40, :_reduce_60,
164
+ 1, 40, :_reduce_none,
165
+ 1, 40, :_reduce_none,
166
+ 1, 47, :_reduce_none,
167
+ 1, 47, :_reduce_none,
168
+ 0, 49, :_reduce_none,
169
+ 1, 49, :_reduce_66,
170
+ 1, 49, :_reduce_67,
171
+ 1, 49, :_reduce_68,
172
+ 1, 49, :_reduce_69,
173
+ 1, 49, :_reduce_70,
174
+ 1, 49, :_reduce_71,
175
+ 1, 49, :_reduce_72,
176
+ 1, 48, :_reduce_73,
177
+ 1, 48, :_reduce_74,
178
+ 1, 48, :_reduce_75,
179
+ 1, 48, :_reduce_76 ]
180
+
181
+ racc_reduce_n = 77
182
+
183
+ racc_shift_n = 97
157
184
 
158
185
  racc_token_table = {
159
186
  false => 0,
@@ -164,19 +191,23 @@ racc_token_table = {
164
191
  :STRING_LITERAL_MULTI => 5,
165
192
  :STRING_LITERAL => 6,
166
193
  :DATETIME => 7,
167
- :INTEGER => 8,
168
- :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
194
+ :LOCAL_TIME => 8,
195
+ :INTEGER => 9,
196
+ :NON_DEC_INTEGER => 10,
197
+ :FLOAT => 11,
198
+ :FLOAT_KEYWORD => 12,
199
+ :BOOLEAN => 13,
200
+ :NEWLINE => 14,
201
+ :EOS => 15,
202
+ "[" => 16,
203
+ "]" => 17,
204
+ "." => 18,
205
+ "{" => 19,
206
+ "}" => 20,
207
+ "," => 21,
208
+ "=" => 22 }
209
+
210
+ racc_nt_base = 23
180
211
 
181
212
  racc_use_result_var = true
182
213
 
@@ -205,10 +236,14 @@ Racc_token_to_s_table = [
205
236
  "STRING_LITERAL_MULTI",
206
237
  "STRING_LITERAL",
207
238
  "DATETIME",
239
+ "LOCAL_TIME",
208
240
  "INTEGER",
241
+ "NON_DEC_INTEGER",
209
242
  "FLOAT",
210
- "TRUE",
211
- "FALSE",
243
+ "FLOAT_KEYWORD",
244
+ "BOOLEAN",
245
+ "NEWLINE",
246
+ "EOS",
212
247
  "\"[\"",
213
248
  "\"]\"",
214
249
  "\".\"",
@@ -226,12 +261,16 @@ Racc_token_to_s_table = [
226
261
  "table_continued",
227
262
  "table_identifier",
228
263
  "table_next",
264
+ "table_identifier_component",
229
265
  "inline_table_start",
266
+ "inline_table_end",
230
267
  "inline_continued",
231
268
  "inline_assignment_key",
232
269
  "inline_assignment_value",
233
270
  "inline_next",
234
271
  "value",
272
+ "assignment_key",
273
+ "assignment_key_component",
235
274
  "array",
236
275
  "start_array",
237
276
  "array_continued",
@@ -258,278 +297,358 @@ Racc_debug_parser = false
258
297
 
259
298
  # reduce 6 omitted
260
299
 
261
- module_eval(<<'.,.,', 'parser.y', 15)
262
- def _reduce_7(val, _values, result)
263
- @handler.start_(:array_of_tables)
264
- result
265
- end
266
- .,.,
300
+ # reduce 7 omitted
267
301
 
268
- module_eval(<<'.,.,', 'parser.y', 16)
269
- def _reduce_8(val, _values, result)
270
- @handler.start_(:table)
271
- result
272
- end
273
- .,.,
302
+ # reduce 8 omitted
274
303
 
275
- module_eval(<<'.,.,', 'parser.y', 19)
276
- def _reduce_9(val, _values, result)
277
- array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
304
+ # reduce 9 omitted
305
+
306
+ module_eval(<<'.,.,', 'parser.y', 18)
307
+ def _reduce_10(val, _values, result)
308
+ @handler.start_(:array_of_tables)
278
309
  result
279
310
  end
280
311
  .,.,
281
312
 
282
- module_eval(<<'.,.,', 'parser.y', 20)
283
- def _reduce_10(val, _values, result)
284
- array = @handler.end_(:table); @handler.set_context(array)
313
+ module_eval(<<'.,.,', 'parser.y', 19)
314
+ def _reduce_11(val, _values, result)
315
+ @handler.start_(:table)
285
316
  result
286
317
  end
287
318
  .,.,
288
319
 
289
- # reduce 11 omitted
290
-
291
- module_eval(<<'.,.,', 'parser.y', 24)
320
+ module_eval(<<'.,.,', 'parser.y', 22)
292
321
  def _reduce_12(val, _values, result)
293
- array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
322
+ array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
294
323
  result
295
324
  end
296
325
  .,.,
297
326
 
298
- module_eval(<<'.,.,', 'parser.y', 25)
327
+ module_eval(<<'.,.,', 'parser.y', 23)
299
328
  def _reduce_13(val, _values, result)
300
- array = @handler.end_(:table); @handler.set_context(array)
329
+ array = @handler.end_(:table); @handler.set_context(array)
301
330
  result
302
331
  end
303
332
  .,.,
304
333
 
305
334
  # reduce 14 omitted
306
335
 
307
- module_eval(<<'.,.,', 'parser.y', 29)
336
+ module_eval(<<'.,.,', 'parser.y', 27)
308
337
  def _reduce_15(val, _values, result)
309
- @handler.push(val[0])
338
+ array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
310
339
  result
311
340
  end
312
341
  .,.,
313
342
 
314
- module_eval(<<'.,.,', 'parser.y', 30)
343
+ module_eval(<<'.,.,', 'parser.y', 28)
315
344
  def _reduce_16(val, _values, result)
316
- @handler.push(val[0])
345
+ array = @handler.end_(:table); @handler.set_context(array)
317
346
  result
318
347
  end
319
348
  .,.,
320
349
 
321
- module_eval(<<'.,.,', 'parser.y', 31)
322
- def _reduce_17(val, _values, result)
323
- @handler.push(val[0])
324
- result
325
- end
326
- .,.,
350
+ # reduce 17 omitted
327
351
 
328
352
  module_eval(<<'.,.,', 'parser.y', 32)
329
353
  def _reduce_18(val, _values, result)
330
- @handler.push(val[0])
354
+ @handler.push(val[2])
331
355
  result
332
356
  end
333
357
  .,.,
334
358
 
335
359
  module_eval(<<'.,.,', 'parser.y', 33)
336
360
  def _reduce_19(val, _values, result)
337
- @handler.push(val[0])
361
+ val[2].split('.').each { |k| @handler.push(k) }
338
362
  result
339
363
  end
340
364
  .,.,
341
365
 
342
- module_eval(<<'.,.,', 'parser.y', 34)
366
+ module_eval(<<'.,.,', 'parser.y', 35)
343
367
  def _reduce_20(val, _values, result)
344
- @handler.push(val[0])
368
+ keys = val[0].split('.')
369
+ @handler.start_(:table)
370
+ keys.each { |key| @handler.push(key) }
371
+
345
372
  result
346
373
  end
347
374
  .,.,
348
375
 
349
- # reduce 21 omitted
350
-
351
- module_eval(<<'.,.,', 'parser.y', 40)
352
- def _reduce_22(val, _values, result)
353
- @handler.start_(:inline)
376
+ module_eval(<<'.,.,', 'parser.y', 39)
377
+ def _reduce_21(val, _values, result)
378
+ @handler.push(val[0])
354
379
  result
355
380
  end
356
381
  .,.,
357
382
 
358
- module_eval(<<'.,.,', 'parser.y', 43)
359
- def _reduce_23(val, _values, result)
360
- array = @handler.end_(:inline); @handler.push(Hash[*array])
383
+ # reduce 22 omitted
384
+
385
+ # reduce 23 omitted
386
+
387
+ # reduce 24 omitted
388
+
389
+ # reduce 25 omitted
390
+
391
+ # reduce 26 omitted
392
+
393
+ # reduce 27 omitted
394
+
395
+ # reduce 28 omitted
396
+
397
+ # reduce 29 omitted
398
+
399
+ # reduce 30 omitted
400
+
401
+ module_eval(<<'.,.,', 'parser.y', 55)
402
+ def _reduce_31(val, _values, result)
403
+ @handler.start_(:inline)
361
404
  result
362
405
  end
363
406
  .,.,
364
407
 
365
- # reduce 24 omitted
366
-
367
- module_eval(<<'.,.,', 'parser.y', 48)
368
- def _reduce_25(val, _values, result)
408
+ module_eval(<<'.,.,', 'parser.y', 59)
409
+ def _reduce_32(val, _values, result)
369
410
  array = @handler.end_(:inline)
370
411
  array.map!.with_index{ |n,i| i.even? ? n.to_sym : n } if @handler.symbolize_keys
371
412
  @handler.push(Hash[*array])
372
-
413
+
373
414
  result
374
415
  end
375
416
  .,.,
376
417
 
377
- # reduce 26 omitted
418
+ # reduce 33 omitted
419
+
420
+ # reduce 34 omitted
421
+
422
+ # reduce 35 omitted
423
+
424
+ module_eval(<<'.,.,', 'parser.y', 73)
425
+ def _reduce_36(val, _values, result)
426
+ array = @handler.end_(:inline)
427
+ array.each { |key| @handler.push(key) }
428
+ @handler.start_(:inline)
429
+ @handler.push(val[2])
378
430
 
379
- module_eval(<<'.,.,', 'parser.y', 55)
380
- def _reduce_27(val, _values, result)
381
- @handler.push(val[0])
382
431
  result
383
432
  end
384
433
  .,.,
385
434
 
386
- # reduce 28 omitted
435
+ module_eval(<<'.,.,', 'parser.y', 78)
436
+ def _reduce_37(val, _values, result)
437
+ @handler.push(val[0])
438
+ result
439
+ end
440
+ .,.,
441
+
442
+ # reduce 38 omitted
443
+
444
+ module_eval(<<'.,.,', 'parser.y', 85)
445
+ def _reduce_39(val, _values, result)
446
+ keys = @handler.end_(:keys)
447
+ @handler.push(keys.pop)
448
+ @handler.assign(keys)
387
449
 
388
- module_eval(<<'.,.,', 'parser.y', 61)
389
- def _reduce_29(val, _values, result)
390
- @handler.assign(val[0])
391
450
  result
392
451
  end
393
452
  .,.,
394
453
 
395
- module_eval(<<'.,.,', 'parser.y', 62)
396
- def _reduce_30(val, _values, result)
397
- @handler.assign(val[0])
454
+ module_eval(<<'.,.,', 'parser.y', 90)
455
+ def _reduce_40(val, _values, result)
456
+ keys = @handler.end_(:keys)
457
+ @handler.push(keys.pop)
458
+ @handler.assign(keys)
459
+
398
460
  result
399
461
  end
400
462
  .,.,
401
463
 
402
- module_eval(<<'.,.,', 'parser.y', 63)
403
- def _reduce_31(val, _values, result)
404
- @handler.assign(val[0])
464
+ module_eval(<<'.,.,', 'parser.y', 96)
465
+ def _reduce_41(val, _values, result)
466
+ @handler.push(val[2])
405
467
  result
406
468
  end
407
469
  .,.,
408
470
 
409
- module_eval(<<'.,.,', 'parser.y', 64)
410
- def _reduce_32(val, _values, result)
411
- @handler.assign(val[0])
471
+ module_eval(<<'.,.,', 'parser.y', 97)
472
+ def _reduce_42(val, _values, result)
473
+ val[2].split('.').each { |k| @handler.push(k) }
412
474
  result
413
475
  end
414
476
  .,.,
415
477
 
416
- module_eval(<<'.,.,', 'parser.y', 65)
417
- def _reduce_33(val, _values, result)
418
- @handler.assign(val[0])
478
+ module_eval(<<'.,.,', 'parser.y', 99)
479
+ def _reduce_43(val, _values, result)
480
+ keys = val[0].split('.')
481
+ @handler.start_(:keys)
482
+ keys.each { |key| @handler.push(key) }
483
+
419
484
  result
420
485
  end
421
486
  .,.,
422
487
 
423
- module_eval(<<'.,.,', 'parser.y', 66)
424
- def _reduce_34(val, _values, result)
425
- @handler.assign(val[0])
488
+ module_eval(<<'.,.,', 'parser.y', 103)
489
+ def _reduce_44(val, _values, result)
490
+ @handler.start_(:keys); @handler.push(val[0])
426
491
  result
427
492
  end
428
493
  .,.,
429
494
 
430
- # reduce 35 omitted
495
+ # reduce 45 omitted
431
496
 
432
- module_eval(<<'.,.,', 'parser.y', 72)
433
- def _reduce_36(val, _values, result)
434
- array = @handler.end_(:array); @handler.push(array)
497
+ # reduce 46 omitted
498
+
499
+ # reduce 47 omitted
500
+
501
+ # reduce 48 omitted
502
+
503
+ # reduce 49 omitted
504
+
505
+ # reduce 50 omitted
506
+
507
+ # reduce 51 omitted
508
+
509
+ # reduce 52 omitted
510
+
511
+ module_eval(<<'.,.,', 'parser.y', 118)
512
+ def _reduce_53(val, _values, result)
513
+ array = @handler.end_(:array); @handler.push(array)
435
514
  result
436
515
  end
437
516
  .,.,
438
517
 
439
- # reduce 37 omitted
518
+ # reduce 54 omitted
440
519
 
441
- module_eval(<<'.,.,', 'parser.y', 76)
442
- def _reduce_38(val, _values, result)
443
- array = @handler.end_(:array); @handler.push(array)
520
+ # reduce 55 omitted
521
+
522
+ module_eval(<<'.,.,', 'parser.y', 123)
523
+ def _reduce_56(val, _values, result)
524
+ array = @handler.end_(:array); @handler.push(array)
444
525
  result
445
526
  end
446
527
  .,.,
447
528
 
448
- # reduce 39 omitted
529
+ # reduce 57 omitted
449
530
 
450
- module_eval(<<'.,.,', 'parser.y', 80)
451
- def _reduce_40(val, _values, result)
452
- @handler.start_(:array)
531
+ # reduce 58 omitted
532
+
533
+ module_eval(<<'.,.,', 'parser.y', 128)
534
+ def _reduce_59(val, _values, result)
535
+ @handler.start_(:array)
453
536
  result
454
537
  end
455
538
  .,.,
456
539
 
457
- module_eval(<<'.,.,', 'parser.y', 83)
458
- def _reduce_41(val, _values, result)
459
- @handler.push(val[0])
540
+ module_eval(<<'.,.,', 'parser.y', 131)
541
+ def _reduce_60(val, _values, result)
542
+ @handler.push(val[0])
460
543
  result
461
544
  end
462
545
  .,.,
463
546
 
464
- # reduce 42 omitted
547
+ # reduce 61 omitted
465
548
 
466
- # reduce 43 omitted
549
+ # reduce 62 omitted
467
550
 
468
- # reduce 44 omitted
551
+ # reduce 63 omitted
469
552
 
470
- # reduce 45 omitted
553
+ # reduce 64 omitted
471
554
 
472
- # reduce 46 omitted
555
+ # reduce 65 omitted
473
556
 
474
- module_eval(<<'.,.,', 'parser.y', 92)
475
- def _reduce_47(val, _values, result)
476
- result = val[0].to_f
557
+ module_eval(<<'.,.,', 'parser.y', 140)
558
+ def _reduce_66(val, _values, result)
559
+ result = val[0].to_f
477
560
  result
478
561
  end
479
562
  .,.,
480
563
 
481
- module_eval(<<'.,.,', 'parser.y', 93)
482
- def _reduce_48(val, _values, result)
483
- result = val[0].to_i
564
+ module_eval(<<'.,.,', 'parser.y', 142)
565
+ def _reduce_67(val, _values, result)
566
+ v = val[0]
567
+ result = if v.end_with?('nan')
568
+ Float::NAN
569
+ else
570
+ (v[0] == '-' ? -1 : 1) * Float::INFINITY
571
+ end
572
+
484
573
  result
485
574
  end
486
575
  .,.,
487
576
 
488
- module_eval(<<'.,.,', 'parser.y', 94)
489
- def _reduce_49(val, _values, result)
490
- result = true
577
+ module_eval(<<'.,.,', 'parser.y', 149)
578
+ def _reduce_68(val, _values, result)
579
+ result = val[0].to_i
491
580
  result
492
581
  end
493
582
  .,.,
494
583
 
495
- module_eval(<<'.,.,', 'parser.y', 95)
496
- def _reduce_50(val, _values, result)
497
- result = false
584
+ module_eval(<<'.,.,', 'parser.y', 151)
585
+ def _reduce_69(val, _values, result)
586
+ base = case val[0][1]
587
+ when "x" then 16
588
+ when "o" then 8
589
+ when "b" then 2
590
+ end
591
+ result = val[0].to_i(base)
592
+
498
593
  result
499
594
  end
500
595
  .,.,
501
596
 
502
- module_eval(<<'.,.,', 'parser.y', 96)
503
- def _reduce_51(val, _values, result)
504
- result = Time.new(*val[0])
597
+ module_eval(<<'.,.,', 'parser.y', 158)
598
+ def _reduce_70(val, _values, result)
599
+ result = val[0] == 'true' ? true : false
505
600
  result
506
601
  end
507
602
  .,.,
508
603
 
509
- module_eval(<<'.,.,', 'parser.y', 99)
510
- def _reduce_52(val, _values, result)
511
- result = StringUtils.replace_escaped_chars(StringUtils.multiline_replacements(val[0]))
604
+ module_eval(<<'.,.,', 'parser.y', 160)
605
+ def _reduce_71(val, _values, result)
606
+ v = val[0]
607
+ result = if v[6].nil?
608
+ if v[4].nil?
609
+ LocalDate.new(v[0], v[1], v[2])
610
+ else
611
+ LocalDateTime.new(v[0], v[1], v[2], v[3] || 0, v[4] || 0, v[5].to_f)
612
+ end
613
+ else
614
+ Time.new(v[0], v[1], v[2], v[3] || 0, v[4] || 0, v[5].to_f, v[6])
615
+ end
616
+
512
617
  result
513
618
  end
514
619
  .,.,
515
620
 
516
- module_eval(<<'.,.,', 'parser.y', 100)
517
- def _reduce_53(val, _values, result)
518
- result = StringUtils.replace_escaped_chars(val[0])
621
+ module_eval(<<'.,.,', 'parser.y', 171)
622
+ def _reduce_72(val, _values, result)
623
+ result = LocalTime.new(*val[0])
624
+ result
625
+ end
626
+ .,.,
627
+
628
+ module_eval(<<'.,.,', 'parser.y', 174)
629
+ def _reduce_73(val, _values, result)
630
+ result = StringUtils.replace_escaped_chars(StringUtils.multiline_replacements(val[0]))
631
+ result
632
+ end
633
+ .,.,
634
+
635
+ module_eval(<<'.,.,', 'parser.y', 175)
636
+ def _reduce_74(val, _values, result)
637
+ result = StringUtils.replace_escaped_chars(val[0])
519
638
  result
520
639
  end
521
640
  .,.,
522
641
 
523
- module_eval(<<'.,.,', 'parser.y', 101)
524
- def _reduce_54(val, _values, result)
525
- result = StringUtils.strip_spaces(val[0])
642
+ module_eval(<<'.,.,', 'parser.y', 176)
643
+ def _reduce_75(val, _values, result)
644
+ result = StringUtils.strip_spaces(val[0])
526
645
  result
527
646
  end
528
647
  .,.,
529
648
 
530
- module_eval(<<'.,.,', 'parser.y', 102)
531
- def _reduce_55(val, _values, result)
532
- result = val[0]
649
+ module_eval(<<'.,.,', 'parser.y', 177)
650
+ def _reduce_76(val, _values, result)
651
+ result = val[0]
533
652
  result
534
653
  end
535
654
  .,.,
@@ -539,4 +658,4 @@ def _reduce_none(val, _values, result)
539
658
  end
540
659
 
541
660
  end # class GeneratedParser
542
- end # module Tomlrb
661
+ end # module Tomlrb