Skip to content

Commit cb34b25

Browse files
committed
Remove deprecated alias method
1 parent bb21c7d commit cb34b25

1 file changed

Lines changed: 5 additions & 36 deletions

File tree

lib/CSS/Module.rakumod

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,6 @@ has &.index;
2424
method index { &!index() }
2525
has CSS::Module %.sub-module;
2626

27-
my subset ExtensionName of Str where .starts-with('-');
28-
proto method alias(|) is DEPRECATED('extend(:$name, :$like, ...)') {*};
29-
multi method alias(ExtensionName :$name! is copy, Str :$like! is copy) is rw {
30-
$name .= lc;
31-
$like .= lc;
32-
my $metadata = %!property-metadata{$like}
33-
// die "unable to alias unknown property: '$like'";
34-
35-
die "unable to alias container property '$like' - NYI"
36-
if $metadata<children> || $metadata<box>;
37-
38-
with %!prop-names{$name} {
39-
die "conflicting property alias: '$name'"
40-
unless %!alias{$name} ~~ $like;
41-
}
42-
else {
43-
my UInt $prop-num = self.index.elems;
44-
%!alias{$name} = $like;
45-
%!prop-names{$name} = $prop-num;
46-
%!property-metadata{$name} = %!property-metadata{$like};
47-
%!property-metadata{$name}<default>:delete
48-
without %!property-metadata{$name}<default>[1];
49-
self.index[$prop-num] = CSS::Module::Property.new: :$name, :$prop-num, |%!property-metadata{$name};
50-
}
51-
%(:$name, :$like);
52-
}
53-
multi method alias($name) is default {
54-
my $like = %!alias{$name} // die "unknown property alias: '$name'";
55-
%(:$name, :$like);
56-
}
57-
5827
method !register-property(:$name!, :%metadata) {
5928
die "unable to register container property '$name' - NYI"
6029
if %metadata<children> || %metadata<box>;
@@ -69,12 +38,12 @@ method !register-property(:$name!, :%metadata) {
6938

7039
multi method extend(
7140
Str:D :$name! is copy,
72-
Str:D :like($base-prop)! is copy,
41+
Str:D :$like!,
7342
:&coerce,
7443
|c
7544
) {
7645
$name .= lc;
77-
$base-prop .= lc;
46+
my $base-prop = $like.lc;
7847
die "unknown base property: $name"
7948
unless %!property-metadata{$base-prop}:exists;
8049
my %metadata = %!property-metadata{$base-prop};
@@ -100,7 +69,7 @@ multi method extend(
10069
%metadata ,= c.hash;
10170
with &coerce -> &c {
10271
%!coerce{$name} = &c;
103-
%metadata<default> //= [$_, [&c($_)]]
72+
%metadata<default> //= [$_, [.&c]]
10473
with $val;
10574
}
10675
else {
@@ -132,14 +101,14 @@ multi method parse-property(Str $property-name where (%!coerce{$_}:exists), $val
132101
}
133102

134103
#| parse an individual property-specific expression
135-
multi method parse-property(Str $property-name, $val, Bool :$warn = True) {
104+
multi method parse-property(Str $property-name, Str() $val, Bool :$warn = True) {
136105
my $actions = $.actions.new;
137106
my $prop = $property-name.lc;
138107
$prop = $_ with %!alias{$prop};
139108
my $rule = %!allow{$prop} ?? 'expr' !! 'css-val-' ~ $prop;
140109
my $ast;
141110

142-
if $.grammar.parse($val.Str, :$rule, :$actions ) -> \p {
111+
if $.grammar.parse($val, :$rule, :$actions ) -> \p {
143112
$ast := $actions.build.list(p);
144113
}
145114
else {

0 commit comments

Comments
 (0)