abnftt 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/abnftt.gemspec +1 -1
  3. data/bin/abnftt +1 -1
  4. data/lib/abnftt.rb +3 -0
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 570c4b52d32529e01e86cd980a4d4b37f2c8ee3d569e57975969ce0386c84f60
4
- data.tar.gz: af8040ce889b4ba98ac0c08cc6a5325d8d19ccca70bbd2669c7d75607963ab1d
3
+ metadata.gz: 152ef34be3428f0a7cda4f157ec08a1986f5cf295436be8186ee53d61eddb386
4
+ data.tar.gz: fdc3504304d4e9c5244dcfce7a2e103e2801d3f6087de307bcd976a099fe0b5d
5
5
  SHA512:
6
- metadata.gz: 5d373e24d098491ad7effef16260512c6f0983cdf30d9a0e9f4ba92577f346d789579ff4f820686c4f39b5d7f49ee8daebea4164ef05b11c01f211a71d6bf656
7
- data.tar.gz: 86f1c1c0d4333922b2e865f19975da937ff50064e3dbda666e8340b61f788d3fda137005c7f5ab7be3b09418754b40b32d7865d80b245787baa15a076a8fca06
6
+ metadata.gz: e5b786e95c96464bf516e2d6ba00f1363a6a720d0dfd01b83401fef3ade2dc51116fda365881fb770fa9756f0ec71a14e7c6e85e7e3a7bc3589a930e8b9e5381
7
+ data.tar.gz: '08eb748abf720cfdfe4a742e675e7b5b0144a60cdd2fce90f85783a2b7eac2d856e138f6536394dcccc123e72eb6fa8439b472b1e8ff26fff7630938445b2316'
data/abnftt.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "abnftt"
3
- s.version = "0.2.3"
3
+ s.version = "0.2.4"
4
4
  s.summary = "RFC 5234+7405 ABNF to Treetop"
5
5
  s.description = %q{Less shifty support for tools based on IETF's ABNF}
6
6
  s.author = "Carsten Bormann"
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-Z]/, "").upcase
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
@@ -157,6 +157,9 @@ class ABNF
157
157
  "(#{ast[1..-1].map {|x| to_treetop1(x)}.join(" ")})"
158
158
  when "rep" # ["rep", s, e, a]
159
159
  t = to_treetop1(ast[3]) || "@@@"
160
+ if ast[3][0] == "rep"
161
+ t = "(#{t})"
162
+ end
160
163
  case [ast[1], ast[2]]
161
164
  when [0, 1]
162
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.3
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: 2023-01-13 00:00:00.000000000 Z
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.4.2
45
+ rubygems_version: 3.4.10
46
46
  signing_key:
47
47
  specification_version: 4
48
48
  summary: RFC 5234+7405 ABNF to Treetop