edn-abnf 0.3.5 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/edn-abnf +12 -1
- data/edn-abnf.gemspec +1 -1
- data/lib/parser/edngrammar.rb +630 -372
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4a0b1911b37bbabef257681aaeec94716aaac6b34f2719b3a33672bbeaef86
|
4
|
+
data.tar.gz: 6fd059837eac37459f8e18f5bfc921ef6ff10fc68a9dddc0e2d481b2a447b11b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9c24d903f4b5e1bb7dfdef58f63c526d3f1c1ce445d27401e0db6b34829141b79b418f8ef769237b454d7e72d01dd0f931f895d229fdb59e5a9d8d808029200
|
7
|
+
data.tar.gz: 0cae09501f16449694856f6f152611b44c6d7b6153cb17a7f807f68f46b95658a0372031c10bb80aff0e9878bfe1d9d18bebec26873f24716635051e9c61ccb0
|
data/bin/edn-abnf
CHANGED
@@ -4,6 +4,7 @@ require 'pp'
|
|
4
4
|
require 'yaml'
|
5
5
|
require 'treetop'
|
6
6
|
require 'json'
|
7
|
+
require 'cbor-pretty'
|
7
8
|
|
8
9
|
require_relative '../lib/edn-abnf.rb'
|
9
10
|
|
@@ -46,7 +47,9 @@ begin
|
|
46
47
|
opts.on("-eEDN", "--e=EDN", "supply EDN on command line") do |v|
|
47
48
|
$options.edn = v
|
48
49
|
end
|
49
|
-
opts.on("-tFMT", "--to=FMT",
|
50
|
+
opts.on("-tFMT", "--to=FMT",
|
51
|
+
[:basic, :neat, :json, :yaml, :edn, :diag, :pretty],
|
52
|
+
"Target format (default: diag)") do |v|
|
50
53
|
$options.target = v
|
51
54
|
end
|
52
55
|
end
|
@@ -137,6 +140,14 @@ when :yaml
|
|
137
140
|
puts result.to_yaml
|
138
141
|
when :edn, :diag, nil
|
139
142
|
puts result.cbor_diagnostic
|
143
|
+
when :pretty
|
144
|
+
# XXX can't do Box yet
|
145
|
+
enc = if CBOR::Sequence === result
|
146
|
+
result.to_cborseq
|
147
|
+
else
|
148
|
+
result.to_cbor
|
149
|
+
end
|
150
|
+
puts CBOR::pretty_seq(enc)
|
140
151
|
else
|
141
152
|
warn ["Unknown target format: ", $options.target].inspect
|
142
153
|
end
|
data/edn-abnf.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "edn-abnf"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.4.1"
|
4
4
|
s.summary = "CBOR Extended Diagnostic Notation (EDN) implemented in ABNF"
|
5
5
|
s.description = %q{edn-abnf implements converters and miscellaneous tools for CBOR EDN's ABNF}
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/parser/edngrammar.rb
CHANGED
@@ -10,17 +10,13 @@ module EDNGRAMMAR
|
|
10
10
|
end
|
11
11
|
|
12
12
|
module Seq0
|
13
|
-
def
|
13
|
+
def MSC
|
14
14
|
elements[0]
|
15
15
|
end
|
16
16
|
|
17
17
|
def item
|
18
18
|
elements[1]
|
19
19
|
end
|
20
|
-
|
21
|
-
def S
|
22
|
-
elements[2]
|
23
|
-
end
|
24
20
|
end
|
25
21
|
|
26
22
|
module Seq1
|
@@ -28,12 +24,8 @@ module EDNGRAMMAR
|
|
28
24
|
elements[0]
|
29
25
|
end
|
30
26
|
|
31
|
-
def
|
32
|
-
elements[
|
33
|
-
end
|
34
|
-
|
35
|
-
def OC
|
36
|
-
elements[3]
|
27
|
+
def SOC
|
28
|
+
elements[2]
|
37
29
|
end
|
38
30
|
end
|
39
31
|
|
@@ -47,7 +39,7 @@ module EDNGRAMMAR
|
|
47
39
|
module Seq3
|
48
40
|
def ast
|
49
41
|
r = if e = elements[1].elements
|
50
|
-
[e[0].ast] + e[
|
42
|
+
[e[0].ast] + e[1].elements.map {|x| x.item.ast }
|
51
43
|
else
|
52
44
|
[]
|
53
45
|
end
|
@@ -78,42 +70,34 @@ module EDNGRAMMAR
|
|
78
70
|
r4 = _nt_item
|
79
71
|
s3 << r4
|
80
72
|
if r4
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
r8 =
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
end
|
97
|
-
if s7.last
|
98
|
-
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
99
|
-
r7.extend(Seq0)
|
100
|
-
else
|
101
|
-
@index = i7
|
102
|
-
r7 = nil
|
103
|
-
end
|
104
|
-
if r7
|
105
|
-
s6 << r7
|
106
|
-
else
|
107
|
-
break
|
108
|
-
end
|
73
|
+
s5, i5 = [], index
|
74
|
+
loop do
|
75
|
+
i6, s6 = index, []
|
76
|
+
r7 = _nt_MSC
|
77
|
+
s6 << r7
|
78
|
+
if r7
|
79
|
+
r8 = _nt_item
|
80
|
+
s6 << r8
|
81
|
+
end
|
82
|
+
if s6.last
|
83
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
84
|
+
r6.extend(Seq0)
|
85
|
+
else
|
86
|
+
@index = i6
|
87
|
+
r6 = nil
|
109
88
|
end
|
110
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
111
|
-
s3 << r6
|
112
89
|
if r6
|
113
|
-
|
114
|
-
|
90
|
+
s5 << r6
|
91
|
+
else
|
92
|
+
break
|
115
93
|
end
|
116
94
|
end
|
95
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
96
|
+
s3 << r5
|
97
|
+
if r5
|
98
|
+
r9 = _nt_SOC
|
99
|
+
s3 << r9
|
100
|
+
end
|
117
101
|
end
|
118
102
|
if s3.last
|
119
103
|
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
@@ -1983,21 +1967,17 @@ module EDNGRAMMAR
|
|
1983
1967
|
end
|
1984
1968
|
|
1985
1969
|
module Array0
|
1986
|
-
def
|
1970
|
+
def MSC
|
1987
1971
|
elements[0]
|
1988
1972
|
end
|
1989
1973
|
|
1990
1974
|
def item
|
1991
1975
|
elements[1]
|
1992
1976
|
end
|
1993
|
-
|
1994
|
-
def S
|
1995
|
-
elements[2]
|
1996
|
-
end
|
1997
1977
|
end
|
1998
1978
|
|
1999
1979
|
module Array1
|
2000
|
-
def
|
1980
|
+
def specms
|
2001
1981
|
elements[0]
|
2002
1982
|
end
|
2003
1983
|
|
@@ -2005,36 +1985,47 @@ module EDNGRAMMAR
|
|
2005
1985
|
elements[1]
|
2006
1986
|
end
|
2007
1987
|
|
2008
|
-
def
|
2009
|
-
elements[
|
1988
|
+
def item
|
1989
|
+
elements[2]
|
1990
|
+
end
|
1991
|
+
|
1992
|
+
def SOC
|
1993
|
+
elements[4]
|
2010
1994
|
end
|
2011
1995
|
end
|
2012
1996
|
|
2013
1997
|
module Array2
|
2014
1998
|
def spec
|
2015
|
-
elements[
|
1999
|
+
elements[0]
|
2016
2000
|
end
|
2017
2001
|
|
2018
2002
|
def S
|
2019
|
-
elements[
|
2003
|
+
elements[1]
|
2020
2004
|
end
|
2021
|
-
|
2022
2005
|
end
|
2023
2006
|
|
2024
2007
|
module Array3
|
2008
|
+
end
|
2009
|
+
|
2010
|
+
module Array4
|
2025
2011
|
def ast
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2012
|
+
e = elements[1] # alternative
|
2013
|
+
ei = nil
|
2014
|
+
if e.respond_to?(:specms)
|
2015
|
+
if e.specms && e.specms.elements
|
2016
|
+
ei = e.specms.elements[1].text_value
|
2017
|
+
end
|
2018
|
+
r = [e.item.ast] + e.elements[3].elements.map {|x| x.item.ast}
|
2019
|
+
else
|
2020
|
+
if e.spec && e.spec.elements
|
2021
|
+
ei = e.spec.elements[1].text_value
|
2022
|
+
end
|
2023
|
+
r = []
|
2024
|
+
end
|
2025
|
+
if ei == ""
|
2026
|
+
r.cbor_stream!
|
2027
|
+
elsif ei
|
2028
|
+
warn "*** ignoring unimplemented encoding indicator #{ei.inspect} after ["
|
2038
2029
|
end
|
2039
2030
|
r
|
2040
2031
|
end
|
@@ -2061,83 +2052,97 @@ module EDNGRAMMAR
|
|
2061
2052
|
end
|
2062
2053
|
s0 << r1
|
2063
2054
|
if r1
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2055
|
+
i2 = index
|
2056
|
+
i3, s3 = index, []
|
2057
|
+
r4 = _nt_specms
|
2058
|
+
s3 << r4
|
2059
|
+
if r4
|
2060
|
+
r5 = _nt_S
|
2061
|
+
s3 << r5
|
2062
|
+
if r5
|
2071
2063
|
r6 = _nt_item
|
2072
|
-
|
2064
|
+
s3 << r6
|
2073
2065
|
if r6
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
r10 =
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
end
|
2090
|
-
if s9.last
|
2091
|
-
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
2092
|
-
r9.extend(Array0)
|
2093
|
-
else
|
2094
|
-
@index = i9
|
2095
|
-
r9 = nil
|
2096
|
-
end
|
2097
|
-
if r9
|
2098
|
-
s8 << r9
|
2099
|
-
else
|
2100
|
-
break
|
2101
|
-
end
|
2066
|
+
s7, i7 = [], index
|
2067
|
+
loop do
|
2068
|
+
i8, s8 = index, []
|
2069
|
+
r9 = _nt_MSC
|
2070
|
+
s8 << r9
|
2071
|
+
if r9
|
2072
|
+
r10 = _nt_item
|
2073
|
+
s8 << r10
|
2074
|
+
end
|
2075
|
+
if s8.last
|
2076
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
2077
|
+
r8.extend(Array0)
|
2078
|
+
else
|
2079
|
+
@index = i8
|
2080
|
+
r8 = nil
|
2102
2081
|
end
|
2103
|
-
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
2104
|
-
s5 << r8
|
2105
2082
|
if r8
|
2106
|
-
|
2107
|
-
|
2083
|
+
s7 << r8
|
2084
|
+
else
|
2085
|
+
break
|
2108
2086
|
end
|
2109
2087
|
end
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
@index = i5
|
2116
|
-
r5 = nil
|
2117
|
-
end
|
2118
|
-
if r5
|
2119
|
-
r4 = r5
|
2120
|
-
else
|
2121
|
-
r4 = instantiate_node(SyntaxNode,input, index...index)
|
2122
|
-
end
|
2123
|
-
s0 << r4
|
2124
|
-
if r4
|
2125
|
-
if (match_len = has_terminal?("]", false, index))
|
2126
|
-
r14 = true
|
2127
|
-
@index += match_len
|
2128
|
-
else
|
2129
|
-
terminal_parse_failure('"]"')
|
2130
|
-
r14 = nil
|
2088
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
2089
|
+
s3 << r7
|
2090
|
+
if r7
|
2091
|
+
r11 = _nt_SOC
|
2092
|
+
s3 << r11
|
2131
2093
|
end
|
2132
|
-
s0 << r14
|
2133
2094
|
end
|
2134
2095
|
end
|
2135
2096
|
end
|
2097
|
+
if s3.last
|
2098
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2099
|
+
r3.extend(Array1)
|
2100
|
+
else
|
2101
|
+
@index = i3
|
2102
|
+
r3 = nil
|
2103
|
+
end
|
2104
|
+
if r3
|
2105
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
2106
|
+
r2 = r3
|
2107
|
+
else
|
2108
|
+
i12, s12 = index, []
|
2109
|
+
r13 = _nt_spec
|
2110
|
+
s12 << r13
|
2111
|
+
if r13
|
2112
|
+
r14 = _nt_S
|
2113
|
+
s12 << r14
|
2114
|
+
end
|
2115
|
+
if s12.last
|
2116
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
2117
|
+
r12.extend(Array2)
|
2118
|
+
else
|
2119
|
+
@index = i12
|
2120
|
+
r12 = nil
|
2121
|
+
end
|
2122
|
+
if r12
|
2123
|
+
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
2124
|
+
r2 = r12
|
2125
|
+
else
|
2126
|
+
@index = i2
|
2127
|
+
r2 = nil
|
2128
|
+
end
|
2129
|
+
end
|
2130
|
+
s0 << r2
|
2131
|
+
if r2
|
2132
|
+
if (match_len = has_terminal?("]", false, index))
|
2133
|
+
r15 = true
|
2134
|
+
@index += match_len
|
2135
|
+
else
|
2136
|
+
terminal_parse_failure('"]"')
|
2137
|
+
r15 = nil
|
2138
|
+
end
|
2139
|
+
s0 << r15
|
2140
|
+
end
|
2136
2141
|
end
|
2137
2142
|
if s0.last
|
2138
2143
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2139
|
-
r0.extend(Array2)
|
2140
2144
|
r0.extend(Array3)
|
2145
|
+
r0.extend(Array4)
|
2141
2146
|
else
|
2142
2147
|
@index = i0
|
2143
2148
|
r0 = nil
|
@@ -2149,21 +2154,17 @@ module EDNGRAMMAR
|
|
2149
2154
|
end
|
2150
2155
|
|
2151
2156
|
module Map0
|
2152
|
-
def
|
2157
|
+
def MSC
|
2153
2158
|
elements[0]
|
2154
2159
|
end
|
2155
2160
|
|
2156
|
-
def
|
2161
|
+
def keyp
|
2157
2162
|
elements[1]
|
2158
2163
|
end
|
2159
|
-
|
2160
|
-
def S
|
2161
|
-
elements[2]
|
2162
|
-
end
|
2163
2164
|
end
|
2164
2165
|
|
2165
2166
|
module Map1
|
2166
|
-
def
|
2167
|
+
def specms
|
2167
2168
|
elements[0]
|
2168
2169
|
end
|
2169
2170
|
|
@@ -2171,35 +2172,47 @@ module EDNGRAMMAR
|
|
2171
2172
|
elements[1]
|
2172
2173
|
end
|
2173
2174
|
|
2174
|
-
def
|
2175
|
-
elements[
|
2175
|
+
def keyp
|
2176
|
+
elements[2]
|
2177
|
+
end
|
2178
|
+
|
2179
|
+
def SOC
|
2180
|
+
elements[4]
|
2176
2181
|
end
|
2177
2182
|
end
|
2178
2183
|
|
2179
2184
|
module Map2
|
2180
2185
|
def spec
|
2181
|
-
elements[
|
2186
|
+
elements[0]
|
2182
2187
|
end
|
2183
2188
|
|
2184
2189
|
def S
|
2185
|
-
elements[
|
2190
|
+
elements[1]
|
2186
2191
|
end
|
2187
|
-
|
2188
2192
|
end
|
2189
2193
|
|
2190
2194
|
module Map3
|
2195
|
+
end
|
2196
|
+
|
2197
|
+
module Map4
|
2191
2198
|
def ast
|
2192
|
-
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2199
|
+
e = elements[1] # alternative
|
2200
|
+
ei = nil
|
2201
|
+
if e.respond_to?(:specms)
|
2202
|
+
if e.specms && e.specms.elements
|
2203
|
+
ei = e.specms.elements[1].text_value
|
2204
|
+
end
|
2205
|
+
r = Hash[ [e.keyp.ast] + e.elements[3].elements.map {|x| x.keyp.ast } ]
|
2206
|
+
else
|
2207
|
+
if e.spec && e.spec.elements
|
2208
|
+
ei = e.spec.elements[1].text_value
|
2209
|
+
end
|
2210
|
+
r = {}
|
2211
|
+
end
|
2212
|
+
if ei == ""
|
2213
|
+
r.cbor_stream!
|
2214
|
+
elsif ei
|
2215
|
+
warn "*** ignoring unimplemented encoding indicator #{ei.inspect} after ["
|
2203
2216
|
end
|
2204
2217
|
r
|
2205
2218
|
end
|
@@ -2226,83 +2239,97 @@ module EDNGRAMMAR
|
|
2226
2239
|
end
|
2227
2240
|
s0 << r1
|
2228
2241
|
if r1
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2242
|
+
i2 = index
|
2243
|
+
i3, s3 = index, []
|
2244
|
+
r4 = _nt_specms
|
2245
|
+
s3 << r4
|
2246
|
+
if r4
|
2247
|
+
r5 = _nt_S
|
2248
|
+
s3 << r5
|
2249
|
+
if r5
|
2250
|
+
r6 = _nt_keyp
|
2251
|
+
s3 << r6
|
2238
2252
|
if r6
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
r10 =
|
2246
|
-
|
2247
|
-
|
2248
|
-
|
2249
|
-
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
|
2254
|
-
end
|
2255
|
-
if s9.last
|
2256
|
-
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
2257
|
-
r9.extend(Map0)
|
2258
|
-
else
|
2259
|
-
@index = i9
|
2260
|
-
r9 = nil
|
2261
|
-
end
|
2262
|
-
if r9
|
2263
|
-
s8 << r9
|
2264
|
-
else
|
2265
|
-
break
|
2266
|
-
end
|
2253
|
+
s7, i7 = [], index
|
2254
|
+
loop do
|
2255
|
+
i8, s8 = index, []
|
2256
|
+
r9 = _nt_MSC
|
2257
|
+
s8 << r9
|
2258
|
+
if r9
|
2259
|
+
r10 = _nt_keyp
|
2260
|
+
s8 << r10
|
2261
|
+
end
|
2262
|
+
if s8.last
|
2263
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
2264
|
+
r8.extend(Map0)
|
2265
|
+
else
|
2266
|
+
@index = i8
|
2267
|
+
r8 = nil
|
2267
2268
|
end
|
2268
|
-
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
2269
|
-
s5 << r8
|
2270
2269
|
if r8
|
2271
|
-
|
2272
|
-
|
2270
|
+
s7 << r8
|
2271
|
+
else
|
2272
|
+
break
|
2273
2273
|
end
|
2274
2274
|
end
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
@index = i5
|
2281
|
-
r5 = nil
|
2282
|
-
end
|
2283
|
-
if r5
|
2284
|
-
r4 = r5
|
2285
|
-
else
|
2286
|
-
r4 = instantiate_node(SyntaxNode,input, index...index)
|
2287
|
-
end
|
2288
|
-
s0 << r4
|
2289
|
-
if r4
|
2290
|
-
if (match_len = has_terminal?("}", false, index))
|
2291
|
-
r14 = true
|
2292
|
-
@index += match_len
|
2293
|
-
else
|
2294
|
-
terminal_parse_failure('"}"')
|
2295
|
-
r14 = nil
|
2275
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
2276
|
+
s3 << r7
|
2277
|
+
if r7
|
2278
|
+
r11 = _nt_SOC
|
2279
|
+
s3 << r11
|
2296
2280
|
end
|
2297
|
-
s0 << r14
|
2298
2281
|
end
|
2299
2282
|
end
|
2300
2283
|
end
|
2284
|
+
if s3.last
|
2285
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2286
|
+
r3.extend(Map1)
|
2287
|
+
else
|
2288
|
+
@index = i3
|
2289
|
+
r3 = nil
|
2290
|
+
end
|
2291
|
+
if r3
|
2292
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
2293
|
+
r2 = r3
|
2294
|
+
else
|
2295
|
+
i12, s12 = index, []
|
2296
|
+
r13 = _nt_spec
|
2297
|
+
s12 << r13
|
2298
|
+
if r13
|
2299
|
+
r14 = _nt_S
|
2300
|
+
s12 << r14
|
2301
|
+
end
|
2302
|
+
if s12.last
|
2303
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
2304
|
+
r12.extend(Map2)
|
2305
|
+
else
|
2306
|
+
@index = i12
|
2307
|
+
r12 = nil
|
2308
|
+
end
|
2309
|
+
if r12
|
2310
|
+
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
2311
|
+
r2 = r12
|
2312
|
+
else
|
2313
|
+
@index = i2
|
2314
|
+
r2 = nil
|
2315
|
+
end
|
2316
|
+
end
|
2317
|
+
s0 << r2
|
2318
|
+
if r2
|
2319
|
+
if (match_len = has_terminal?("}", false, index))
|
2320
|
+
r15 = true
|
2321
|
+
@index += match_len
|
2322
|
+
else
|
2323
|
+
terminal_parse_failure('"}"')
|
2324
|
+
r15 = nil
|
2325
|
+
end
|
2326
|
+
s0 << r15
|
2327
|
+
end
|
2301
2328
|
end
|
2302
2329
|
if s0.last
|
2303
2330
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2304
|
-
r0.extend(Map2)
|
2305
2331
|
r0.extend(Map3)
|
2332
|
+
r0.extend(Map4)
|
2306
2333
|
else
|
2307
2334
|
@index = i0
|
2308
2335
|
r0 = nil
|
@@ -2313,7 +2340,7 @@ module EDNGRAMMAR
|
|
2313
2340
|
r0
|
2314
2341
|
end
|
2315
2342
|
|
2316
|
-
module
|
2343
|
+
module Keyp0
|
2317
2344
|
def item1
|
2318
2345
|
elements[0]
|
2319
2346
|
end
|
@@ -2331,18 +2358,18 @@ module EDNGRAMMAR
|
|
2331
2358
|
end
|
2332
2359
|
end
|
2333
2360
|
|
2334
|
-
module
|
2361
|
+
module Keyp1
|
2335
2362
|
def ast
|
2336
2363
|
[elements[0].ast, elements[4].ast]
|
2337
2364
|
end
|
2338
2365
|
end
|
2339
2366
|
|
2340
|
-
def
|
2367
|
+
def _nt_keyp
|
2341
2368
|
start_index = index
|
2342
|
-
if node_cache[:
|
2343
|
-
cached = node_cache[:
|
2369
|
+
if node_cache[:keyp].has_key?(index)
|
2370
|
+
cached = node_cache[:keyp][index]
|
2344
2371
|
if cached
|
2345
|
-
node_cache[:
|
2372
|
+
node_cache[:keyp][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2346
2373
|
@index = cached.interval.end
|
2347
2374
|
end
|
2348
2375
|
return cached
|
@@ -2375,14 +2402,14 @@ module EDNGRAMMAR
|
|
2375
2402
|
end
|
2376
2403
|
if s0.last
|
2377
2404
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2378
|
-
r0.extend(
|
2379
|
-
r0.extend(
|
2405
|
+
r0.extend(Keyp0)
|
2406
|
+
r0.extend(Keyp1)
|
2380
2407
|
else
|
2381
2408
|
@index = i0
|
2382
2409
|
r0 = nil
|
2383
2410
|
end
|
2384
2411
|
|
2385
|
-
node_cache[:
|
2412
|
+
node_cache[:keyp][start_index] = r0
|
2386
2413
|
|
2387
2414
|
r0
|
2388
2415
|
end
|
@@ -2585,91 +2612,10 @@ module EDNGRAMMAR
|
|
2585
2612
|
r0
|
2586
2613
|
end
|
2587
2614
|
|
2588
|
-
module
|
2589
|
-
|
2590
|
-
elements[0]
|
2591
|
-
end
|
2615
|
+
module Comment0
|
2616
|
+
end
|
2592
2617
|
|
2593
|
-
|
2594
|
-
|
2595
|
-
module S1
|
2596
|
-
end
|
2597
|
-
|
2598
|
-
def _nt_S
|
2599
|
-
start_index = index
|
2600
|
-
if node_cache[:S].has_key?(index)
|
2601
|
-
cached = node_cache[:S][index]
|
2602
|
-
if cached
|
2603
|
-
node_cache[:S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2604
|
-
@index = cached.interval.end
|
2605
|
-
end
|
2606
|
-
return cached
|
2607
|
-
end
|
2608
|
-
|
2609
|
-
i0, s0 = index, []
|
2610
|
-
s1, i1 = [], index
|
2611
|
-
loop do
|
2612
|
-
r2 = _nt_blank
|
2613
|
-
if r2
|
2614
|
-
s1 << r2
|
2615
|
-
else
|
2616
|
-
break
|
2617
|
-
end
|
2618
|
-
end
|
2619
|
-
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
2620
|
-
s0 << r1
|
2621
|
-
if r1
|
2622
|
-
s3, i3 = [], index
|
2623
|
-
loop do
|
2624
|
-
i4, s4 = index, []
|
2625
|
-
r5 = _nt_comment
|
2626
|
-
s4 << r5
|
2627
|
-
if r5
|
2628
|
-
s6, i6 = [], index
|
2629
|
-
loop do
|
2630
|
-
r7 = _nt_blank
|
2631
|
-
if r7
|
2632
|
-
s6 << r7
|
2633
|
-
else
|
2634
|
-
break
|
2635
|
-
end
|
2636
|
-
end
|
2637
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
2638
|
-
s4 << r6
|
2639
|
-
end
|
2640
|
-
if s4.last
|
2641
|
-
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
2642
|
-
r4.extend(S0)
|
2643
|
-
else
|
2644
|
-
@index = i4
|
2645
|
-
r4 = nil
|
2646
|
-
end
|
2647
|
-
if r4
|
2648
|
-
s3 << r4
|
2649
|
-
else
|
2650
|
-
break
|
2651
|
-
end
|
2652
|
-
end
|
2653
|
-
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2654
|
-
s0 << r3
|
2655
|
-
end
|
2656
|
-
if s0.last
|
2657
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2658
|
-
r0.extend(S1)
|
2659
|
-
else
|
2660
|
-
@index = i0
|
2661
|
-
r0 = nil
|
2662
|
-
end
|
2663
|
-
|
2664
|
-
node_cache[:S][start_index] = r0
|
2665
|
-
|
2666
|
-
r0
|
2667
|
-
end
|
2668
|
-
|
2669
|
-
module Comment0
|
2670
|
-
end
|
2671
|
-
|
2672
|
-
module Comment1
|
2618
|
+
module Comment1
|
2673
2619
|
end
|
2674
2620
|
|
2675
2621
|
def _nt_comment
|
@@ -2780,23 +2726,169 @@ module EDNGRAMMAR
|
|
2780
2726
|
r0
|
2781
2727
|
end
|
2782
2728
|
|
2783
|
-
module
|
2729
|
+
module S0
|
2730
|
+
def comment
|
2731
|
+
elements[0]
|
2732
|
+
end
|
2733
|
+
|
2734
|
+
end
|
2735
|
+
|
2736
|
+
module S1
|
2737
|
+
end
|
2738
|
+
|
2739
|
+
def _nt_S
|
2740
|
+
start_index = index
|
2741
|
+
if node_cache[:S].has_key?(index)
|
2742
|
+
cached = node_cache[:S][index]
|
2743
|
+
if cached
|
2744
|
+
node_cache[:S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2745
|
+
@index = cached.interval.end
|
2746
|
+
end
|
2747
|
+
return cached
|
2748
|
+
end
|
2749
|
+
|
2750
|
+
i0, s0 = index, []
|
2751
|
+
s1, i1 = [], index
|
2752
|
+
loop do
|
2753
|
+
r2 = _nt_blank
|
2754
|
+
if r2
|
2755
|
+
s1 << r2
|
2756
|
+
else
|
2757
|
+
break
|
2758
|
+
end
|
2759
|
+
end
|
2760
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
2761
|
+
s0 << r1
|
2762
|
+
if r1
|
2763
|
+
s3, i3 = [], index
|
2764
|
+
loop do
|
2765
|
+
i4, s4 = index, []
|
2766
|
+
r5 = _nt_comment
|
2767
|
+
s4 << r5
|
2768
|
+
if r5
|
2769
|
+
s6, i6 = [], index
|
2770
|
+
loop do
|
2771
|
+
r7 = _nt_blank
|
2772
|
+
if r7
|
2773
|
+
s6 << r7
|
2774
|
+
else
|
2775
|
+
break
|
2776
|
+
end
|
2777
|
+
end
|
2778
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
2779
|
+
s4 << r6
|
2780
|
+
end
|
2781
|
+
if s4.last
|
2782
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
2783
|
+
r4.extend(S0)
|
2784
|
+
else
|
2785
|
+
@index = i4
|
2786
|
+
r4 = nil
|
2787
|
+
end
|
2788
|
+
if r4
|
2789
|
+
s3 << r4
|
2790
|
+
else
|
2791
|
+
break
|
2792
|
+
end
|
2793
|
+
end
|
2794
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2795
|
+
s0 << r3
|
2796
|
+
end
|
2797
|
+
if s0.last
|
2798
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2799
|
+
r0.extend(S1)
|
2800
|
+
else
|
2801
|
+
@index = i0
|
2802
|
+
r0 = nil
|
2803
|
+
end
|
2804
|
+
|
2805
|
+
node_cache[:S][start_index] = r0
|
2806
|
+
|
2807
|
+
r0
|
2808
|
+
end
|
2809
|
+
|
2810
|
+
module MS0
|
2811
|
+
def S
|
2812
|
+
elements[1]
|
2813
|
+
end
|
2814
|
+
end
|
2815
|
+
|
2816
|
+
def _nt_MS
|
2817
|
+
start_index = index
|
2818
|
+
if node_cache[:MS].has_key?(index)
|
2819
|
+
cached = node_cache[:MS][index]
|
2820
|
+
if cached
|
2821
|
+
node_cache[:MS][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2822
|
+
@index = cached.interval.end
|
2823
|
+
end
|
2824
|
+
return cached
|
2825
|
+
end
|
2826
|
+
|
2827
|
+
i0, s0 = index, []
|
2828
|
+
i1 = index
|
2829
|
+
r2 = _nt_blank
|
2830
|
+
if r2
|
2831
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
2832
|
+
r1 = r2
|
2833
|
+
else
|
2834
|
+
r3 = _nt_comment
|
2835
|
+
if r3
|
2836
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
2837
|
+
r1 = r3
|
2838
|
+
else
|
2839
|
+
@index = i1
|
2840
|
+
r1 = nil
|
2841
|
+
end
|
2842
|
+
end
|
2843
|
+
s0 << r1
|
2844
|
+
if r1
|
2845
|
+
r4 = _nt_S
|
2846
|
+
s0 << r4
|
2847
|
+
end
|
2848
|
+
if s0.last
|
2849
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2850
|
+
r0.extend(MS0)
|
2851
|
+
else
|
2852
|
+
@index = i0
|
2853
|
+
r0 = nil
|
2854
|
+
end
|
2855
|
+
|
2856
|
+
node_cache[:MS][start_index] = r0
|
2857
|
+
|
2858
|
+
r0
|
2859
|
+
end
|
2860
|
+
|
2861
|
+
module MSC0
|
2862
|
+
def S
|
2863
|
+
elements[1]
|
2864
|
+
end
|
2865
|
+
end
|
2866
|
+
|
2867
|
+
module MSC1
|
2784
2868
|
def S
|
2785
2869
|
elements[1]
|
2786
2870
|
end
|
2787
2871
|
end
|
2788
2872
|
|
2789
|
-
|
2873
|
+
module MSC2
|
2874
|
+
def MS
|
2875
|
+
elements[0]
|
2876
|
+
end
|
2877
|
+
|
2878
|
+
end
|
2879
|
+
|
2880
|
+
def _nt_MSC
|
2790
2881
|
start_index = index
|
2791
|
-
if node_cache[:
|
2792
|
-
cached = node_cache[:
|
2882
|
+
if node_cache[:MSC].has_key?(index)
|
2883
|
+
cached = node_cache[:MSC][index]
|
2793
2884
|
if cached
|
2794
|
-
node_cache[:
|
2885
|
+
node_cache[:MSC][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2795
2886
|
@index = cached.interval.end
|
2796
2887
|
end
|
2797
2888
|
return cached
|
2798
2889
|
end
|
2799
2890
|
|
2891
|
+
i0 = index
|
2800
2892
|
i1, s1 = index, []
|
2801
2893
|
if (match_len = has_terminal?(",", false, index))
|
2802
2894
|
r2 = true
|
@@ -2812,38 +2904,147 @@ module EDNGRAMMAR
|
|
2812
2904
|
end
|
2813
2905
|
if s1.last
|
2814
2906
|
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
2815
|
-
r1.extend(
|
2907
|
+
r1.extend(MSC0)
|
2816
2908
|
else
|
2817
2909
|
@index = i1
|
2818
2910
|
r1 = nil
|
2819
2911
|
end
|
2820
2912
|
if r1
|
2913
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
2821
2914
|
r0 = r1
|
2822
2915
|
else
|
2823
|
-
|
2916
|
+
i4, s4 = index, []
|
2917
|
+
r5 = _nt_MS
|
2918
|
+
s4 << r5
|
2919
|
+
if r5
|
2920
|
+
i7, s7 = index, []
|
2921
|
+
if (match_len = has_terminal?(",", false, index))
|
2922
|
+
r8 = true
|
2923
|
+
@index += match_len
|
2924
|
+
else
|
2925
|
+
terminal_parse_failure('","')
|
2926
|
+
r8 = nil
|
2927
|
+
end
|
2928
|
+
s7 << r8
|
2929
|
+
if r8
|
2930
|
+
r9 = _nt_S
|
2931
|
+
s7 << r9
|
2932
|
+
end
|
2933
|
+
if s7.last
|
2934
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
2935
|
+
r7.extend(MSC1)
|
2936
|
+
else
|
2937
|
+
@index = i7
|
2938
|
+
r7 = nil
|
2939
|
+
end
|
2940
|
+
if r7
|
2941
|
+
r6 = r7
|
2942
|
+
else
|
2943
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
2944
|
+
end
|
2945
|
+
s4 << r6
|
2946
|
+
end
|
2947
|
+
if s4.last
|
2948
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
2949
|
+
r4.extend(MSC2)
|
2950
|
+
else
|
2951
|
+
@index = i4
|
2952
|
+
r4 = nil
|
2953
|
+
end
|
2954
|
+
if r4
|
2955
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
2956
|
+
r0 = r4
|
2957
|
+
else
|
2958
|
+
@index = i0
|
2959
|
+
r0 = nil
|
2960
|
+
end
|
2824
2961
|
end
|
2825
2962
|
|
2826
|
-
node_cache[:
|
2963
|
+
node_cache[:MSC][start_index] = r0
|
2964
|
+
|
2965
|
+
r0
|
2966
|
+
end
|
2967
|
+
|
2968
|
+
module SOC0
|
2969
|
+
def S
|
2970
|
+
elements[1]
|
2971
|
+
end
|
2972
|
+
end
|
2973
|
+
|
2974
|
+
module SOC1
|
2975
|
+
def S
|
2976
|
+
elements[0]
|
2977
|
+
end
|
2978
|
+
|
2979
|
+
end
|
2980
|
+
|
2981
|
+
def _nt_SOC
|
2982
|
+
start_index = index
|
2983
|
+
if node_cache[:SOC].has_key?(index)
|
2984
|
+
cached = node_cache[:SOC][index]
|
2985
|
+
if cached
|
2986
|
+
node_cache[:SOC][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2987
|
+
@index = cached.interval.end
|
2988
|
+
end
|
2989
|
+
return cached
|
2990
|
+
end
|
2991
|
+
|
2992
|
+
i0, s0 = index, []
|
2993
|
+
r1 = _nt_S
|
2994
|
+
s0 << r1
|
2995
|
+
if r1
|
2996
|
+
i3, s3 = index, []
|
2997
|
+
if (match_len = has_terminal?(",", false, index))
|
2998
|
+
r4 = true
|
2999
|
+
@index += match_len
|
3000
|
+
else
|
3001
|
+
terminal_parse_failure('","')
|
3002
|
+
r4 = nil
|
3003
|
+
end
|
3004
|
+
s3 << r4
|
3005
|
+
if r4
|
3006
|
+
r5 = _nt_S
|
3007
|
+
s3 << r5
|
3008
|
+
end
|
3009
|
+
if s3.last
|
3010
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
3011
|
+
r3.extend(SOC0)
|
3012
|
+
else
|
3013
|
+
@index = i3
|
3014
|
+
r3 = nil
|
3015
|
+
end
|
3016
|
+
if r3
|
3017
|
+
r2 = r3
|
3018
|
+
else
|
3019
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
3020
|
+
end
|
3021
|
+
s0 << r2
|
3022
|
+
end
|
3023
|
+
if s0.last
|
3024
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
3025
|
+
r0.extend(SOC1)
|
3026
|
+
else
|
3027
|
+
@index = i0
|
3028
|
+
r0 = nil
|
3029
|
+
end
|
3030
|
+
|
3031
|
+
node_cache[:SOC][start_index] = r0
|
2827
3032
|
|
2828
3033
|
r0
|
2829
3034
|
end
|
2830
3035
|
|
2831
3036
|
module Streamstring0
|
2832
|
-
def
|
3037
|
+
def MSC
|
2833
3038
|
elements[0]
|
2834
3039
|
end
|
2835
3040
|
|
2836
3041
|
def string
|
2837
3042
|
elements[1]
|
2838
3043
|
end
|
2839
|
-
|
2840
|
-
def S
|
2841
|
-
elements[2]
|
2842
|
-
end
|
2843
3044
|
end
|
2844
3045
|
|
2845
3046
|
module Streamstring1
|
2846
|
-
def
|
3047
|
+
def MS
|
2847
3048
|
elements[1]
|
2848
3049
|
end
|
2849
3050
|
|
@@ -2851,19 +3052,15 @@ module EDNGRAMMAR
|
|
2851
3052
|
elements[2]
|
2852
3053
|
end
|
2853
3054
|
|
2854
|
-
def
|
2855
|
-
elements[
|
2856
|
-
end
|
2857
|
-
|
2858
|
-
def OC
|
2859
|
-
elements[5]
|
3055
|
+
def SOC
|
3056
|
+
elements[4]
|
2860
3057
|
end
|
2861
3058
|
|
2862
3059
|
end
|
2863
3060
|
|
2864
3061
|
module Streamstring2
|
2865
3062
|
def ast
|
2866
|
-
strings = [elements[2].ast] + elements[
|
3063
|
+
strings = [elements[2].ast] + elements[3].elements.map {|x| x.string.ast }
|
2867
3064
|
unless Set[*strings.map(&:encoding)].size == 1
|
2868
3065
|
warn "*** mixed streamstring #{strings.cbor_diagnostic}"
|
2869
3066
|
end
|
@@ -2892,56 +3089,48 @@ module EDNGRAMMAR
|
|
2892
3089
|
end
|
2893
3090
|
s0 << r1
|
2894
3091
|
if r1
|
2895
|
-
r2 =
|
3092
|
+
r2 = _nt_MS
|
2896
3093
|
s0 << r2
|
2897
3094
|
if r2
|
2898
3095
|
r3 = _nt_string
|
2899
3096
|
s0 << r3
|
2900
3097
|
if r3
|
2901
|
-
|
3098
|
+
s4, i4 = [], index
|
3099
|
+
loop do
|
3100
|
+
i5, s5 = index, []
|
3101
|
+
r6 = _nt_MSC
|
3102
|
+
s5 << r6
|
3103
|
+
if r6
|
3104
|
+
r7 = _nt_string
|
3105
|
+
s5 << r7
|
3106
|
+
end
|
3107
|
+
if s5.last
|
3108
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
3109
|
+
r5.extend(Streamstring0)
|
3110
|
+
else
|
3111
|
+
@index = i5
|
3112
|
+
r5 = nil
|
3113
|
+
end
|
3114
|
+
if r5
|
3115
|
+
s4 << r5
|
3116
|
+
else
|
3117
|
+
break
|
3118
|
+
end
|
3119
|
+
end
|
3120
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
2902
3121
|
s0 << r4
|
2903
3122
|
if r4
|
2904
|
-
|
2905
|
-
|
2906
|
-
|
2907
|
-
|
2908
|
-
|
2909
|
-
|
2910
|
-
r8 = _nt_string
|
2911
|
-
s6 << r8
|
2912
|
-
if r8
|
2913
|
-
r9 = _nt_S
|
2914
|
-
s6 << r9
|
2915
|
-
end
|
2916
|
-
end
|
2917
|
-
if s6.last
|
2918
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
2919
|
-
r6.extend(Streamstring0)
|
2920
|
-
else
|
2921
|
-
@index = i6
|
2922
|
-
r6 = nil
|
2923
|
-
end
|
2924
|
-
if r6
|
2925
|
-
s5 << r6
|
3123
|
+
r8 = _nt_SOC
|
3124
|
+
s0 << r8
|
3125
|
+
if r8
|
3126
|
+
if (match_len = has_terminal?(")", false, index))
|
3127
|
+
r9 = true
|
3128
|
+
@index += match_len
|
2926
3129
|
else
|
2927
|
-
|
2928
|
-
|
2929
|
-
end
|
2930
|
-
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
2931
|
-
s0 << r5
|
2932
|
-
if r5
|
2933
|
-
r10 = _nt_OC
|
2934
|
-
s0 << r10
|
2935
|
-
if r10
|
2936
|
-
if (match_len = has_terminal?(")", false, index))
|
2937
|
-
r11 = true
|
2938
|
-
@index += match_len
|
2939
|
-
else
|
2940
|
-
terminal_parse_failure('")"')
|
2941
|
-
r11 = nil
|
2942
|
-
end
|
2943
|
-
s0 << r11
|
3130
|
+
terminal_parse_failure('")"')
|
3131
|
+
r9 = nil
|
2944
3132
|
end
|
3133
|
+
s0 << r9
|
2945
3134
|
end
|
2946
3135
|
end
|
2947
3136
|
end
|
@@ -2964,6 +3153,10 @@ module EDNGRAMMAR
|
|
2964
3153
|
module Spec0
|
2965
3154
|
end
|
2966
3155
|
|
3156
|
+
module Spec1
|
3157
|
+
def ast; elements[0].elements[1].text_value end
|
3158
|
+
end
|
3159
|
+
|
2967
3160
|
def _nt_spec
|
2968
3161
|
start_index = index
|
2969
3162
|
if node_cache[:spec].has_key?(index)
|
@@ -3015,6 +3208,71 @@ module EDNGRAMMAR
|
|
3015
3208
|
r0
|
3016
3209
|
end
|
3017
3210
|
|
3211
|
+
module Specms0
|
3212
|
+
def MS
|
3213
|
+
elements[2]
|
3214
|
+
end
|
3215
|
+
end
|
3216
|
+
|
3217
|
+
module Specms1
|
3218
|
+
def ast; elements[0].elements[1].text_value end
|
3219
|
+
end
|
3220
|
+
|
3221
|
+
def _nt_specms
|
3222
|
+
start_index = index
|
3223
|
+
if node_cache[:specms].has_key?(index)
|
3224
|
+
cached = node_cache[:specms][index]
|
3225
|
+
if cached
|
3226
|
+
node_cache[:specms][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3227
|
+
@index = cached.interval.end
|
3228
|
+
end
|
3229
|
+
return cached
|
3230
|
+
end
|
3231
|
+
|
3232
|
+
i1, s1 = index, []
|
3233
|
+
if (match_len = has_terminal?("_", false, index))
|
3234
|
+
r2 = true
|
3235
|
+
@index += match_len
|
3236
|
+
else
|
3237
|
+
terminal_parse_failure('"_"')
|
3238
|
+
r2 = nil
|
3239
|
+
end
|
3240
|
+
s1 << r2
|
3241
|
+
if r2
|
3242
|
+
s3, i3 = [], index
|
3243
|
+
loop do
|
3244
|
+
r4 = _nt_wordchar
|
3245
|
+
if r4
|
3246
|
+
s3 << r4
|
3247
|
+
else
|
3248
|
+
break
|
3249
|
+
end
|
3250
|
+
end
|
3251
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
3252
|
+
s1 << r3
|
3253
|
+
if r3
|
3254
|
+
r5 = _nt_MS
|
3255
|
+
s1 << r5
|
3256
|
+
end
|
3257
|
+
end
|
3258
|
+
if s1.last
|
3259
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
3260
|
+
r1.extend(Specms0)
|
3261
|
+
else
|
3262
|
+
@index = i1
|
3263
|
+
r1 = nil
|
3264
|
+
end
|
3265
|
+
if r1
|
3266
|
+
r0 = r1
|
3267
|
+
else
|
3268
|
+
r0 = instantiate_node(SyntaxNode,input, index...index)
|
3269
|
+
end
|
3270
|
+
|
3271
|
+
node_cache[:specms][start_index] = r0
|
3272
|
+
|
3273
|
+
r0
|
3274
|
+
end
|
3275
|
+
|
3018
3276
|
module DoubleQuoted0
|
3019
3277
|
def ast; text_value.gsub("\r", "") end
|
3020
3278
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edn-abnf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|