abnftt 0.2.9 → 0.2.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/abnftt.gemspec +1 -1
- data/lib/abnfgrammar.rb +85 -18
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce0bd11b56d3a9d3c55db976ef351ec25268dd76ec2a6871c8871e4d8346af6f
|
|
4
|
+
data.tar.gz: 163ecb90fd7b1c67671e471566e8e0d4d41c896ffe81a6035b4b6240cd701a28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbecedf01cdb747a8ac4d3f85924b68b55466c82b73e980a168b7b73017c75b6c7b33b5690db2ffe0f30ee51872cc67f960a214308d8f15e568be8695c2fef46
|
|
7
|
+
data.tar.gz: c56a18742093e06f885884a24480b349115b0392573206d319c9170bd1e9723cf9db4e1fbe6e94419bbb9718e4040d2077498d4e16192606772959ff6b32bec0
|
data/abnftt.gemspec
CHANGED
data/lib/abnfgrammar.rb
CHANGED
|
@@ -2530,10 +2530,26 @@ module ABNFGrammar
|
|
|
2530
2530
|
end
|
|
2531
2531
|
|
|
2532
2532
|
module InlineModule0
|
|
2533
|
-
def
|
|
2533
|
+
def inline_module1
|
|
2534
|
+
elements[1]
|
|
2535
|
+
end
|
|
2534
2536
|
end
|
|
2535
2537
|
|
|
2536
2538
|
module InlineModule1
|
|
2539
|
+
def ast_wrap(a) ["im", a, text_value] end
|
|
2540
|
+
end
|
|
2541
|
+
|
|
2542
|
+
module InlineModule2
|
|
2543
|
+
def rulename
|
|
2544
|
+
elements[1]
|
|
2545
|
+
end
|
|
2546
|
+
end
|
|
2547
|
+
|
|
2548
|
+
module InlineModule3
|
|
2549
|
+
def ast_wrap(a) ["im", a, text_value] end
|
|
2550
|
+
end
|
|
2551
|
+
|
|
2552
|
+
module InlineModule4
|
|
2537
2553
|
def ast_wrap(a) a end
|
|
2538
2554
|
end
|
|
2539
2555
|
|
|
@@ -2549,27 +2565,76 @@ module ABNFGrammar
|
|
|
2549
2565
|
end
|
|
2550
2566
|
|
|
2551
2567
|
i0 = index
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2568
|
+
i1, s1 = index, []
|
|
2569
|
+
if (match_len = has_terminal?('&', false, index))
|
|
2570
|
+
r3 = true
|
|
2571
|
+
@index += match_len
|
|
2572
|
+
else
|
|
2573
|
+
terminal_parse_failure('\'&\'')
|
|
2574
|
+
r3 = nil
|
|
2575
|
+
end
|
|
2576
|
+
if r3
|
|
2577
|
+
r2 = r3
|
|
2578
|
+
else
|
|
2579
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
|
2580
|
+
end
|
|
2581
|
+
s1 << r2
|
|
2582
|
+
if r2
|
|
2583
|
+
r4 = _nt_inline_module1
|
|
2584
|
+
s1 << r4
|
|
2585
|
+
end
|
|
2586
|
+
if s1.last
|
|
2587
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
2588
|
+
r1.extend(InlineModule0)
|
|
2589
|
+
r1.extend(InlineModule1)
|
|
2590
|
+
else
|
|
2591
|
+
@index = i1
|
|
2592
|
+
r1 = nil
|
|
2593
|
+
end
|
|
2555
2594
|
if r1
|
|
2556
2595
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
2557
2596
|
r0 = r1
|
|
2558
2597
|
else
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
@index +=
|
|
2598
|
+
i5, s5 = index, []
|
|
2599
|
+
if has_terminal?(@regexps[gr = '\A[&!]'] ||= Regexp.new(gr), :regexp, index)
|
|
2600
|
+
r6 = true
|
|
2601
|
+
@index += 1
|
|
2563
2602
|
else
|
|
2564
|
-
terminal_parse_failure('
|
|
2565
|
-
|
|
2603
|
+
terminal_parse_failure('[&!]')
|
|
2604
|
+
r6 = nil
|
|
2566
2605
|
end
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2606
|
+
s5 << r6
|
|
2607
|
+
if r6
|
|
2608
|
+
r7 = _nt_rulename
|
|
2609
|
+
s5 << r7
|
|
2610
|
+
end
|
|
2611
|
+
if s5.last
|
|
2612
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
2613
|
+
r5.extend(InlineModule2)
|
|
2614
|
+
r5.extend(InlineModule3)
|
|
2570
2615
|
else
|
|
2571
|
-
@index =
|
|
2572
|
-
|
|
2616
|
+
@index = i5
|
|
2617
|
+
r5 = nil
|
|
2618
|
+
end
|
|
2619
|
+
if r5
|
|
2620
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
2621
|
+
r0 = r5
|
|
2622
|
+
else
|
|
2623
|
+
if (match_len = has_terminal?('', false, index))
|
|
2624
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
|
2625
|
+
r8.extend(InlineModule4)
|
|
2626
|
+
@index += match_len
|
|
2627
|
+
else
|
|
2628
|
+
terminal_parse_failure('\'\'')
|
|
2629
|
+
r8 = nil
|
|
2630
|
+
end
|
|
2631
|
+
if r8
|
|
2632
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
|
2633
|
+
r0 = r8
|
|
2634
|
+
else
|
|
2635
|
+
@index = i0
|
|
2636
|
+
r0 = nil
|
|
2637
|
+
end
|
|
2573
2638
|
end
|
|
2574
2639
|
end
|
|
2575
2640
|
|
|
@@ -2578,10 +2643,12 @@ module ABNFGrammar
|
|
|
2578
2643
|
r0
|
|
2579
2644
|
end
|
|
2580
2645
|
|
|
2581
|
-
end
|
|
2582
2646
|
|
|
2583
|
-
class
|
|
2584
|
-
|
|
2647
|
+
class Parser < Treetop::Runtime::CompiledParser
|
|
2648
|
+
include ABNFGrammar
|
|
2649
|
+
end
|
|
2585
2650
|
end
|
|
2586
2651
|
|
|
2652
|
+
(remove_const(:ABNFGrammarParser) if const_defined?(:ABNFGrammarParser)) rescue nil; ABNFGrammarParser = ABNFGrammar::Parser
|
|
2653
|
+
|
|
2587
2654
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carsten Bormann
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Less shifty support for tools based on IETF's ABNF
|
|
14
13
|
email: cabo@tzi.org
|
|
@@ -34,7 +33,6 @@ homepage: http://github.com/cabo/abnftt
|
|
|
34
33
|
licenses:
|
|
35
34
|
- MIT
|
|
36
35
|
metadata: {}
|
|
37
|
-
post_install_message:
|
|
38
36
|
rdoc_options: []
|
|
39
37
|
require_paths:
|
|
40
38
|
- lib
|
|
@@ -49,8 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
49
47
|
- !ruby/object:Gem::Version
|
|
50
48
|
version: '0'
|
|
51
49
|
requirements: []
|
|
52
|
-
rubygems_version:
|
|
53
|
-
signing_key:
|
|
50
|
+
rubygems_version: 4.0.8
|
|
54
51
|
specification_version: 4
|
|
55
52
|
summary: RFC 5234+7405 ABNF to Treetop
|
|
56
53
|
test_files: []
|