edn-abnf 0.5.4 → 0.5.5
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/bin/edn-abnf +3 -0
- data/edn-abnf.gemspec +1 -1
- data/lib/parser/edngrammar.rb +96 -30
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dfe85683dcf245892881927e2282ef6d37f7cf4f1af908fd0d42311f1ab3df0
|
4
|
+
data.tar.gz: 4b1f2852badbe29367e0a2a74e21fb7c0a66991b29a1770ad9b6828fc4a5c007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf2a94c9c99cc4d8514bcc43cd6510e9680039f32f56424ac3591acbe7124b074c3cc7fb86a9bd121a353d268adb6e72aef1fa0dad18439f4ee8b52de5834a2
|
7
|
+
data.tar.gz: b073d04f739667786be52f5a97dde7889573f9630a111f44528e0664fe3ae0a9cce8333f5b1e846833629018d363b1492464c3d976788d72b8ffa05f90719914
|
data/bin/edn-abnf
CHANGED
@@ -46,6 +46,9 @@ begin
|
|
46
46
|
require 'csv'
|
47
47
|
$options.lines = v
|
48
48
|
end
|
49
|
+
opts.on("-i", "--[no-]integrated", "use integrated parsers where available") do |v|
|
50
|
+
$options.integrated = v
|
51
|
+
end
|
49
52
|
opts.on("-eEDN", "--e=EDN", "supply EDN on command line") do |v|
|
50
53
|
$options.edn = v
|
51
54
|
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.5.
|
3
|
+
s.version = "0.5.5"
|
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
@@ -1865,6 +1865,28 @@ module EDNGRAMMAR
|
|
1865
1865
|
r0
|
1866
1866
|
end
|
1867
1867
|
|
1868
|
+
module Bstr0
|
1869
|
+
def sq_app_string_h
|
1870
|
+
elements[0]
|
1871
|
+
end
|
1872
|
+
|
1873
|
+
end
|
1874
|
+
|
1875
|
+
module Bstr1
|
1876
|
+
def ast; elements[0].ast end
|
1877
|
+
end
|
1878
|
+
|
1879
|
+
module Bstr2
|
1880
|
+
def sq_app_string_b64
|
1881
|
+
elements[0]
|
1882
|
+
end
|
1883
|
+
|
1884
|
+
end
|
1885
|
+
|
1886
|
+
module Bstr3
|
1887
|
+
def ast; elements[0].ast end
|
1888
|
+
end
|
1889
|
+
|
1868
1890
|
def _nt_bstr
|
1869
1891
|
start_index = index
|
1870
1892
|
if node_cache[:bstr].has_key?(index)
|
@@ -1877,35 +1899,85 @@ module EDNGRAMMAR
|
|
1877
1899
|
end
|
1878
1900
|
|
1879
1901
|
i0 = index
|
1880
|
-
|
1902
|
+
i1, s1 = index, []
|
1903
|
+
r2 = _nt_sq_app_string_h
|
1904
|
+
s1 << r2
|
1905
|
+
if r2
|
1906
|
+
i3 = index
|
1907
|
+
r4 = lambda {|x|$options.integrated}.call(s1)
|
1908
|
+
if !r4
|
1909
|
+
terminal_parse_failure("<semantic predicate>")
|
1910
|
+
end
|
1911
|
+
if r4
|
1912
|
+
@index = i3
|
1913
|
+
r3 = instantiate_node(SyntaxNode,input, index...index)
|
1914
|
+
else
|
1915
|
+
@index = i3
|
1916
|
+
r3 = nil
|
1917
|
+
end
|
1918
|
+
s1 << r3
|
1919
|
+
end
|
1920
|
+
if s1.last
|
1921
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
1922
|
+
r1.extend(Bstr0)
|
1923
|
+
r1.extend(Bstr1)
|
1924
|
+
else
|
1925
|
+
@index = i1
|
1926
|
+
r1 = nil
|
1927
|
+
end
|
1881
1928
|
if r1
|
1882
1929
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
1883
1930
|
r0 = r1
|
1884
1931
|
else
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1932
|
+
i5, s5 = index, []
|
1933
|
+
r6 = _nt_sq_app_string_b64
|
1934
|
+
s5 << r6
|
1935
|
+
if r6
|
1936
|
+
i7 = index
|
1937
|
+
r8 = lambda {|x|$options.integrated}.call(s5)
|
1938
|
+
if !r8
|
1939
|
+
terminal_parse_failure("<semantic predicate>")
|
1940
|
+
end
|
1941
|
+
if r8
|
1942
|
+
@index = i7
|
1943
|
+
r7 = instantiate_node(SyntaxNode,input, index...index)
|
1944
|
+
else
|
1945
|
+
@index = i7
|
1946
|
+
r7 = nil
|
1947
|
+
end
|
1948
|
+
s5 << r7
|
1949
|
+
end
|
1950
|
+
if s5.last
|
1951
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1952
|
+
r5.extend(Bstr2)
|
1953
|
+
r5.extend(Bstr3)
|
1889
1954
|
else
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1955
|
+
@index = i5
|
1956
|
+
r5 = nil
|
1957
|
+
end
|
1958
|
+
if r5
|
1959
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
1960
|
+
r0 = r5
|
1961
|
+
else
|
1962
|
+
r9 = _nt_app_string
|
1963
|
+
if r9
|
1964
|
+
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
1965
|
+
r0 = r9
|
1894
1966
|
else
|
1895
|
-
|
1896
|
-
if
|
1897
|
-
|
1898
|
-
r0 =
|
1967
|
+
r10 = _nt_sqstr
|
1968
|
+
if r10
|
1969
|
+
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
1970
|
+
r0 = r10
|
1899
1971
|
else
|
1900
|
-
|
1901
|
-
if
|
1902
|
-
|
1903
|
-
r0 =
|
1972
|
+
r11 = _nt_app_sequence
|
1973
|
+
if r11
|
1974
|
+
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
1975
|
+
r0 = r11
|
1904
1976
|
else
|
1905
|
-
|
1906
|
-
if
|
1907
|
-
|
1908
|
-
r0 =
|
1977
|
+
r12 = _nt_embedded
|
1978
|
+
if r12
|
1979
|
+
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
1980
|
+
r0 = r12
|
1909
1981
|
else
|
1910
1982
|
@index = i0
|
1911
1983
|
r0 = nil
|
@@ -5913,7 +5985,7 @@ module EDNGRAMMAR
|
|
5913
5985
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5914
5986
|
r0 = r1
|
5915
5987
|
else
|
5916
|
-
r2 =
|
5988
|
+
r2 = _nt_ALPHA
|
5917
5989
|
if r2
|
5918
5990
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5919
5991
|
r0 = r2
|
@@ -5923,14 +5995,8 @@ module EDNGRAMMAR
|
|
5923
5995
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5924
5996
|
r0 = r3
|
5925
5997
|
else
|
5926
|
-
|
5927
|
-
|
5928
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
5929
|
-
r0 = r4
|
5930
|
-
else
|
5931
|
-
@index = i0
|
5932
|
-
r0 = nil
|
5933
|
-
end
|
5998
|
+
@index = i0
|
5999
|
+
r0 = nil
|
5934
6000
|
end
|
5935
6001
|
end
|
5936
6002
|
end
|