line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pegex::Drinkup::Data; |
2
|
2
|
|
|
2
|
|
11
|
use Pegex::Base; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
3
|
|
|
|
|
|
|
extends 'Pegex::Tree'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my $data; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub initial { |
8
|
1
|
|
|
1
|
1
|
1579
|
$data = {}; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub got_cocktail { |
12
|
1
|
|
|
1
|
0
|
129
|
$data->{name} = $_[1]; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub got_description { |
16
|
1
|
|
|
1
|
0
|
94
|
$data->{description} = $_[1]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub got_instructions { |
20
|
1
|
|
|
1
|
0
|
351
|
$data->{instructions} = $_[1]; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub got_ingredients { |
24
|
4
|
|
|
|
|
20
|
$data->{ingredients} = [ |
25
|
|
|
|
|
|
|
map { |
26
|
1
|
|
|
|
|
3
|
my $ingredient = { |
27
|
|
|
|
|
|
|
amount => 0 + $_->[0], |
28
|
|
|
|
|
|
|
unit => $_->[1], |
29
|
|
|
|
|
|
|
ingredient => $_->[2], |
30
|
|
|
|
|
|
|
}; |
31
|
4
|
100
|
|
|
|
12
|
$ingredient->{note} = $_->[3] if $_->[3]; |
32
|
4
|
|
|
|
|
14
|
$ingredient; |
33
|
1
|
|
|
1
|
0
|
2043
|
} @{$_[1]} |
34
|
|
|
|
|
|
|
]; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub got_metadata { |
38
|
1
|
|
|
1
|
0
|
201
|
$data->{lc $_[1]->[0]} = $_[1]->[1] |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub final { |
42
|
1
|
|
|
1
|
1
|
116
|
return $data; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |