line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Solitaire::Verify::State::LaxParser; |
2
|
|
|
|
|
|
|
$Games::Solitaire::Verify::State::LaxParser::VERSION = '0.2401'; |
3
|
3
|
|
|
3
|
|
582
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
131
|
|
4
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
72
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
16
|
use parent 'Games::Solitaire::Verify::State'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
17
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _from_string |
10
|
|
|
|
|
|
|
{ |
11
|
6
|
|
|
6
|
|
52
|
my ( $self, $str ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
|
|
14
|
my $rank_re = '[0A1-9TJQK]'; |
14
|
|
|
|
|
|
|
|
15
|
6
|
|
|
|
|
12
|
my $founds_s; |
16
|
6
|
100
|
|
|
|
55
|
if ( $str =~ m{\A(Foundations:[^\n]*)\n}cgms ) |
17
|
|
|
|
|
|
|
{ |
18
|
3
|
|
|
|
|
11
|
$founds_s = $1; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else |
21
|
|
|
|
|
|
|
{ |
22
|
3
|
|
|
|
|
7
|
$founds_s = "Foundations: H-0 C-0 D-0 S-0"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
6
|
|
|
|
|
33
|
$self->set_foundations( |
26
|
|
|
|
|
|
|
Games::Solitaire::Verify::Foundations->new( |
27
|
|
|
|
|
|
|
{ |
28
|
|
|
|
|
|
|
num_decks => $self->num_decks(), |
29
|
|
|
|
|
|
|
string => $founds_s, |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
) |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
6
|
|
|
|
|
18
|
my $fc = 'Freecells:'; |
35
|
6
|
100
|
|
|
|
33
|
if ( $str =~ m{\G(Freecells:[^\n]*)\n}cgms ) |
36
|
|
|
|
|
|
|
{ |
37
|
3
|
|
|
|
|
9
|
$fc = $1; |
38
|
|
|
|
|
|
|
} |
39
|
6
|
|
|
|
|
97
|
$self->_assign_freecells_from_string($fc); |
40
|
|
|
|
|
|
|
|
41
|
6
|
|
|
|
|
26
|
foreach my $col_idx ( 0 .. ( $self->num_columns() - 1 ) ) |
42
|
|
|
|
|
|
|
{ |
43
|
48
|
50
|
|
|
|
252
|
if ( $str !~ m{\G([^\n]*)\n}msg ) |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
0
|
Games::Solitaire::Verify::Exception::Parse::State::Column->throw( |
46
|
|
|
|
|
|
|
error => "Cannot parse column", |
47
|
|
|
|
|
|
|
index => $col_idx, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
48
|
|
|
|
|
140
|
my $column_str = $1; |
51
|
48
|
100
|
|
|
|
125
|
if ( $column_str !~ /\A:/ ) |
52
|
|
|
|
|
|
|
{ |
53
|
24
|
|
|
|
|
85
|
$column_str =~ s/\A\s*/: /; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
$self->add_column( |
57
|
48
|
|
|
|
|
190
|
Games::Solitaire::Verify::Column->new( |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
string => $column_str, |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
) |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
6
|
|
|
|
|
33
|
return; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; # End of Games::Solitaire::Verify::State |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |