cbor-diag 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cbor-diag.gemspec +1 -1
- data/lib/cbor-diag-parser.rb +22 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcb520130b1dd8d160e193f0e220042dfd4779ea
|
4
|
+
data.tar.gz: 2f1f8ed1bcb7b8e0d956d505307b3b6bd22edc1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be137d244ceaedcb26dcdcecd52ec08684703759b3364b902aa6244c459f2e27a82999d0d4244d3ef7d638930925a2c5b1bbd790cf7c8ba79a6acf77cebdcb00
|
7
|
+
data.tar.gz: d790ec5b0deaefe14607c3ea18eb8aacd50933f9d270bdedb3da13b6e3a65dc81508c0128bf20aa5b472e16800c7e958c884612181990d0edc1d6039a3bbcb65
|
data/cbor-diag.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cbor-diag"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.5"
|
4
4
|
s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
|
5
5
|
s.description = %q{cbor-diag implements diagnostic notation for CBOR, RFC 7049}
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/cbor-diag-parser.rb
CHANGED
@@ -104,23 +104,29 @@ module CBOR_DIAG
|
|
104
104
|
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
105
105
|
r0 = r6
|
106
106
|
else
|
107
|
-
r7 =
|
107
|
+
r7 = _nt_b64string
|
108
108
|
if r7
|
109
109
|
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
110
110
|
r0 = r7
|
111
111
|
else
|
112
|
-
r8 =
|
112
|
+
r8 = _nt_array
|
113
113
|
if r8
|
114
114
|
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
115
115
|
r0 = r8
|
116
116
|
else
|
117
|
-
r9 =
|
117
|
+
r9 = _nt_map
|
118
118
|
if r9
|
119
119
|
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
120
120
|
r0 = r9
|
121
121
|
else
|
122
|
-
|
123
|
-
|
122
|
+
r10 = _nt_streamstring
|
123
|
+
if r10
|
124
|
+
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
125
|
+
r0 = r10
|
126
|
+
else
|
127
|
+
@index = i0
|
128
|
+
r0 = nil
|
129
|
+
end
|
124
130
|
end
|
125
131
|
end
|
126
132
|
end
|
@@ -1273,17 +1279,17 @@ module CBOR_DIAG
|
|
1273
1279
|
r0
|
1274
1280
|
end
|
1275
1281
|
|
1276
|
-
module
|
1282
|
+
module B64string0
|
1277
1283
|
end
|
1278
1284
|
|
1279
|
-
module
|
1285
|
+
module B64string1
|
1280
1286
|
def s
|
1281
1287
|
elements[1]
|
1282
1288
|
end
|
1283
1289
|
|
1284
1290
|
end
|
1285
1291
|
|
1286
|
-
module
|
1292
|
+
module B64string2
|
1287
1293
|
#"
|
1288
1294
|
def to_rb;
|
1289
1295
|
t = s.text_value.chars.each_slice(4).map(&:join)
|
@@ -1294,12 +1300,12 @@ module CBOR_DIAG
|
|
1294
1300
|
end
|
1295
1301
|
end
|
1296
1302
|
|
1297
|
-
def
|
1303
|
+
def _nt_b64string
|
1298
1304
|
start_index = index
|
1299
|
-
if node_cache[:
|
1300
|
-
cached = node_cache[:
|
1305
|
+
if node_cache[:b64string].has_key?(index)
|
1306
|
+
cached = node_cache[:b64string][index]
|
1301
1307
|
if cached
|
1302
|
-
node_cache[:
|
1308
|
+
node_cache[:b64string][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1303
1309
|
@index = cached.interval.end
|
1304
1310
|
end
|
1305
1311
|
return cached
|
@@ -1354,7 +1360,7 @@ module CBOR_DIAG
|
|
1354
1360
|
end
|
1355
1361
|
if s2.last
|
1356
1362
|
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1357
|
-
r2.extend(
|
1363
|
+
r2.extend(B64string0)
|
1358
1364
|
else
|
1359
1365
|
@index = i2
|
1360
1366
|
r2 = nil
|
@@ -1373,14 +1379,14 @@ module CBOR_DIAG
|
|
1373
1379
|
end
|
1374
1380
|
if s0.last
|
1375
1381
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1376
|
-
r0.extend(
|
1377
|
-
r0.extend(
|
1382
|
+
r0.extend(B64string1)
|
1383
|
+
r0.extend(B64string2)
|
1378
1384
|
else
|
1379
1385
|
@index = i0
|
1380
1386
|
r0 = nil
|
1381
1387
|
end
|
1382
1388
|
|
1383
|
-
node_cache[:
|
1389
|
+
node_cache[:b64string][start_index] = r0
|
1384
1390
|
|
1385
1391
|
r0
|
1386
1392
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor-diag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|