@@ -24,37 +24,6 @@ has &.index;
2424method index { & ! index () }
2525has 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-
5827method ! 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
7039multi 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