Procházet zdrojové kódy

Re-enabled separate shorthand unfolding for correct duplicate pruning

Taddeus Kroes před 11 roky
rodič
revize
22a733542c
2 změnil soubory, kde provedl 10 přidání a 5 odebrání
  1. 8 4
      main.ml
  2. 2 1
      shorthand.ml

+ 8 - 4
main.ml

@@ -130,10 +130,14 @@ let handle_args args =
 
   let input, css = parse_files args.infiles in
   let css = css
-    |> (switch args.color Color.compress)
-    (*|> (switch args.font Font.compress)*)
-    |> (switch args.shorthands Shorthand.compress)
-    (*|> (switch args.duplicates Duplicates.compress)*)
+    |> switch args.color Color.compress
+    (*|> switch args.font Font.compress*)
+
+    (* unfold before pruning duplicates so that shorthand components are
+     * correctly pruned *)
+    |> switch args.shorthands Shorthand.unfold_stylesheet
+    (*|> switch args.duplicates Duplicates.compress*)
+    |> switch args.shorthands Shorthand.compress
   in
   let output =
     if args.whitespace

+ 2 - 1
shorthand.ml

@@ -232,7 +232,8 @@ let rec unfold = function
 let make_shorthands decls =
   (* unfold currently existing shorthands into separate properties for merging
    * with override properties that are defined later on *)
-  let decls = unfold decls in
+  (*let decls = unfold decls in
+    XXX: done by main function for correct pruning of duplicate declarations*)
 
   (* find shorthand names for which properties are present *)
   let rec find_props = function