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 +4 -4
- data/abnftt.gemspec +1 -1
- data/lib/abnftt/abnf-util.rb +23 -0
- 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: 1e6933b3f5ea91221735a98fe3546dd85b0f6518f7c9d679b05a2cb110da886d
|
4
|
+
data.tar.gz: f4a5e5a932367c09c0d50fd07e06880917b5cac56a3ff0414e7a1660a97f21dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c2ee28b5a7d49da94691310541782e4e227432f1c1cd5690b0cccd48dad6c4c2d0cfb4a113784fb043bab1ca95c8569b10c315483abe05b59fd58d8a26a4197
|
7
|
+
data.tar.gz: f9ba70bcc72a526da42c94917ca21a768479e5de8127982c5d61c832901a7ff9868285d63bbd23fb4c8fee6c9e0f2cfbf09a708da47b5f982461ea613e76c2a4
|
data/abnftt.gemspec
CHANGED
data/lib/abnftt/abnf-util.rb
CHANGED
@@ -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
|