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 +5 -5
- data/lib/tomlrb.rb +5 -2
- data/lib/tomlrb/generated_parser.rb +455 -250
- data/lib/tomlrb/handler.rb +156 -3
- data/lib/tomlrb/local_date.rb +33 -0
- data/lib/tomlrb/local_date_time.rb +40 -0
- data/lib/tomlrb/local_time.rb +38 -0
- data/lib/tomlrb/parser.rb +1 -1
- data/lib/tomlrb/parser.y +85 -21
- data/lib/tomlrb/scanner.rb +54 -16
- data/lib/tomlrb/string_utils.rb +7 -1
- data/lib/tomlrb/version.rb +1 -1
- metadata +7 -15
- data/.gitignore +0 -9
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -8
- data/Gemfile +0 -13
- data/README.md +0 -80
- data/Rakefile +0 -14
- data/benchmarks/bench.rb +0 -22
- data/bin/console +0 -10
- data/bin/setup +0 -6
- data/tomlrb.gemspec +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 14e652fc5bed850a8eeca40457bf6e41239de4bb2680e82e02c962bfd69ec7ba
|
4
|
+
data.tar.gz: ffce44339d664c830873b002d0f236ee271e297b7a6f41dcefdce292ad872f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d536f0eac4b0a13628368bf6b76bdb8a8e701807e9f4712b2dcb6805298a63c77d7774d1e9af5933404fbb5858b936bd4ed99dc55b0b0e0f4b519142f6dd5b0d
|
7
|
+
data.tar.gz: 97284454aa9099242a5050364b8fd8b95bdcde050ffcca5653dc02873e182066b6bfa6bfad643d6ca751365ebb788f600be42ef6f11736689aab3a4282c1ac24
|
data/lib/tomlrb.rb
CHANGED
@@ -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
|
-
# from Racc
|
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,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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,
|
32
|
-
1, 1, 1,
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
nil,
|
46
|
-
|
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,
|
50
|
-
nil,
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
-
|
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, -
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
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
|
-
|
70
|
-
|
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,
|
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,
|
103
|
+
nil, 101 ]
|
76
104
|
|
77
105
|
racc_goto_check = [
|
78
|
-
|
79
|
-
|
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,
|
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,
|
114
|
+
nil, 13 ]
|
85
115
|
|
86
116
|
racc_goto_pointer = [
|
87
|
-
nil,
|
88
|
-
|
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,
|
93
|
-
|
94
|
-
|
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,
|
99
|
-
2,
|
100
|
-
|
101
|
-
1,
|
102
|
-
1,
|
103
|
-
|
104
|
-
|
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
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
-
|
138
|
-
|
139
|
-
1,
|
140
|
-
1,
|
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
|
-
|
144
|
-
1,
|
145
|
-
1,
|
146
|
-
1,
|
147
|
-
1,
|
148
|
-
1,
|
149
|
-
1,
|
150
|
-
1,
|
151
|
-
1,
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
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
|
-
:
|
168
|
-
:
|
169
|
-
:
|
170
|
-
:
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
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
|
-
|
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
|
-
|
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',
|
354
|
+
module_eval(<<'.,.,', 'parser.y', 17)
|
276
355
|
def _reduce_9(val, _values, result)
|
277
|
-
|
356
|
+
@handler.start_(:array_of_tables)
|
278
357
|
result
|
279
358
|
end
|
280
359
|
.,.,
|
281
360
|
|
282
|
-
module_eval(<<'.,.,', 'parser.y',
|
361
|
+
module_eval(<<'.,.,', 'parser.y', 18)
|
283
362
|
def _reduce_10(val, _values, result)
|
284
|
-
|
363
|
+
@handler.start_(:table)
|
285
364
|
result
|
286
365
|
end
|
287
366
|
.,.,
|
288
367
|
|
289
|
-
|
290
|
-
|
291
|
-
|
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',
|
299
|
-
def
|
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
|
382
|
+
# reduce 13 omitted
|
306
383
|
|
307
|
-
module_eval(<<'.,.,', 'parser.y',
|
308
|
-
def
|
309
|
-
@handler.
|
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',
|
315
|
-
def
|
316
|
-
@handler.
|
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[
|
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(
|
409
|
+
val[2].split('.').each { |k| @handler.push(k) }
|
331
410
|
result
|
332
411
|
end
|
333
412
|
.,.,
|
334
413
|
|
335
|
-
module_eval(<<'.,.,', 'parser.y',
|
414
|
+
module_eval(<<'.,.,', 'parser.y', 34)
|
336
415
|
def _reduce_19(val, _values, result)
|
337
|
-
|
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',
|
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
|
-
|
352
|
-
|
353
|
-
|
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',
|
359
|
-
def
|
360
|
-
|
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
|
474
|
+
# reduce 36 omitted
|
475
|
+
|
476
|
+
# reduce 37 omitted
|
477
|
+
|
478
|
+
# reduce 38 omitted
|
366
479
|
|
367
|
-
module_eval(<<'.,.,', 'parser.y',
|
368
|
-
def
|
480
|
+
module_eval(<<'.,.,', 'parser.y', 76)
|
481
|
+
def _reduce_39(val, _values, result)
|
369
482
|
array = @handler.end_(:inline)
|
370
|
-
array.
|
371
|
-
@handler.
|
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
|
-
|
378
|
-
|
379
|
-
|
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
|
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',
|
396
|
-
def
|
397
|
-
|
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',
|
403
|
-
def
|
404
|
-
@handler.
|
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',
|
410
|
-
def
|
411
|
-
@handler.
|
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',
|
417
|
-
def
|
418
|
-
|
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',
|
424
|
-
def
|
425
|
-
@handler.
|
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
|
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
|
-
|
433
|
-
|
434
|
-
|
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
|
582
|
+
# reduce 61 omitted
|
440
583
|
|
441
|
-
|
442
|
-
|
443
|
-
|
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
|
593
|
+
# reduce 64 omitted
|
449
594
|
|
450
|
-
|
451
|
-
|
452
|
-
|
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',
|
458
|
-
def
|
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
|
613
|
+
# reduce 69 omitted
|
465
614
|
|
466
|
-
# reduce
|
615
|
+
# reduce 70 omitted
|
467
616
|
|
468
|
-
# reduce
|
617
|
+
# reduce 71 omitted
|
469
618
|
|
470
|
-
# reduce
|
619
|
+
# reduce 72 omitted
|
471
620
|
|
472
|
-
# reduce
|
621
|
+
# reduce 73 omitted
|
473
622
|
|
474
|
-
module_eval(<<'.,.,', 'parser.y',
|
475
|
-
def
|
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',
|
482
|
-
def
|
483
|
-
result = val[0]
|
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',
|
489
|
-
def
|
490
|
-
result =
|
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',
|
496
|
-
def
|
497
|
-
result =
|
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',
|
503
|
-
def
|
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',
|
510
|
-
def
|
511
|
-
result =
|
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',
|
517
|
-
def
|
518
|
-
result =
|
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',
|
524
|
-
def
|
525
|
-
result =
|
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',
|
531
|
-
def
|
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
|
-
|
747
|
+
end # module Tomlrb
|