edn-abnf 0.5.10 → 0.5.11
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/edn-abnf.gemspec +1 -1
- data/lib/parser/edngrammar.rb +74 -45
- 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: 0256ffcfa25350ebaec7f12b1e7453022cb598d940e277f1802372517af2f010
|
4
|
+
data.tar.gz: 63d04404a325565ef62008b5df88eb4396e0851b68527f104108b2e8e1b7f4b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e91c759504595744b197f522fdd6de6ba1a07add5f994e9adf40899d5e0281fe5ab53d184b841b13f27a9e1ae4cc81786ef3767b6d32cb659125bf9bc1ed56a1
|
7
|
+
data.tar.gz: 4cd259259f9c11a5ff2acdad7da471b98087e5053529b56ec7e144eb207c3caab547041e8fa3eefbcb7a72e17a961152e6e0ff77fab3a983f72ef8a0083ac6d0
|
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.11"
|
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,9 +1865,6 @@ module EDNGRAMMAR
|
|
1865
1865
|
end
|
1866
1866
|
|
1867
1867
|
module Rawstring0
|
1868
|
-
end
|
1869
|
-
|
1870
|
-
module Rawstring1
|
1871
1868
|
def startrawdelim
|
1872
1869
|
elements[0]
|
1873
1870
|
end
|
@@ -1881,12 +1878,11 @@ module EDNGRAMMAR
|
|
1881
1878
|
end
|
1882
1879
|
end
|
1883
1880
|
|
1884
|
-
module
|
1881
|
+
module Rawstring1
|
1885
1882
|
def ast; rawcontent.text_value.gsub("\r", "") + (
|
1886
1883
|
tv = matchrawdelim.text_value
|
1887
1884
|
dv = startrawdelim.text_value.length
|
1888
|
-
tv[dv..]
|
1889
|
-
) end
|
1885
|
+
tv[dv..]) end
|
1890
1886
|
end
|
1891
1887
|
|
1892
1888
|
def _nt_rawstring
|
@@ -1904,37 +1900,7 @@ module EDNGRAMMAR
|
|
1904
1900
|
r1 = _nt_startrawdelim
|
1905
1901
|
s0 << r1
|
1906
1902
|
if r1
|
1907
|
-
|
1908
|
-
if (match_len = has_terminal?("\r", false, index))
|
1909
|
-
r5 = true
|
1910
|
-
@index += match_len
|
1911
|
-
else
|
1912
|
-
terminal_parse_failure('"\\r"')
|
1913
|
-
r5 = nil
|
1914
|
-
end
|
1915
|
-
if r5
|
1916
|
-
r4 = r5
|
1917
|
-
else
|
1918
|
-
r4 = instantiate_node(SyntaxNode,input, index...index)
|
1919
|
-
end
|
1920
|
-
s3 << r4
|
1921
|
-
if r4
|
1922
|
-
if (match_len = has_terminal?("\n", false, index))
|
1923
|
-
r6 = true
|
1924
|
-
@index += match_len
|
1925
|
-
else
|
1926
|
-
terminal_parse_failure('"\\n"')
|
1927
|
-
r6 = nil
|
1928
|
-
end
|
1929
|
-
s3 << r6
|
1930
|
-
end
|
1931
|
-
if s3.last
|
1932
|
-
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
1933
|
-
r3.extend(Rawstring0)
|
1934
|
-
else
|
1935
|
-
@index = i3
|
1936
|
-
r3 = nil
|
1937
|
-
end
|
1903
|
+
r3 = _nt_newline
|
1938
1904
|
if r3
|
1939
1905
|
r2 = r3
|
1940
1906
|
else
|
@@ -1942,18 +1908,18 @@ module EDNGRAMMAR
|
|
1942
1908
|
end
|
1943
1909
|
s0 << r2
|
1944
1910
|
if r2
|
1945
|
-
|
1946
|
-
s0 <<
|
1947
|
-
if
|
1948
|
-
|
1949
|
-
s0 <<
|
1911
|
+
r4 = _nt_rawcontent
|
1912
|
+
s0 << r4
|
1913
|
+
if r4
|
1914
|
+
r5 = _nt_matchrawdelim
|
1915
|
+
s0 << r5
|
1950
1916
|
end
|
1951
1917
|
end
|
1952
1918
|
end
|
1953
1919
|
if s0.last
|
1954
1920
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1921
|
+
r0.extend(Rawstring0)
|
1955
1922
|
r0.extend(Rawstring1)
|
1956
|
-
r0.extend(Rawstring2)
|
1957
1923
|
else
|
1958
1924
|
@index = i0
|
1959
1925
|
r0 = nil
|
@@ -4102,6 +4068,10 @@ module EDNGRAMMAR
|
|
4102
4068
|
def ast; text_value end
|
4103
4069
|
end
|
4104
4070
|
|
4071
|
+
module Escapable16
|
4072
|
+
def ast; "" end
|
4073
|
+
end
|
4074
|
+
|
4105
4075
|
def _nt_escapable1
|
4106
4076
|
start_index = index
|
4107
4077
|
if node_cache[:escapable1].has_key?(index)
|
@@ -4186,8 +4156,16 @@ module EDNGRAMMAR
|
|
4186
4156
|
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
4187
4157
|
r0 = r6
|
4188
4158
|
else
|
4189
|
-
|
4190
|
-
|
4159
|
+
r7 = _nt_newline
|
4160
|
+
r7.extend(Escapable16)
|
4161
|
+
r7.extend(Escapable16)
|
4162
|
+
if r7
|
4163
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
4164
|
+
r0 = r7
|
4165
|
+
else
|
4166
|
+
@index = i0
|
4167
|
+
r0 = nil
|
4168
|
+
end
|
4191
4169
|
end
|
4192
4170
|
end
|
4193
4171
|
end
|
@@ -5997,6 +5975,57 @@ module EDNGRAMMAR
|
|
5997
5975
|
r0
|
5998
5976
|
end
|
5999
5977
|
|
5978
|
+
module Newline0
|
5979
|
+
end
|
5980
|
+
|
5981
|
+
def _nt_newline
|
5982
|
+
start_index = index
|
5983
|
+
if node_cache[:newline].has_key?(index)
|
5984
|
+
cached = node_cache[:newline][index]
|
5985
|
+
if cached
|
5986
|
+
node_cache[:newline][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5987
|
+
@index = cached.interval.end
|
5988
|
+
end
|
5989
|
+
return cached
|
5990
|
+
end
|
5991
|
+
|
5992
|
+
i0, s0 = index, []
|
5993
|
+
if (match_len = has_terminal?("\r", false, index))
|
5994
|
+
r2 = true
|
5995
|
+
@index += match_len
|
5996
|
+
else
|
5997
|
+
terminal_parse_failure('"\\r"')
|
5998
|
+
r2 = nil
|
5999
|
+
end
|
6000
|
+
if r2
|
6001
|
+
r1 = r2
|
6002
|
+
else
|
6003
|
+
r1 = instantiate_node(SyntaxNode,input, index...index)
|
6004
|
+
end
|
6005
|
+
s0 << r1
|
6006
|
+
if r1
|
6007
|
+
if (match_len = has_terminal?("\n", false, index))
|
6008
|
+
r3 = true
|
6009
|
+
@index += match_len
|
6010
|
+
else
|
6011
|
+
terminal_parse_failure('"\\n"')
|
6012
|
+
r3 = nil
|
6013
|
+
end
|
6014
|
+
s0 << r3
|
6015
|
+
end
|
6016
|
+
if s0.last
|
6017
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
6018
|
+
r0.extend(Newline0)
|
6019
|
+
else
|
6020
|
+
@index = i0
|
6021
|
+
r0 = nil
|
6022
|
+
end
|
6023
|
+
|
6024
|
+
node_cache[:newline][start_index] = r0
|
6025
|
+
|
6026
|
+
r0
|
6027
|
+
end
|
6028
|
+
|
6000
6029
|
def _nt_DQUOTE
|
6001
6030
|
start_index = index
|
6002
6031
|
if node_cache[:DQUOTE].has_key?(index)
|