tomlrb 1.2.6 → 2.0.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
- SHA1:
3
- metadata.gz: 68ff6a39fb4b176a95742a9e4ac1479b043f1a3a
4
- data.tar.gz: f194abd1850832fd2db66c1e27e037a9c8c76e41
2
+ SHA256:
3
+ metadata.gz: 14e652fc5bed850a8eeca40457bf6e41239de4bb2680e82e02c962bfd69ec7ba
4
+ data.tar.gz: ffce44339d664c830873b002d0f236ee271e297b7a6f41dcefdce292ad872f72
5
5
  SHA512:
6
- metadata.gz: 45d1317b8f190b1ad5f8d4446e3433c9c2caa36b6dfddf7798a89a7d9c7d14f6a28a257bb46cf695b23f13b762d4cfcd0e3ad8141e209a1f111a8784a13af8f6
7
- data.tar.gz: a0b2e86ae8b3a260820895a655bdb94aa280a1de2322f4307c84bb7056e1a53af5edcd6ee42f829bb78ec91f9bc395857e4e2e2b87523c9c5c94cccdc814f5e3
6
+ metadata.gz: d536f0eac4b0a13628368bf6b76bdb8a8e701807e9f4712b2dcb6805298a63c77d7774d1e9af5933404fbb5858b936bd4ed99dc55b0b0e0f4b519142f6dd5b0d
7
+ data.tar.gz: 97284454aa9099242a5050364b8fd8b95bdcde050ffcca5653dc02873e182066b6bfa6bfad643d6ca751365ebb788f600be42ef6f11736689aab3a4282c1ac24
@@ -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,215 @@ 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, 51, 16, 49, 17, 50, 18, 54, 55, 96,
14
+ 95, 19, 20, 21, 22, 14, 23, 24, 25, 26,
15
+ 8, 4, 10, 27, 44, 12, 52, 47, 81, 82,
16
+ 83, 84, 77, 78, 79, 80, 71, 72, 73, 74,
17
+ 68, 69, 70, 75, 76, 58, 47, 62, 87, 59,
18
+ 12, 81, 82, 83, 84, 77, 78, 79, 80, 71,
19
+ 72, 73, 74, 68, 69, 70, 75, 76, 92, 93,
20
+ 62, 49, nil, 12, 81, 82, 83, 84, 77, 78,
21
+ 79, 80, 71, 72, 73, 74, 68, 69, 70, 75,
22
+ 76, 100, nil, 62, 98, nil, 12, 81, 82, 83,
23
+ 84, 77, 78, 79, 80, 71, 72, 73, 74, 68,
24
+ 69, 70, 75, 76, 100, nil, 62, 98, nil, 12,
25
+ 81, 82, 83, 84, 77, 78, 79, 80, 71, 72,
26
+ 73, 74, 68, 69, 70, 75, 76, 107, nil, 62,
27
+ 98, nil, 12, 81, 82, 83, 84, 77, 78, 79,
28
+ 80, 71, 72, 73, 74, 68, 69, 70, 75, 76,
29
+ 100, nil, 62, 98, nil, 12, 81, 82, 83, 84,
30
+ 77, 78, 79, 80, 71, 72, 73, 74, 68, 69,
31
+ 70, 75, 76, 100, nil, 62, 98, 33, 12, 34,
32
+ nil, 35, nil, nil, nil, nil, 36, 37, 38, 39,
33
+ 31, 40, 41, 42, 43, 33, nil, 34, 29, 35,
34
+ nil, nil, nil, nil, 36, 37, 38, 39, 90, 40,
35
+ 41, 42, 43, 16, nil, 17, 29, 18, nil, nil,
36
+ nil, nil, 19, 20, 21, 22, 86, 23, 24, 25,
37
+ 26, 105, nil, nil, 103, nil, nil, nil, 104 ]
29
38
 
30
39
  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 ]
40
+ 1, 13, 1, 11, 1, 13, 1, 30, 30, 60,
41
+ 60, 1, 1, 1, 1, 1, 1, 1, 1, 1,
42
+ 1, 1, 1, 2, 10, 1, 29, 11, 50, 50,
43
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
44
+ 50, 50, 50, 50, 50, 48, 46, 50, 54, 48,
45
+ 50, 59, 59, 59, 59, 59, 59, 59, 59, 59,
46
+ 59, 59, 59, 59, 59, 59, 59, 59, 57, 58,
47
+ 59, 92, nil, 59, 61, 61, 61, 61, 61, 61,
48
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
49
+ 61, 61, nil, 61, 61, nil, 61, 100, 100, 100,
50
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
51
+ 100, 100, 100, 100, 100, nil, 100, 100, nil, 100,
52
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
53
+ 104, 104, 104, 104, 104, 104, 104, 104, nil, 104,
54
+ 104, nil, 104, 105, 105, 105, 105, 105, 105, 105,
55
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
56
+ 105, nil, 105, 105, nil, 105, 107, 107, 107, 107,
57
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
58
+ 107, 107, 107, 107, nil, 107, 107, 9, 107, 9,
59
+ nil, 9, nil, nil, nil, nil, 9, 9, 9, 9,
60
+ 9, 9, 9, 9, 9, 55, nil, 55, 9, 55,
61
+ nil, nil, nil, nil, 55, 55, 55, 55, 55, 55,
62
+ 55, 55, 55, 51, nil, 51, 55, 51, nil, nil,
63
+ nil, nil, 51, 51, 51, 51, 51, 51, 51, 51,
64
+ 51, 99, nil, nil, 99, nil, nil, nil, 99 ]
47
65
 
48
66
  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,
67
+ nil, 0, 23, nil, nil, nil, nil, nil, nil, 185,
68
+ 2, 1, nil, -23, nil, nil, nil, nil, nil, nil,
69
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 3,
70
+ -16, nil, nil, nil, nil, nil, nil, nil, nil, nil,
71
+ nil, nil, nil, nil, nil, nil, 20, nil, 21, nil,
72
+ 25, 221, nil, nil, 25, 203, nil, 41, 67, 48,
73
+ -11, 71, nil, nil, nil, nil, nil, nil, nil, nil,
54
74
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
55
75
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
56
- 3, nil, nil, nil, -4, nil, nil, nil, 121, nil ]
76
+ nil, nil, 69, nil, nil, nil, nil, nil, nil, 221,
77
+ 94, nil, nil, nil, 117, 140, nil, 163, nil, nil,
78
+ nil ]
57
79
 
58
80
  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 ]
81
+ -1, -91, -91, -2, -3, -4, -5, -6, -7, -91,
82
+ -10, -91, -34, -91, -46, -47, -48, -49, -50, -51,
83
+ -52, -53, -54, -55, -56, -57, -58, 111, -8, -12,
84
+ -91, -19, -20, -21, -22, -23, -24, -25, -26, -27,
85
+ -28, -29, -30, -31, -9, -32, -91, -35, -91, -40,
86
+ -73, -91, -11, -13, -15, -91, -33, -36, -91, -73,
87
+ -91, -73, -67, -68, -69, -70, -71, -72, -74, -75,
88
+ -76, -77, -78, -79, -80, -81, -82, -83, -84, -85,
89
+ -86, -87, -88, -89, -90, -44, -45, -14, -16, -17,
90
+ -18, -37, -91, -39, -41, -42, -43, -59, -60, -91,
91
+ -73, -38, -61, -63, -73, -73, -62, -73, -64, -65,
92
+ -62 ]
67
93
 
68
94
  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,
95
+ 46, 15, 28, 32, 45, 60, 1, 3, 5, 6,
96
+ 7, 97, 9, 53, 94, 57, 91, 13, 102, nil,
71
97
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
72
- nil, nil, nil, nil, nil, 67, 79, nil, nil, nil,
98
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 56,
99
+ nil, nil, nil, nil, nil, nil, nil, nil, 88, 89,
100
+ 106, 85, nil, nil, 108, 109, nil, 110, nil, nil,
73
101
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
74
102
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
75
- nil, 75 ]
103
+ nil, 101 ]
76
104
 
77
105
  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,
106
+ 13, 19, 7, 10, 12, 17, 1, 2, 3, 4,
107
+ 5, 22, 6, 9, 17, 15, 16, 18, 23, nil,
80
108
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
81
- nil, nil, nil, nil, nil, 7, 18, nil, nil, nil,
109
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 12,
110
+ nil, nil, nil, nil, nil, nil, nil, nil, 7, 10,
111
+ 22, 19, nil, nil, 22, 22, nil, 22, nil, nil,
82
112
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
83
113
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
84
- nil, 11 ]
114
+ nil, 13 ]
85
115
 
86
116
  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 ]
117
+ nil, 6, 6, 7, 8, 9, 11, -7, nil, -17,
118
+ -6, nil, -7, -11, nil, -33, -41, -45, 16, 0,
119
+ nil, nil, -50, -81, nil, nil, nil ]
90
120
 
91
121
  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 ]
122
+ nil, nil, nil, nil, nil, 65, nil, nil, 30, nil,
123
+ nil, 11, nil, nil, 48, nil, nil, 99, nil, nil,
124
+ 64, 61, nil, nil, 63, 66, 67 ]
95
125
 
96
126
  racc_reduce_table = [
97
127
  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,
118
- 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,
128
+ 0, 30, :_reduce_none,
129
+ 2, 30, :_reduce_none,
130
+ 2, 30, :_reduce_none,
131
+ 1, 31, :_reduce_none,
132
+ 1, 31, :_reduce_none,
133
+ 1, 31, :_reduce_none,
134
+ 1, 31, :_reduce_none,
125
135
  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,
136
+ 2, 35, :_reduce_9,
137
+ 1, 35, :_reduce_10,
138
+ 2, 36, :_reduce_11,
139
+ 1, 36, :_reduce_12,
140
+ 2, 36, :_reduce_none,
141
+ 2, 38, :_reduce_14,
142
+ 1, 38, :_reduce_15,
136
143
  2, 38, :_reduce_none,
137
- 1, 36, :_reduce_40,
138
- 1, 34, :_reduce_41,
139
- 1, 34, :_reduce_none,
140
- 1, 34, :_reduce_none,
144
+ 3, 37, :_reduce_17,
145
+ 3, 37, :_reduce_18,
146
+ 1, 37, :_reduce_19,
147
+ 1, 37, :_reduce_20,
141
148
  1, 39, :_reduce_none,
142
149
  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
150
+ 1, 39, :_reduce_none,
151
+ 1, 39, :_reduce_none,
152
+ 1, 39, :_reduce_none,
153
+ 1, 39, :_reduce_none,
154
+ 1, 39, :_reduce_none,
155
+ 1, 39, :_reduce_none,
156
+ 1, 39, :_reduce_none,
157
+ 1, 39, :_reduce_none,
158
+ 1, 39, :_reduce_none,
159
+ 2, 34, :_reduce_none,
160
+ 3, 34, :_reduce_none,
161
+ 1, 40, :_reduce_34,
162
+ 1, 41, :_reduce_35,
163
+ 2, 42, :_reduce_none,
164
+ 3, 42, :_reduce_none,
165
+ 2, 45, :_reduce_none,
166
+ 3, 43, :_reduce_39,
167
+ 1, 43, :_reduce_40,
168
+ 2, 44, :_reduce_none,
169
+ 4, 33, :_reduce_42,
170
+ 4, 33, :_reduce_43,
171
+ 3, 47, :_reduce_44,
172
+ 3, 47, :_reduce_45,
173
+ 1, 47, :_reduce_46,
174
+ 1, 47, :_reduce_47,
175
+ 1, 48, :_reduce_none,
176
+ 1, 48, :_reduce_none,
177
+ 1, 48, :_reduce_none,
178
+ 1, 48, :_reduce_none,
179
+ 1, 48, :_reduce_none,
180
+ 1, 48, :_reduce_none,
181
+ 1, 48, :_reduce_none,
182
+ 1, 48, :_reduce_none,
183
+ 1, 48, :_reduce_none,
184
+ 1, 48, :_reduce_none,
185
+ 1, 48, :_reduce_none,
186
+ 2, 49, :_reduce_none,
187
+ 1, 51, :_reduce_60,
188
+ 2, 51, :_reduce_none,
189
+ 2, 51, :_reduce_none,
190
+ 1, 52, :_reduce_63,
191
+ 2, 52, :_reduce_none,
192
+ 2, 52, :_reduce_none,
193
+ 3, 52, :_reduce_none,
194
+ 1, 50, :_reduce_67,
195
+ 1, 46, :_reduce_68,
196
+ 1, 46, :_reduce_none,
197
+ 1, 46, :_reduce_none,
198
+ 1, 53, :_reduce_none,
199
+ 1, 53, :_reduce_none,
200
+ 0, 55, :_reduce_none,
201
+ 1, 55, :_reduce_74,
202
+ 1, 55, :_reduce_75,
203
+ 1, 55, :_reduce_76,
204
+ 1, 55, :_reduce_77,
205
+ 1, 55, :_reduce_78,
206
+ 1, 55, :_reduce_79,
207
+ 1, 55, :_reduce_80,
208
+ 1, 55, :_reduce_81,
209
+ 1, 55, :_reduce_82,
210
+ 1, 55, :_reduce_83,
211
+ 1, 55, :_reduce_84,
212
+ 1, 55, :_reduce_85,
213
+ 1, 55, :_reduce_86,
214
+ 1, 54, :_reduce_87,
215
+ 1, 54, :_reduce_88,
216
+ 1, 54, :_reduce_89,
217
+ 1, 54, :_reduce_90 ]
218
+
219
+ racc_reduce_n = 91
220
+
221
+ racc_shift_n = 111
157
222
 
158
223
  racc_token_table = {
159
224
  false => 0,
@@ -164,19 +229,29 @@ racc_token_table = {
164
229
  :STRING_LITERAL_MULTI => 5,
165
230
  :STRING_LITERAL => 6,
166
231
  :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
232
+ :LOCAL_DATETIME => 8,
233
+ :LOCAL_DATE => 9,
234
+ :LOCAL_TIME => 10,
235
+ :INTEGER => 11,
236
+ :HEX_INTEGER => 12,
237
+ :OCT_INTEGER => 13,
238
+ :BIN_INTEGER => 14,
239
+ :FLOAT => 15,
240
+ :FLOAT_INF => 16,
241
+ :FLOAT_NAN => 17,
242
+ :TRUE => 18,
243
+ :FALSE => 19,
244
+ :NEWLINE => 20,
245
+ :EOS => 21,
246
+ "[" => 22,
247
+ "]" => 23,
248
+ "." => 24,
249
+ "{" => 25,
250
+ "}" => 26,
251
+ "," => 27,
252
+ "=" => 28 }
253
+
254
+ racc_nt_base = 29
180
255
 
181
256
  racc_use_result_var = true
182
257
 
@@ -205,10 +280,20 @@ Racc_token_to_s_table = [
205
280
  "STRING_LITERAL_MULTI",
206
281
  "STRING_LITERAL",
207
282
  "DATETIME",
283
+ "LOCAL_DATETIME",
284
+ "LOCAL_DATE",
285
+ "LOCAL_TIME",
208
286
  "INTEGER",
287
+ "HEX_INTEGER",
288
+ "OCT_INTEGER",
289
+ "BIN_INTEGER",
209
290
  "FLOAT",
291
+ "FLOAT_INF",
292
+ "FLOAT_NAN",
210
293
  "TRUE",
211
294
  "FALSE",
295
+ "NEWLINE",
296
+ "EOS",
212
297
  "\"[\"",
213
298
  "\"]\"",
214
299
  "\".\"",
@@ -226,12 +311,16 @@ Racc_token_to_s_table = [
226
311
  "table_continued",
227
312
  "table_identifier",
228
313
  "table_next",
314
+ "table_identifier_component",
229
315
  "inline_table_start",
316
+ "inline_table_end",
230
317
  "inline_continued",
231
318
  "inline_assignment_key",
232
319
  "inline_assignment_value",
233
320
  "inline_next",
234
321
  "value",
322
+ "assignment_key",
323
+ "assignment_key_component",
235
324
  "array",
236
325
  "start_array",
237
326
  "array_continued",
@@ -258,278 +347,394 @@ Racc_debug_parser = false
258
347
 
259
348
  # reduce 6 omitted
260
349
 
261
- module_eval(<<'.,.,', 'parser.y', 15)
262
- def _reduce_7(val, _values, result)
263
- @handler.start_(:array_of_tables)
264
- result
265
- end
266
- .,.,
350
+ # reduce 7 omitted
267
351
 
268
- module_eval(<<'.,.,', 'parser.y', 16)
269
- def _reduce_8(val, _values, result)
270
- @handler.start_(:table)
271
- result
272
- end
273
- .,.,
352
+ # reduce 8 omitted
274
353
 
275
- module_eval(<<'.,.,', 'parser.y', 19)
354
+ module_eval(<<'.,.,', 'parser.y', 17)
276
355
  def _reduce_9(val, _values, result)
277
- array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
356
+ @handler.start_(:array_of_tables)
278
357
  result
279
358
  end
280
359
  .,.,
281
360
 
282
- module_eval(<<'.,.,', 'parser.y', 20)
361
+ module_eval(<<'.,.,', 'parser.y', 18)
283
362
  def _reduce_10(val, _values, result)
284
- array = @handler.end_(:table); @handler.set_context(array)
363
+ @handler.start_(:table)
285
364
  result
286
365
  end
287
366
  .,.,
288
367
 
289
- # reduce 11 omitted
290
-
291
- module_eval(<<'.,.,', 'parser.y', 24)
292
- def _reduce_12(val, _values, result)
293
- array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
368
+ module_eval(<<'.,.,', 'parser.y', 21)
369
+ def _reduce_11(val, _values, result)
370
+ array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
294
371
  result
295
372
  end
296
373
  .,.,
297
374
 
298
- module_eval(<<'.,.,', 'parser.y', 25)
299
- def _reduce_13(val, _values, result)
300
- array = @handler.end_(:table); @handler.set_context(array)
375
+ module_eval(<<'.,.,', 'parser.y', 22)
376
+ def _reduce_12(val, _values, result)
377
+ array = @handler.end_(:table); @handler.set_context(array)
301
378
  result
302
379
  end
303
380
  .,.,
304
381
 
305
- # reduce 14 omitted
382
+ # reduce 13 omitted
306
383
 
307
- module_eval(<<'.,.,', 'parser.y', 29)
308
- def _reduce_15(val, _values, result)
309
- @handler.push(val[0])
384
+ module_eval(<<'.,.,', 'parser.y', 26)
385
+ def _reduce_14(val, _values, result)
386
+ array = @handler.end_(:array_of_tables); @handler.set_context(array, is_array_of_tables: true)
310
387
  result
311
388
  end
312
389
  .,.,
313
390
 
314
- module_eval(<<'.,.,', 'parser.y', 30)
315
- def _reduce_16(val, _values, result)
316
- @handler.push(val[0])
391
+ module_eval(<<'.,.,', 'parser.y', 27)
392
+ def _reduce_15(val, _values, result)
393
+ array = @handler.end_(:table); @handler.set_context(array)
317
394
  result
318
395
  end
319
396
  .,.,
320
397
 
398
+ # reduce 16 omitted
399
+
321
400
  module_eval(<<'.,.,', 'parser.y', 31)
322
401
  def _reduce_17(val, _values, result)
323
- @handler.push(val[0])
402
+ @handler.push(val[2])
324
403
  result
325
404
  end
326
405
  .,.,
327
406
 
328
407
  module_eval(<<'.,.,', 'parser.y', 32)
329
408
  def _reduce_18(val, _values, result)
330
- @handler.push(val[0])
409
+ val[2].split('.').each { |k| @handler.push(k) }
331
410
  result
332
411
  end
333
412
  .,.,
334
413
 
335
- module_eval(<<'.,.,', 'parser.y', 33)
414
+ module_eval(<<'.,.,', 'parser.y', 34)
336
415
  def _reduce_19(val, _values, result)
337
- @handler.push(val[0])
416
+ keys = val[0].split('.')
417
+ @handler.start_(:table)
418
+ keys.each { |key| @handler.push(key) }
419
+
338
420
  result
339
421
  end
340
422
  .,.,
341
423
 
342
- module_eval(<<'.,.,', 'parser.y', 34)
424
+ module_eval(<<'.,.,', 'parser.y', 38)
343
425
  def _reduce_20(val, _values, result)
344
- @handler.push(val[0])
426
+ @handler.push(val[0])
345
427
  result
346
428
  end
347
429
  .,.,
348
430
 
349
431
  # reduce 21 omitted
350
432
 
351
- module_eval(<<'.,.,', 'parser.y', 40)
352
- def _reduce_22(val, _values, result)
353
- @handler.start_(:inline)
433
+ # reduce 22 omitted
434
+
435
+ # reduce 23 omitted
436
+
437
+ # reduce 24 omitted
438
+
439
+ # reduce 25 omitted
440
+
441
+ # reduce 26 omitted
442
+
443
+ # reduce 27 omitted
444
+
445
+ # reduce 28 omitted
446
+
447
+ # reduce 29 omitted
448
+
449
+ # reduce 30 omitted
450
+
451
+ # reduce 31 omitted
452
+
453
+ # reduce 32 omitted
454
+
455
+ # reduce 33 omitted
456
+
457
+ module_eval(<<'.,.,', 'parser.y', 58)
458
+ def _reduce_34(val, _values, result)
459
+ @handler.start_(:inline)
354
460
  result
355
461
  end
356
462
  .,.,
357
463
 
358
- module_eval(<<'.,.,', 'parser.y', 43)
359
- def _reduce_23(val, _values, result)
360
- array = @handler.end_(:inline); @handler.push(Hash[*array])
464
+ module_eval(<<'.,.,', 'parser.y', 62)
465
+ def _reduce_35(val, _values, result)
466
+ array = @handler.end_(:inline)
467
+ array.map!.with_index{ |n,i| i.even? ? n.to_sym : n } if @handler.symbolize_keys
468
+ @handler.push(Hash[*array])
469
+
361
470
  result
362
471
  end
363
472
  .,.,
364
473
 
365
- # reduce 24 omitted
474
+ # reduce 36 omitted
475
+
476
+ # reduce 37 omitted
477
+
478
+ # reduce 38 omitted
366
479
 
367
- module_eval(<<'.,.,', 'parser.y', 48)
368
- def _reduce_25(val, _values, result)
480
+ module_eval(<<'.,.,', 'parser.y', 76)
481
+ def _reduce_39(val, _values, result)
369
482
  array = @handler.end_(:inline)
370
- array.map!.with_index{ |n,i| i.even? ? n.to_sym : n } if @handler.symbolize_keys
371
- @handler.push(Hash[*array])
372
-
483
+ array.each { |key| @handler.push(key) }
484
+ @handler.start_(:inline)
485
+ @handler.push(val[2])
486
+
373
487
  result
374
488
  end
375
489
  .,.,
376
490
 
377
- # reduce 26 omitted
378
-
379
- module_eval(<<'.,.,', 'parser.y', 55)
380
- def _reduce_27(val, _values, result)
381
- @handler.push(val[0])
491
+ module_eval(<<'.,.,', 'parser.y', 81)
492
+ def _reduce_40(val, _values, result)
493
+ @handler.push(val[0])
382
494
  result
383
495
  end
384
496
  .,.,
385
497
 
386
- # reduce 28 omitted
498
+ # reduce 41 omitted
499
+
500
+ module_eval(<<'.,.,', 'parser.y', 88)
501
+ def _reduce_42(val, _values, result)
502
+ keys = @handler.end_(:keys)
503
+ @handler.push(keys.pop)
504
+ @handler.assign(keys)
387
505
 
388
- module_eval(<<'.,.,', 'parser.y', 61)
389
- def _reduce_29(val, _values, result)
390
- @handler.assign(val[0])
391
506
  result
392
507
  end
393
508
  .,.,
394
509
 
395
- module_eval(<<'.,.,', 'parser.y', 62)
396
- def _reduce_30(val, _values, result)
397
- @handler.assign(val[0])
510
+ module_eval(<<'.,.,', 'parser.y', 93)
511
+ def _reduce_43(val, _values, result)
512
+ keys = @handler.end_(:keys)
513
+ @handler.push(keys.pop)
514
+ @handler.assign(keys)
515
+
398
516
  result
399
517
  end
400
518
  .,.,
401
519
 
402
- module_eval(<<'.,.,', 'parser.y', 63)
403
- def _reduce_31(val, _values, result)
404
- @handler.assign(val[0])
520
+ module_eval(<<'.,.,', 'parser.y', 99)
521
+ def _reduce_44(val, _values, result)
522
+ @handler.push(val[2])
405
523
  result
406
524
  end
407
525
  .,.,
408
526
 
409
- module_eval(<<'.,.,', 'parser.y', 64)
410
- def _reduce_32(val, _values, result)
411
- @handler.assign(val[0])
527
+ module_eval(<<'.,.,', 'parser.y', 100)
528
+ def _reduce_45(val, _values, result)
529
+ val[2].split('.').each { |k| @handler.push(k) }
412
530
  result
413
531
  end
414
532
  .,.,
415
533
 
416
- module_eval(<<'.,.,', 'parser.y', 65)
417
- def _reduce_33(val, _values, result)
418
- @handler.assign(val[0])
534
+ module_eval(<<'.,.,', 'parser.y', 102)
535
+ def _reduce_46(val, _values, result)
536
+ keys = val[0].split('.')
537
+ @handler.start_(:keys)
538
+ keys.each { |key| @handler.push(key) }
539
+
419
540
  result
420
541
  end
421
542
  .,.,
422
543
 
423
- module_eval(<<'.,.,', 'parser.y', 66)
424
- def _reduce_34(val, _values, result)
425
- @handler.assign(val[0])
544
+ module_eval(<<'.,.,', 'parser.y', 106)
545
+ def _reduce_47(val, _values, result)
546
+ @handler.start_(:keys); @handler.push(val[0])
426
547
  result
427
548
  end
428
549
  .,.,
429
550
 
430
- # reduce 35 omitted
551
+ # reduce 48 omitted
552
+
553
+ # reduce 49 omitted
554
+
555
+ # reduce 50 omitted
556
+
557
+ # reduce 51 omitted
558
+
559
+ # reduce 52 omitted
560
+
561
+ # reduce 53 omitted
562
+
563
+ # reduce 54 omitted
564
+
565
+ # reduce 55 omitted
566
+
567
+ # reduce 56 omitted
568
+
569
+ # reduce 57 omitted
431
570
 
432
- module_eval(<<'.,.,', 'parser.y', 72)
433
- def _reduce_36(val, _values, result)
434
- array = @handler.end_(:array); @handler.push(array)
571
+ # reduce 58 omitted
572
+
573
+ # reduce 59 omitted
574
+
575
+ module_eval(<<'.,.,', 'parser.y', 125)
576
+ def _reduce_60(val, _values, result)
577
+ array = @handler.end_(:array); @handler.push(array)
435
578
  result
436
579
  end
437
580
  .,.,
438
581
 
439
- # reduce 37 omitted
582
+ # reduce 61 omitted
440
583
 
441
- module_eval(<<'.,.,', 'parser.y', 76)
442
- def _reduce_38(val, _values, result)
443
- array = @handler.end_(:array); @handler.push(array)
584
+ # reduce 62 omitted
585
+
586
+ module_eval(<<'.,.,', 'parser.y', 130)
587
+ def _reduce_63(val, _values, result)
588
+ array = @handler.end_(:array); @handler.push(array)
444
589
  result
445
590
  end
446
591
  .,.,
447
592
 
448
- # reduce 39 omitted
593
+ # reduce 64 omitted
449
594
 
450
- module_eval(<<'.,.,', 'parser.y', 80)
451
- def _reduce_40(val, _values, result)
452
- @handler.start_(:array)
595
+ # reduce 65 omitted
596
+
597
+ # reduce 66 omitted
598
+
599
+ module_eval(<<'.,.,', 'parser.y', 136)
600
+ def _reduce_67(val, _values, result)
601
+ @handler.start_(:array)
453
602
  result
454
603
  end
455
604
  .,.,
456
605
 
457
- module_eval(<<'.,.,', 'parser.y', 83)
458
- def _reduce_41(val, _values, result)
459
- @handler.push(val[0])
606
+ module_eval(<<'.,.,', 'parser.y', 139)
607
+ def _reduce_68(val, _values, result)
608
+ @handler.push(val[0])
460
609
  result
461
610
  end
462
611
  .,.,
463
612
 
464
- # reduce 42 omitted
613
+ # reduce 69 omitted
465
614
 
466
- # reduce 43 omitted
615
+ # reduce 70 omitted
467
616
 
468
- # reduce 44 omitted
617
+ # reduce 71 omitted
469
618
 
470
- # reduce 45 omitted
619
+ # reduce 72 omitted
471
620
 
472
- # reduce 46 omitted
621
+ # reduce 73 omitted
473
622
 
474
- module_eval(<<'.,.,', 'parser.y', 92)
475
- def _reduce_47(val, _values, result)
476
- result = val[0].to_f
623
+ module_eval(<<'.,.,', 'parser.y', 148)
624
+ def _reduce_74(val, _values, result)
625
+ result = val[0].to_f
477
626
  result
478
627
  end
479
628
  .,.,
480
629
 
481
- module_eval(<<'.,.,', 'parser.y', 93)
482
- def _reduce_48(val, _values, result)
483
- result = val[0].to_i
630
+ module_eval(<<'.,.,', 'parser.y', 149)
631
+ def _reduce_75(val, _values, result)
632
+ result = (val[0][0] == '-' ? -1 : 1) * Float::INFINITY
484
633
  result
485
634
  end
486
635
  .,.,
487
636
 
488
- module_eval(<<'.,.,', 'parser.y', 94)
489
- def _reduce_49(val, _values, result)
490
- result = true
637
+ module_eval(<<'.,.,', 'parser.y', 150)
638
+ def _reduce_76(val, _values, result)
639
+ result = Float::NAN
491
640
  result
492
641
  end
493
642
  .,.,
494
643
 
495
- module_eval(<<'.,.,', 'parser.y', 95)
496
- def _reduce_50(val, _values, result)
497
- result = false
644
+ module_eval(<<'.,.,', 'parser.y', 151)
645
+ def _reduce_77(val, _values, result)
646
+ result = val[0].to_i
498
647
  result
499
648
  end
500
649
  .,.,
501
650
 
502
- module_eval(<<'.,.,', 'parser.y', 96)
503
- def _reduce_51(val, _values, result)
651
+ module_eval(<<'.,.,', 'parser.y', 152)
652
+ def _reduce_78(val, _values, result)
653
+ result = val[0].to_i(16)
654
+ result
655
+ end
656
+ .,.,
657
+
658
+ module_eval(<<'.,.,', 'parser.y', 153)
659
+ def _reduce_79(val, _values, result)
660
+ result = val[0].to_i(8)
661
+ result
662
+ end
663
+ .,.,
664
+
665
+ module_eval(<<'.,.,', 'parser.y', 154)
666
+ def _reduce_80(val, _values, result)
667
+ result = val[0].to_i(2)
668
+ result
669
+ end
670
+ .,.,
671
+
672
+ module_eval(<<'.,.,', 'parser.y', 155)
673
+ def _reduce_81(val, _values, result)
674
+ result = true
675
+ result
676
+ end
677
+ .,.,
678
+
679
+ module_eval(<<'.,.,', 'parser.y', 156)
680
+ def _reduce_82(val, _values, result)
681
+ result = false
682
+ result
683
+ end
684
+ .,.,
685
+
686
+ module_eval(<<'.,.,', 'parser.y', 157)
687
+ def _reduce_83(val, _values, result)
504
688
  result = Time.new(*val[0])
505
689
  result
506
690
  end
507
691
  .,.,
508
692
 
509
- module_eval(<<'.,.,', 'parser.y', 99)
510
- def _reduce_52(val, _values, result)
511
- result = StringUtils.replace_escaped_chars(StringUtils.multiline_replacements(val[0]))
693
+ module_eval(<<'.,.,', 'parser.y', 158)
694
+ def _reduce_84(val, _values, result)
695
+ result = LocalDateTime.new(*val[0])
512
696
  result
513
697
  end
514
698
  .,.,
515
699
 
516
- module_eval(<<'.,.,', 'parser.y', 100)
517
- def _reduce_53(val, _values, result)
518
- result = StringUtils.replace_escaped_chars(val[0])
700
+ module_eval(<<'.,.,', 'parser.y', 159)
701
+ def _reduce_85(val, _values, result)
702
+ result = LocalDate.new(*val[0])
519
703
  result
520
704
  end
521
705
  .,.,
522
706
 
523
- module_eval(<<'.,.,', 'parser.y', 101)
524
- def _reduce_54(val, _values, result)
525
- result = StringUtils.strip_spaces(val[0])
707
+ module_eval(<<'.,.,', 'parser.y', 160)
708
+ def _reduce_86(val, _values, result)
709
+ result = LocalTime.new(*val[0])
526
710
  result
527
711
  end
528
712
  .,.,
529
713
 
530
- module_eval(<<'.,.,', 'parser.y', 102)
531
- def _reduce_55(val, _values, result)
532
- result = val[0]
714
+ module_eval(<<'.,.,', 'parser.y', 163)
715
+ def _reduce_87(val, _values, result)
716
+ result = StringUtils.replace_escaped_chars(StringUtils.multiline_replacements(val[0]))
717
+ result
718
+ end
719
+ .,.,
720
+
721
+ module_eval(<<'.,.,', 'parser.y', 164)
722
+ def _reduce_88(val, _values, result)
723
+ result = StringUtils.replace_escaped_chars(val[0])
724
+ result
725
+ end
726
+ .,.,
727
+
728
+ module_eval(<<'.,.,', 'parser.y', 165)
729
+ def _reduce_89(val, _values, result)
730
+ result = StringUtils.strip_spaces(val[0])
731
+ result
732
+ end
733
+ .,.,
734
+
735
+ module_eval(<<'.,.,', 'parser.y', 166)
736
+ def _reduce_90(val, _values, result)
737
+ result = val[0]
533
738
  result
534
739
  end
535
740
  .,.,
@@ -539,4 +744,4 @@ def _reduce_none(val, _values, result)
539
744
  end
540
745
 
541
746
  end # class GeneratedParser
542
- end # module Tomlrb
747
+ end # module Tomlrb