line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Solitaire::Verify::State::LaxParser; |
2
|
|
|
|
|
|
|
$Games::Solitaire::Verify::State::LaxParser::VERSION = '0.2402'; |
3
|
3
|
|
|
3
|
|
540
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
159
|
|
4
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
79
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
24
|
use parent 'Games::Solitaire::Verify::State'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
21
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _from_string |
10
|
|
|
|
|
|
|
{ |
11
|
6
|
|
|
6
|
|
18
|
my ( $self, $str ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
|
|
15
|
my $rank_re = '[0A1-9TJQK]'; |
14
|
|
|
|
|
|
|
|
15
|
6
|
|
|
|
|
46
|
my $founds_s; |
16
|
6
|
100
|
|
|
|
35
|
if ( $str =~ m{\A(Foundations:[^\n]*)\n}cgms ) |
17
|
|
|
|
|
|
|
{ |
18
|
3
|
|
|
|
|
14
|
$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
|
|
|
|
|
61
|
$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
|
|
|
|
|
26
|
my $fc = 'Freecells:'; |
35
|
6
|
100
|
|
|
|
32
|
if ( $str =~ m{\G(Freecells:[^\n]*)\n}cgms ) |
36
|
|
|
|
|
|
|
{ |
37
|
3
|
|
|
|
|
10
|
$fc = $1; |
38
|
|
|
|
|
|
|
} |
39
|
6
|
|
|
|
|
125
|
$self->_assign_freecells_from_string($fc); |
40
|
|
|
|
|
|
|
|
41
|
6
|
|
|
|
|
31
|
foreach my $col_idx ( 0 .. ( $self->num_columns() - 1 ) ) |
42
|
|
|
|
|
|
|
{ |
43
|
48
|
50
|
|
|
|
277
|
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
|
|
|
|
|
137
|
my $column_str = $1; |
51
|
48
|
100
|
|
|
|
135
|
if ( $column_str !~ /\A:/ ) |
52
|
|
|
|
|
|
|
{ |
53
|
24
|
|
|
|
|
84
|
$column_str =~ s/\A\s*/: /; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
$self->add_column( |
57
|
48
|
|
|
|
|
194
|
Games::Solitaire::Verify::Column->new( |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
string => $column_str, |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
) |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
6
|
|
|
|
|
35
|
return; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; # End of Games::Solitaire::Verify::State |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |