abnftt 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/abnftt.gemspec +1 -1
- data/bin/abnftt +1 -1
- data/lib/abnftt.rb +4 -0
- 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: 152ef34be3428f0a7cda4f157ec08a1986f5cf295436be8186ee53d61eddb386
|
4
|
+
data.tar.gz: fdc3504304d4e9c5244dcfce7a2e103e2801d3f6087de307bcd976a099fe0b5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5b786e95c96464bf516e2d6ba00f1363a6a720d0dfd01b83401fef3ade2dc51116fda365881fb770fa9756f0ec71a14e7c6e85e7e3a7bc3589a930e8b9e5381
|
7
|
+
data.tar.gz: '08eb748abf720cfdfe4a742e675e7b5b0144a60cdd2fce90f85783a2b7eac2d856e138f6536394dcccc123e72eb6fa8439b472b1e8ff26fff7630938445b2316'
|
data/abnftt.gemspec
CHANGED
data/bin/abnftt
CHANGED
@@ -24,7 +24,7 @@ if ast
|
|
24
24
|
end
|
25
25
|
# pp ast.ast
|
26
26
|
File.open("#{outfn}.treetop", "w") do |f|
|
27
|
-
modname = File.basename(outfn).gsub("-", "_").gsub(/[^_a-zA-
|
27
|
+
modname = File.basename(outfn).gsub("-", "_").gsub(/[^_a-zA-Z0-9]/, "").upcase
|
28
28
|
f.puts abnf.to_treetop(modname)
|
29
29
|
end
|
30
30
|
File.open("#{outfn}.abnf", "w") do |f|
|
data/lib/abnftt.rb
CHANGED
@@ -143,6 +143,7 @@ class ABNF
|
|
143
143
|
FIXUP_NAMES = Hash.new {|h, k| k}
|
144
144
|
FIXUP_NAMES.merge!({
|
145
145
|
"rule" => "r__rule",
|
146
|
+
"end" => "r__end",
|
146
147
|
})
|
147
148
|
def to_treetop1(ast)
|
148
149
|
case ast
|
@@ -156,6 +157,9 @@ class ABNF
|
|
156
157
|
"(#{ast[1..-1].map {|x| to_treetop1(x)}.join(" ")})"
|
157
158
|
when "rep" # ["rep", s, e, a]
|
158
159
|
t = to_treetop1(ast[3]) || "@@@"
|
160
|
+
if ast[3][0] == "rep"
|
161
|
+
t = "(#{t})"
|
162
|
+
end
|
159
163
|
case [ast[1], ast[2]]
|
160
164
|
when [0, 1]
|
161
165
|
t + "?"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abnftt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Less shifty support for tools based on IETF's ABNF
|
14
14
|
email: cabo@tzi.org
|
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
|
-
rubygems_version: 3.
|
45
|
+
rubygems_version: 3.4.10
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
48
|
summary: RFC 5234+7405 ABNF to Treetop
|