| 1 | package Lingua::SoundChange; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use 5.005_03; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | # use warnings; | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | # for debugging: | ||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use constant PRINT_RULES => $ENV{LINGUA_SOUNDCHANGE_PRINTRULES} || 0; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.1
Condition50%1/2
$ENV{'LINGUA_SOUNDCHANGE_PRINTRULES'} || 0
MC/DC0%0/1
$ENV{'LINGUA_SOUNDCHANGE_PRINTRULES'} || 0
$ENV{'LINGUA_SOUNDCHANGE_PRINTRULES'}
Truth table50%1/2
A
A= $ENV{'LINGUA_SOUNDCHANGE_PRINTRULES'}
| |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use constant DEBUG => 0; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | $VERSION = '0.05'; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | sub compile_rules($$$$); | ||||||||||||||||||||||||||||
| 16 | sub compile_vars($$); | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 22 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | 22 | my($class, $vars, $rules, $opts) = @_; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 22 | ▶ | $opts ||= { }; | ||||||||||||||||||||||||||
|
Condition100%2/2
$opts ||= {}
MC/DC100%1/1
$opts ||= {}
$opts
Truth table100%2/2
A
A= $opts
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 22 | ▶ | croak '$vars must be a hash reference!' unless ref $vars eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 22 | ▶ | croak '$rules must be an array reference!' unless ref $rules eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 22 | my $obj = { | |||||||||||||||||||||||||||
| 27 | raw_vars => $vars, | ||||||||||||||||||||||||||||
| 28 | raw_rules => $rules, | ||||||||||||||||||||||||||||
| 29 | opts => $opts, | ||||||||||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 22 | $obj->{vars} = compile_vars($vars, $opts); | |||||||||||||||||||||||||||
| 33 | 22 | ▶ | if($opts->{longVars}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 6 | $obj->{raw_vars}->{"\Q<$_>\E"} = $vars->{$_} for keys %$vars; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | ( $obj->{rules}, | ||||||||||||||||||||||||||||
| 37 | 22 | $obj->{code} ) = compile_rules($rules, $obj->{vars}, $obj->{raw_vars}, $opts); | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 22 | bless $obj, $class; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 22 | ▶ | sub change { | ||||||||||||||||||||||||||
|
Subroutine
change: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 22 | my($self, $words) = @_; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 22 | ▶ | $words = [] unless defined $words; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 22 | ▶ | croak("change needs an array reference") unless ref($words) eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 22 | foreach my $word (@$words) { | |||||||||||||||||||||||||||
| 50 | 54 | my $origword = $word; | |||||||||||||||||||||||||||
| 51 | 54 | my @rules; | |||||||||||||||||||||||||||
| 52 | my $ruleout; | ||||||||||||||||||||||||||||
| 53 | 54 | foreach my $rule (@{$self->rules}) { | |||||||||||||||||||||||||||
| 54 | 168 | ($word, $ruleout) = $rule->($word); | |||||||||||||||||||||||||||
| 55 | 168 | ▶ | push @rules, $ruleout if defined $ruleout; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 54 | $word = { orig => $origword, word => $word, rules => \@rules }; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 22 | $words; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | # Private methods | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 22 | ▶ | sub compile_rules ($$$$) { | ||||||||||||||||||||||||||
|
Subroutine
compile_rules: called CC=20 SCAR=31.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 68 | 22 | my($rules, $vars, $varstring, $opt) = @_; | |||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 22 | ▶ | croak "rules not an array reference" unless ref $rules eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | 22 | ▶ | croak "vars not a hash reference" unless ref $vars eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 72 | 22 | ▶ | croak "varstring not a hash reference" unless ref $varstring eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | 22 | ▶ | croak "opt not a hash reference" unless ref $opt eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 22 | my @compiledrules; | |||||||||||||||||||||||||||
| 76 | my %code; | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | # Rules: change from a sound (one or more letters) or a category | ||||||||||||||||||||||||||||
| 79 | # to another sound or category, in a certain environment. | ||||||||||||||||||||||||||||
| 80 | # Categories may only be one letter long and are usually uppercase. | ||||||||||||||||||||||||||||
| 81 | # Environments must contain a _ symbol to show where the replacement | ||||||||||||||||||||||||||||
| 82 | # takes place; it may also contain letters, categories, and the special | ||||||||||||||||||||||||||||
| 83 | # symbols ( ) (to enclose optional parts) and # (beginning or end of | ||||||||||||||||||||||||||||
| 84 | # word). | ||||||||||||||||||||||||||||
| 85 | # Rules can only change sounds to sounds, and categories to categories. | ||||||||||||||||||||||||||||
| 86 | # If a category is to be changed to another category, they should be | ||||||||||||||||||||||||||||
| 87 | # the same length. Otherwise the second category will have its laster | ||||||||||||||||||||||||||||
| 88 | # letter repeated until it has the same length as the first (if it is | ||||||||||||||||||||||||||||
| 89 | # shorter), or characters in the second category that don't match | ||||||||||||||||||||||||||||
| 90 | # characters in the first will not be produced by such a range. Note | ||||||||||||||||||||||||||||
| 91 | # that this is an artefact of the use of tr/// and is not guaranteed | ||||||||||||||||||||||||||||
| 92 | # behaviour. | ||||||||||||||||||||||||||||
| 93 | # Don't use regex metacharacters (except for the parentheses which | ||||||||||||||||||||||||||||
| 94 | # show optional elements) in the environment or in names of categories | ||||||||||||||||||||||||||||
| 95 | # or sounds. | ||||||||||||||||||||||||||||
| 96 | # These include: . * + ? ^ $ [ ] | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 22 | foreach my $rule (@$rules) { | |||||||||||||||||||||||||||
| 99 | 40 | ▶ | if( $rule =~ m{ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | ^ | ||||||||||||||||||||||||||||
| 101 | ( [^/]+ ) # "change from" to $1 | ||||||||||||||||||||||||||||
| 102 | / # slash | ||||||||||||||||||||||||||||
| 103 | ( [^/]* ) # "change to" to $2 (may be blank) | ||||||||||||||||||||||||||||
| 104 | / # slash | ||||||||||||||||||||||||||||
| 105 | ( .+ ) # "environment" to $3 (may not be blank) | ||||||||||||||||||||||||||||
| 106 | $ | ||||||||||||||||||||||||||||
| 107 | }x ) | ||||||||||||||||||||||||||||
| 108 | { | ||||||||||||||||||||||||||||
| 109 | 40 | my($from, $to, $env) = ($1, $2, $3); | |||||||||||||||||||||||||||
| 110 | 40 | my($subfrom, $subto) = ('', ''); | |||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 80 | ▶ | my $option = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.4
| |||||||||||||||||||||||||||||
| 113 | 80 | my $word = shift; | |||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | # Change parentheses round one element to a question | ||||||||||||||||||||||||||||
| 116 | # mark following it, ... | ||||||||||||||||||||||||||||
| 117 | 80 | $word =~ s{ | |||||||||||||||||||||||||||
| 118 | \( # open parenthesis | ||||||||||||||||||||||||||||
| 119 | (.) # one character, to $1 | ||||||||||||||||||||||||||||
| 120 | \) # close parenthesis | ||||||||||||||||||||||||||||
| 121 | }{ | ||||||||||||||||||||||||||||
| 122 | 0 | $1 . '?' | |||||||||||||||||||||||||||
| 123 | }gex; | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | # ... and parentheses around multiple elements by | ||||||||||||||||||||||||||||
| 126 | # non-capturing parentheses followed by a question mark | ||||||||||||||||||||||||||||
| 127 | # (but nested parentheses are not allowed!) | ||||||||||||||||||||||||||||
| 128 | 80 | $word =~ s{ | |||||||||||||||||||||||||||
| 129 | \( # open parenthesis | ||||||||||||||||||||||||||||
| 130 | ( [^()]+ ) # one or more non-parenthesis characters, | ||||||||||||||||||||||||||||
| 131 | # to $1 | ||||||||||||||||||||||||||||
| 132 | \) # close parenthesis | ||||||||||||||||||||||||||||
| 133 | }{ | ||||||||||||||||||||||||||||
| 134 | 0 | '(?:' . $1 . ')?' | |||||||||||||||||||||||||||
| 135 | }gex; | ||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||
| 137 | 80 | $word; | |||||||||||||||||||||||||||
| 138 | 40 | }; | |||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | # Escape dollar signs and at signs in $env, which would | ||||||||||||||||||||||||||||
| 141 | # otherwise try to interpolate a variable into the regular | ||||||||||||||||||||||||||||
| 142 | # expression | ||||||||||||||||||||||||||||
| 143 | 40 | $env =~ s/([\$\@])/\\$1/g; | |||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | # Get the bits before and after the underscore | ||||||||||||||||||||||||||||
| 146 | # and put them in capturing parentheses in $subfrom | ||||||||||||||||||||||||||||
| 147 | 40 | ▶ | if($env =~ /^(#?)([^_#]*)(_)([^_#]*)(#?)$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 148 | # leading # | ||||||||||||||||||||||||||||
| 149 | 40 | ▶ | $subfrom .= '^' if defined $1 && length $1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $1 and length $1
MC/DC50%1/2
defined $1 and length $1
defined $1
length $1
Truth table66%2/3
A and B
A= defined $1B= length $1
| |||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | # preceding stuff, so we don't need $` | ||||||||||||||||||||||||||||
| 152 | # non-greedy | ||||||||||||||||||||||||||||
| 153 | # If match anchored at beginning, don't add this | ||||||||||||||||||||||||||||
| 154 | 40 | ▶ | if(defined $1 && length $1) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $1 and length $1
MC/DC50%1/2
defined $1 and length $1
defined $1
length $1
Truth table66%2/3
A and B
A= defined $1B= length $1
| |||||||||||||||||||||||||||||
| 155 | 1 | $subfrom .= '()'; | |||||||||||||||||||||||||||
| 156 | } else { | ||||||||||||||||||||||||||||
| 157 | 39 | $subfrom .= '(.*?)'; | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | # pre-environment | ||||||||||||||||||||||||||||
| 161 | 40 | $subfrom .= '(' . $option->(quotemeta $2) . ')'; | |||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | # underscore | ||||||||||||||||||||||||||||
| 164 | 40 | $subfrom .= "(\Q$from\E)"; | |||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | # post-environment | ||||||||||||||||||||||||||||
| 167 | 40 | $subfrom .= '(' . $option->(quotemeta $4) . ')'; | |||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | # trailing # | ||||||||||||||||||||||||||||
| 170 | 40 | ▶ | $subfrom .= '$' if defined $5 && length $5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $5 and length $5
MC/DC50%1/2
defined $5 and length $5
defined $5
length $5
Truth table66%2/3
A and B
A= defined $5B= length $5
| |||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | # Now expand categories | ||||||||||||||||||||||||||||
| 174 | 40 | ▶ | if($opt->{longVars}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 175 | 9 | ▶ | $subfrom =~ s{(\\<[^>]+\\>)}{$vars->{$1} || $1}eg; | ||||||||||||||||||||||||||
|
Condition33%1/3
$vars->{$1} || $1
MC/DC0%0/2
$vars->{$1} || $1
$vars->{$1}
$1
Truth table33%1/3
A || B
A= $vars->{$1}B= $1
| |||||||||||||||||||||||||||||
| 176 | } else { | ||||||||||||||||||||||||||||
| 177 | 31 | ▶ | $subfrom =~ s{(\\?)(.)}{$vars->{$2} || $1 . $2}eg; | ||||||||||||||||||||||||||
|
Condition66%2/3
$vars->{$2} || $1 . $2
MC/DC0%0/2
$vars->{$2} || $1 . $2
$vars->{$2}
$1 . $2
Truth table66%2/3
A || B
A= $vars->{$2}B= $1 . $2
| |||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | # Show where the rule matches | ||||||||||||||||||||||||||||
| 181 | 40 | $subto .= qq(\$rule = "\Q$from\E->\Q$to\E /\Q$env\E applies to \$word at " . (length(\$1)+1) . "\\n"; ); | |||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | 40 | $subto .= '$1 . $2 . '; | |||||||||||||||||||||||||||
| 184 | $subto .= ($vars->{quotemeta $from} | ||||||||||||||||||||||||||||
| 185 | 40 | ▶ | ? "do { my \$char = \$3; \$char =~ tr{$varstring->{quotemeta $from}}{" . ($varstring->{quotemeta $to} || $to) . "}; \$char }" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$varstring{quotemeta $to} || $to
MC/DC0%0/2
$$varstring{quotemeta $to} || $to
$$varstring{quotemeta $to}
$to
Truth table66%2/3
A || B
A= $$varstring{quotemeta $to}B= $to
| |||||||||||||||||||||||||||||
| 186 | : "q{" . $to . "}"); | ||||||||||||||||||||||||||||
| 187 | 40 | $subto .= ' . $4'; | |||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | 40 | if(PRINT_RULES) { | |||||||||||||||||||||||||||
| 190 | print "[", $#compiledrules + 1, "] $rule --> s{$subfrom}{$subto}eg\n"; | ||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | 40 | my $code = <<"EOF"; | |||||||||||||||||||||||||||
| 194 | sub { | ||||||||||||||||||||||||||||
| 195 | my \$word = shift; | ||||||||||||||||||||||||||||
| 196 | my \$rule; | ||||||||||||||||||||||||||||
| 197 | my \$orig; | ||||||||||||||||||||||||||||
| 198 | # print qq(Working on '\$word'; \Q$from\E->\Q$to\E /\Q$env\E; from is '\Q$subfrom\E and to is '\Q$subto\E'\\n); | ||||||||||||||||||||||||||||
| 199 | 1 while ((\$orig = \$word) =~ s{$subfrom}{$subto}e) && (\$orig ne \$word) && (\$word = \$orig); | ||||||||||||||||||||||||||||
| 200 | return ( \$word, \$rule ); | ||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||
| 202 | EOF | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 40 | push @compiledrules, eval $code; | |||||||||||||||||||||||||||
| 205 | 40 | ▶ | croak "Problem with '$code'" unless $compiledrules[-1]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 206 | 40 | $code{$compiledrules[-1]} = $code; | |||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||
| 210 | 22 | ( \@compiledrules, \%code ); | |||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | 22 | ▶ | sub compile_vars ($$) { | ||||||||||||||||||||||||||
|
Subroutine
compile_vars: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 214 | 22 | my($vars, $opt) = @_; | |||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | 22 | ▶ | croak "\$vars is not a hash reference" unless ref $vars eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 217 | 22 | ▶ | croak "\$opt is not a hash reference" unless ref $opt eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 22 | my %compiledvars; | |||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | 22 | foreach my $var (keys %$vars) { | |||||||||||||||||||||||||||
| 222 | 26 | my $list = $vars->{$var}; | |||||||||||||||||||||||||||
| 223 | # Escape at signs and dollars in the list | ||||||||||||||||||||||||||||
| 224 | 26 | $list =~ s/([\$\@])/\\$1/g; | |||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 26 | ▶ | if($opt->{longVars}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 227 | 12 | $compiledvars{"\Q<$var>\E"} = qr/[$list]/; | |||||||||||||||||||||||||||
| 228 | 12 | print qq[($var => $list // $compiledvars{"\Q<$var>\E"})\n] if PRINT_RULES; | |||||||||||||||||||||||||||
| 229 | } else { | ||||||||||||||||||||||||||||
| 230 | 14 | $compiledvars{$var} = qr/[$list]/; | |||||||||||||||||||||||||||
| 231 | 14 | print "($var => $list // $compiledvars{$var})\n" if PRINT_RULES; | |||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | 22 | \%compiledvars; | |||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | 54 | ▶ | sub rules { | ||||||||||||||||||||||||||
|
Subroutine
rules: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 239 | 54 | my($self) = @_; | |||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | 54 | $self->{rules}; | |||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | 0 | ▶ | sub vars { | ||||||||||||||||||||||||||
|
Subroutine
vars: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 245 | 0 | my($self) = @_; | |||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||
| 247 | 0 | $self->{vars}; | |||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||
| 250 | 0 | ▶ | sub varstring { | ||||||||||||||||||||||||||
|
Subroutine
varstring: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 251 | 0 | my($self) = @_; | |||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||
| 253 | 0 | $self->{raw_vars}; | |||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||
| 256 | 0 | ▶ | sub code { | ||||||||||||||||||||||||||
|
Subroutine
code: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 257 | 0 | my($self, $token, $code) = @_; | |||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||
| 259 | 0 | ▶ | $self->{code}->{$token} = $code if $code; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||
| 261 | 0 | $self->{code}->{$token}; | |||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||
| 265 | 4 | 1; | |||||||||||||||||||||||||||
| 266 | __END__ | ||||||||||||||||||||||||||||