diff --git a/syntax/attribute_value.ml b/syntax/attribute_value.ml index a38710c72..0ae46c003 100644 --- a/syntax/attribute_value.ml +++ b/syntax/attribute_value.ml @@ -74,11 +74,11 @@ let list |> Common.list loc |> fun e -> Some e -let spaces = list (Re_str.regexp "[ \t\r\f]+") "space" -let commas = list (Re_str.regexp "[ \t\r\f]*,[ \t\r\f]*") "comma" -let semicolons = list (Re_str.regexp "[ \t\r\f]*;[ \t\r\f]*") "semicolon" +let spaces = list (Re_str.regexp "[ \t\r\n]+") "space" +let commas = list (Re_str.regexp "[ \t\r\n]*,[ \t\r\n]*") "comma" +let semicolons = list (Re_str.regexp "[ \t\r\n]*;[ \t\r\n]*") "semicolon" -let spaces_or_commas_regexp = Re_str.regexp "\\([ \t\r\f]*,[ \t\r\f]*\\)\\|[ \t\r\f]+" +let spaces_or_commas_regexp = Re_str.regexp "\\([ \t\r\n]*,[ \t\r\n]*\\)\\|[ \t\r\n]+" let spaces_or_commas_ = exp_list spaces_or_commas_regexp "space- or comma" let spaces_or_commas = list spaces_or_commas_regexp "space- or comma" @@ -348,7 +348,7 @@ let offset = end [@metaloc loc] let transform_item = - let regexp = Re_str.regexp "\\([a-zA-Z]+\\)[ \t\r\f]*(\\([^)]*\\))" in + let regexp = Re_str.regexp "\\([a-zA-Z]+\\)[ \t\r\n]*(\\([^)]*\\))" in fun ?separated_by:_ ?default:_ loc name s -> if not @@ does_match regexp s then @@ -409,8 +409,8 @@ let transform_item = Some e let rec transform = - let regexp_wsp = Re_str.regexp "[ \t\r\f]*" in - let regexp = Re_str.regexp "[ \t\r\f]*\\([a-zA-Z]+[ \t\r\f]*([^)]*)\\)\\(.*\\)" in + let regexp_wsp = Re_str.regexp "[ \t\r\n]*" in + let regexp = Re_str.regexp "[ \t\r\n]*\\([a-zA-Z]+[ \t\r\n]*([^)]*)\\)\\(.*\\)" in fun ?separated_by:_ ?default:_ loc name s -> if does_match regexp_wsp s then @@ -419,9 +419,9 @@ let rec transform = begin let item = Re_str.matched_group 1 s in let rest = Re_str.matched_group 2 s in - Option.bind (transform_item ~separated_by ~default loc name item) (fun item -> - Option.bind (transform ~separated_by ~default loc name rest) (fun l -> - Some (item :: l))) + Option.bind (transform_item loc name item) (fun item -> + Option.bind (transform loc name rest) (fun l -> + Some [%expr [%e item] :: [%e l]])) end else Common.error loc "Value of %s is not a list of SVG transform" name