File Coverage

blib/lib/Pegex/Drinkup/Grammar.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 11 11 100.0


line stmt bran cond sub pod time code
1             package Pegex::Drinkup::Grammar;
2 2     2   13 use base Pegex::Grammar;
  2         5  
  2         1294  
3              
4 2     2   9387 use constant file => 'share/drinkup.pgx';
  2         6  
  2         2135  
5              
6             sub make_tree { # Generated/Inlined by Pegex::Grammar (0.55)
7             {
8 1     1 1 276 '+grammar' => 'drinkup',
9             '+toprule' => 'recipe',
10             '+version' => '0.0.1',
11             'cocktail' => {
12             '.rgx' => qr/\G(?:\s*\r?\n)?(\S.*?)\s*\r?\n/
13             },
14             'description' => {
15             '.rgx' => qr/\G([\s\S]*?)(?=\r?\n[\ \t]*\*)\s*/
16             },
17             'footers' => {
18             '+min' => 1,
19             '.ref' => 'metadata'
20             },
21             'ingredient' => {
22             '.all' => [
23             {
24             '.rgx' => qr/\G\ *\*\ */
25             },
26             {
27             '.ref' => 'number'
28             },
29             {
30             '.rgx' => qr/\G\ */
31             },
32             {
33             '.ref' => 'unit'
34             },
35             {
36             '.rgx' => qr/\G\ */
37             },
38             {
39             '.ref' => 'name'
40             },
41             {
42             '.rgx' => qr/\G\ *\r?\n/
43             },
44             {
45             '+max' => 1,
46             '.ref' => 'note'
47             }
48             ]
49             },
50             'ingredients' => {
51             '+min' => 1,
52             '.ref' => 'ingredient'
53             },
54             'instructions' => {
55             '.rgx' => qr/\G([\s\S]*)(?=\r?\n[0-9A-Za-z_\s*]+:)\s*/
56             },
57             'metadata' => {
58             '.rgx' => qr/\G([0-9A-Za-z_\s*]+):\ *(.+?)\s*\r?\n/
59             },
60             'name' => {
61             '.rgx' => qr/\G(.+?)\s*(?=\r?\n)/
62             },
63             'note' => {
64             '.rgx' => qr/\G\#\ *(.+?)\ *\r?\n/
65             },
66             'number' => {
67             '.rgx' => qr/\G((?:0|[1-9][0-9]*)?(?:\.[0-9]+)?(?:\s*\+?\s*[0-9]+\s*\/\s*[0-9]+)?)/
68             },
69             'recipe' => {
70             '.all' => [
71             {
72             '.ref' => 'cocktail'
73             },
74             {
75             '.ref' => 'description'
76             },
77             {
78             '.ref' => 'ingredients'
79             },
80             {
81             '.ref' => 'instructions'
82             },
83             {
84             '.ref' => 'footers'
85             }
86             ]
87             },
88             'unit' => {
89             '.rgx' => qr/\G(\w+)(?:\s*of)?/
90             }
91             }
92             }
93              
94             1;