abnftt 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 436afd21fea00a7369bf5dfdfdcc0a61b33ee0b14f482a6d1c00488a520c93c1
4
- data.tar.gz: 93cb2255e048e4482c4245e9beb6bf635a79b253124359a8c0debbd2abb204b2
3
+ metadata.gz: 1e6933b3f5ea91221735a98fe3546dd85b0f6518f7c9d679b05a2cb110da886d
4
+ data.tar.gz: f4a5e5a932367c09c0d50fd07e06880917b5cac56a3ff0414e7a1660a97f21dd
5
5
  SHA512:
6
- metadata.gz: '09621b3970222f8de758894c6fa6c58821fca89980612234ca31cdedae11fcc1c2c9b2e1fd9edb873865169b640926e049388888a82da7baa4b1dfa972f37dde'
7
- data.tar.gz: 4f77b32132f12ae7a2f6c91b250df5213fdb386c21ecd6fe02c6470115be7996448eefbd94f0e9cd833cc446a7a451c7ff65567069cd15695e6093c11505bd43
6
+ metadata.gz: 9c2ee28b5a7d49da94691310541782e4e227432f1c1cd5690b0cccd48dad6c4c2d0cfb4a113784fb043bab1ca95c8569b10c315483abe05b59fd58d8a26a4197
7
+ data.tar.gz: f9ba70bcc72a526da42c94917ca21a768479e5de8127982c5d61c832901a7ff9868285d63bbd23fb4c8fee6c9e0f2cfbf09a708da47b5f982461ea613e76c2a4
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.7"
3
+ s.version = "0.2.8"
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"
@@ -372,6 +372,29 @@ class ABNF
372
372
  name = "x#{l}#{r}"
373
373
  rules[name] ||= here
374
374
  [true, name]
375
+ in ["seq", ["cs", "\\u"], *rest]
376
+ suff = "0"
377
+ case rest
378
+ in [["alt", [/^c./, hex], *], *]
379
+ name = "u-#{hex}"
380
+ while rules[name] && rules[name] != here
381
+ name = "u-#{hex}-#{suff.succ!}"
382
+ end
383
+ in [["alt", ["seq", [/^c./, hex], *], *], *]
384
+ name = "u-#{hex}x"
385
+ while rules[name] && rules[name] != here
386
+ name = "u-#{hex}x-#{suff.succ!}"
387
+ end
388
+ else
389
+ # require 'neatjson'
390
+ # warn ::JSON.neat_generate(here)
391
+ name = "u-#{suff.succ!}"
392
+ while rules[name] && rules[name] != here
393
+ name = "u-#{suff.succ!}"
394
+ end
395
+ end
396
+ rules[name] ||= here
397
+ [true, name]
375
398
  else
376
399
  false
377
400
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abnftt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann