cbor-diag 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cbor-diag.gemspec +1 -1
- data/lib/cbor-diag-parser.rb +111 -92
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a24a03600aade04721f48ff64a5b1dc708bb23f52e9c579072ddeb25f14dab
|
4
|
+
data.tar.gz: ffd756ef269c0176c07ec8570e098adcee32fa7f505a25bf2e87bfee1007a7a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85030b510f22cd8d78259dadba6af46be60de6ec95a61b1b8dfaded0a9efaa42ba6bd33f4c4edbf8f5856bbbd59510366c4b196f6adf6109f6129b450f28fdf0
|
7
|
+
data.tar.gz: c71f5e097c5891f0bfe21f1540e0b329e40c56b14baf381aff4da47dcc5d4676f6e9074d544f95e33619c5c8837c3685f16121dd9717da3d7367785400e32bdc
|
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.10.
|
3
|
+
s.version = "0.10.2"
|
4
4
|
s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
|
5
5
|
s.description = %q{cbor-diag implements diagnostic notation for CBOR, RFC 8949 and RFC 8742}
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/cbor-diag-parser.rb
CHANGED
@@ -9,16 +9,12 @@ module CBOR_DIAG
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module Text0
|
12
|
-
def
|
13
|
-
elements[
|
12
|
+
def soc
|
13
|
+
elements[0]
|
14
14
|
end
|
15
15
|
|
16
16
|
def value
|
17
|
-
elements[
|
18
|
-
end
|
19
|
-
|
20
|
-
def ows2
|
21
|
-
elements[3]
|
17
|
+
elements[1]
|
22
18
|
end
|
23
19
|
end
|
24
20
|
|
@@ -34,20 +30,20 @@ module CBOR_DIAG
|
|
34
30
|
def an
|
35
31
|
elements[2]
|
36
32
|
end
|
33
|
+
|
34
|
+
def soc
|
35
|
+
elements[3]
|
36
|
+
end
|
37
37
|
end
|
38
38
|
|
39
39
|
module Text2
|
40
|
-
def
|
40
|
+
def ows
|
41
41
|
elements[0]
|
42
42
|
end
|
43
43
|
|
44
44
|
def a1
|
45
45
|
elements[1]
|
46
46
|
end
|
47
|
-
|
48
|
-
def ows2
|
49
|
-
elements[2]
|
50
|
-
end
|
51
47
|
end
|
52
48
|
|
53
49
|
module Text3
|
@@ -90,25 +86,11 @@ module CBOR_DIAG
|
|
90
86
|
s6, i6 = [], index
|
91
87
|
loop do
|
92
88
|
i7, s7 = index, []
|
93
|
-
|
94
|
-
r8 = true
|
95
|
-
@index += match_len
|
96
|
-
else
|
97
|
-
terminal_parse_failure('\',\'')
|
98
|
-
r8 = nil
|
99
|
-
end
|
89
|
+
r8 = _nt_soc
|
100
90
|
s7 << r8
|
101
91
|
if r8
|
102
|
-
r9 =
|
92
|
+
r9 = _nt_value
|
103
93
|
s7 << r9
|
104
|
-
if r9
|
105
|
-
r10 = _nt_value
|
106
|
-
s7 << r10
|
107
|
-
if r10
|
108
|
-
r11 = _nt_ows
|
109
|
-
s7 << r11
|
110
|
-
end
|
111
|
-
end
|
112
94
|
end
|
113
95
|
if s7.last
|
114
96
|
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
@@ -125,6 +107,10 @@ module CBOR_DIAG
|
|
125
107
|
end
|
126
108
|
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
127
109
|
s3 << r6
|
110
|
+
if r6
|
111
|
+
r10 = _nt_soc
|
112
|
+
s3 << r10
|
113
|
+
end
|
128
114
|
end
|
129
115
|
end
|
130
116
|
if s3.last
|
@@ -140,10 +126,6 @@ module CBOR_DIAG
|
|
140
126
|
r2 = instantiate_node(SyntaxNode,input, index...index)
|
141
127
|
end
|
142
128
|
s0 << r2
|
143
|
-
if r2
|
144
|
-
r12 = _nt_ows
|
145
|
-
s0 << r12
|
146
|
-
end
|
147
129
|
end
|
148
130
|
if s0.last
|
149
131
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
@@ -2554,16 +2536,12 @@ module CBOR_DIAG
|
|
2554
2536
|
end
|
2555
2537
|
|
2556
2538
|
module Array0
|
2557
|
-
def
|
2558
|
-
elements[
|
2539
|
+
def soc
|
2540
|
+
elements[0]
|
2559
2541
|
end
|
2560
2542
|
|
2561
2543
|
def value
|
2562
|
-
elements[
|
2563
|
-
end
|
2564
|
-
|
2565
|
-
def ows2
|
2566
|
-
elements[3]
|
2544
|
+
elements[1]
|
2567
2545
|
end
|
2568
2546
|
end
|
2569
2547
|
|
@@ -2590,7 +2568,7 @@ module CBOR_DIAG
|
|
2590
2568
|
elements[2]
|
2591
2569
|
end
|
2592
2570
|
|
2593
|
-
def
|
2571
|
+
def soc
|
2594
2572
|
elements[3]
|
2595
2573
|
end
|
2596
2574
|
|
@@ -2644,25 +2622,11 @@ module CBOR_DIAG
|
|
2644
2622
|
s7, i7 = [], index
|
2645
2623
|
loop do
|
2646
2624
|
i8, s8 = index, []
|
2647
|
-
|
2648
|
-
r9 = true
|
2649
|
-
@index += match_len
|
2650
|
-
else
|
2651
|
-
terminal_parse_failure('\',\'')
|
2652
|
-
r9 = nil
|
2653
|
-
end
|
2625
|
+
r9 = _nt_soc
|
2654
2626
|
s8 << r9
|
2655
2627
|
if r9
|
2656
|
-
r10 =
|
2628
|
+
r10 = _nt_value
|
2657
2629
|
s8 << r10
|
2658
|
-
if r10
|
2659
|
-
r11 = _nt_value
|
2660
|
-
s8 << r11
|
2661
|
-
if r11
|
2662
|
-
r12 = _nt_ows
|
2663
|
-
s8 << r12
|
2664
|
-
end
|
2665
|
-
end
|
2666
2630
|
end
|
2667
2631
|
if s8.last
|
2668
2632
|
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
@@ -2695,17 +2659,17 @@ module CBOR_DIAG
|
|
2695
2659
|
end
|
2696
2660
|
s0 << r3
|
2697
2661
|
if r3
|
2698
|
-
|
2699
|
-
s0 <<
|
2700
|
-
if
|
2662
|
+
r11 = _nt_soc
|
2663
|
+
s0 << r11
|
2664
|
+
if r11
|
2701
2665
|
if (match_len = has_terminal?(']', false, index))
|
2702
|
-
|
2666
|
+
r12 = true
|
2703
2667
|
@index += match_len
|
2704
2668
|
else
|
2705
2669
|
terminal_parse_failure('\']\'')
|
2706
|
-
|
2670
|
+
r12 = nil
|
2707
2671
|
end
|
2708
|
-
s0 <<
|
2672
|
+
s0 << r12
|
2709
2673
|
end
|
2710
2674
|
end
|
2711
2675
|
end
|
@@ -2725,16 +2689,12 @@ module CBOR_DIAG
|
|
2725
2689
|
end
|
2726
2690
|
|
2727
2691
|
module Map0
|
2728
|
-
def
|
2729
|
-
elements[
|
2692
|
+
def soc
|
2693
|
+
elements[0]
|
2730
2694
|
end
|
2731
2695
|
|
2732
2696
|
def kp
|
2733
|
-
elements[
|
2734
|
-
end
|
2735
|
-
|
2736
|
-
def ows2
|
2737
|
-
elements[3]
|
2697
|
+
elements[1]
|
2738
2698
|
end
|
2739
2699
|
end
|
2740
2700
|
|
@@ -2761,7 +2721,7 @@ module CBOR_DIAG
|
|
2761
2721
|
elements[2]
|
2762
2722
|
end
|
2763
2723
|
|
2764
|
-
def
|
2724
|
+
def soc
|
2765
2725
|
elements[3]
|
2766
2726
|
end
|
2767
2727
|
|
@@ -2815,25 +2775,11 @@ module CBOR_DIAG
|
|
2815
2775
|
s7, i7 = [], index
|
2816
2776
|
loop do
|
2817
2777
|
i8, s8 = index, []
|
2818
|
-
|
2819
|
-
r9 = true
|
2820
|
-
@index += match_len
|
2821
|
-
else
|
2822
|
-
terminal_parse_failure('\',\'')
|
2823
|
-
r9 = nil
|
2824
|
-
end
|
2778
|
+
r9 = _nt_soc
|
2825
2779
|
s8 << r9
|
2826
2780
|
if r9
|
2827
|
-
r10 =
|
2781
|
+
r10 = _nt_kp
|
2828
2782
|
s8 << r10
|
2829
|
-
if r10
|
2830
|
-
r11 = _nt_kp
|
2831
|
-
s8 << r11
|
2832
|
-
if r11
|
2833
|
-
r12 = _nt_ows
|
2834
|
-
s8 << r12
|
2835
|
-
end
|
2836
|
-
end
|
2837
2783
|
end
|
2838
2784
|
if s8.last
|
2839
2785
|
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
@@ -2866,17 +2812,17 @@ module CBOR_DIAG
|
|
2866
2812
|
end
|
2867
2813
|
s0 << r3
|
2868
2814
|
if r3
|
2869
|
-
|
2870
|
-
s0 <<
|
2871
|
-
if
|
2815
|
+
r11 = _nt_soc
|
2816
|
+
s0 << r11
|
2817
|
+
if r11
|
2872
2818
|
if (match_len = has_terminal?('}', false, index))
|
2873
|
-
|
2819
|
+
r12 = true
|
2874
2820
|
@index += match_len
|
2875
2821
|
else
|
2876
2822
|
terminal_parse_failure('\'}\'')
|
2877
|
-
|
2823
|
+
r12 = nil
|
2878
2824
|
end
|
2879
|
-
s0 <<
|
2825
|
+
s0 << r12
|
2880
2826
|
end
|
2881
2827
|
end
|
2882
2828
|
end
|
@@ -3098,6 +3044,79 @@ module CBOR_DIAG
|
|
3098
3044
|
r0
|
3099
3045
|
end
|
3100
3046
|
|
3047
|
+
module Soc0
|
3048
|
+
def ows
|
3049
|
+
elements[1]
|
3050
|
+
end
|
3051
|
+
end
|
3052
|
+
|
3053
|
+
module Soc1
|
3054
|
+
def ows
|
3055
|
+
elements[0]
|
3056
|
+
end
|
3057
|
+
|
3058
|
+
end
|
3059
|
+
|
3060
|
+
module Soc2
|
3061
|
+
def sval; "" end
|
3062
|
+
end
|
3063
|
+
|
3064
|
+
def _nt_soc
|
3065
|
+
start_index = index
|
3066
|
+
if node_cache[:soc].has_key?(index)
|
3067
|
+
cached = node_cache[:soc][index]
|
3068
|
+
if cached
|
3069
|
+
node_cache[:soc][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3070
|
+
@index = cached.interval.end
|
3071
|
+
end
|
3072
|
+
return cached
|
3073
|
+
end
|
3074
|
+
|
3075
|
+
i0, s0 = index, []
|
3076
|
+
r1 = _nt_ows
|
3077
|
+
s0 << r1
|
3078
|
+
if r1
|
3079
|
+
i3, s3 = index, []
|
3080
|
+
if (match_len = has_terminal?(',', false, index))
|
3081
|
+
r4 = true
|
3082
|
+
@index += match_len
|
3083
|
+
else
|
3084
|
+
terminal_parse_failure('\',\'')
|
3085
|
+
r4 = nil
|
3086
|
+
end
|
3087
|
+
s3 << r4
|
3088
|
+
if r4
|
3089
|
+
r5 = _nt_ows
|
3090
|
+
s3 << r5
|
3091
|
+
end
|
3092
|
+
if s3.last
|
3093
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
3094
|
+
r3.extend(Soc0)
|
3095
|
+
else
|
3096
|
+
@index = i3
|
3097
|
+
r3 = nil
|
3098
|
+
end
|
3099
|
+
if r3
|
3100
|
+
r2 = r3
|
3101
|
+
else
|
3102
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
3103
|
+
end
|
3104
|
+
s0 << r2
|
3105
|
+
end
|
3106
|
+
if s0.last
|
3107
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
3108
|
+
r0.extend(Soc1)
|
3109
|
+
r0.extend(Soc2)
|
3110
|
+
else
|
3111
|
+
@index = i0
|
3112
|
+
r0 = nil
|
3113
|
+
end
|
3114
|
+
|
3115
|
+
node_cache[:soc][start_index] = r0
|
3116
|
+
|
3117
|
+
r0
|
3118
|
+
end
|
3119
|
+
|
3101
3120
|
module Streamstring0
|
3102
3121
|
def ows1
|
3103
3122
|
elements[1]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor-diag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bundler
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
|
-
rubygems_version: 3.6.
|
200
|
+
rubygems_version: 3.6.9
|
201
201
|
specification_version: 4
|
202
202
|
summary: CBOR (Concise Binary Object Representation) diagnostic notation
|
203
203
|
test_files: []
|