Skip to content

Commit 5796920

Browse files
committed
What they write \f in the spec actually means \n.
1 parent 6dff852 commit 5796920

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

syntax/attribute_value.ml

+10-10
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ let list
7474
|> Common.list loc
7575
|> fun e -> Some e
7676

77-
let spaces = list (Re_str.regexp "[ \t\r\f]+") "space"
78-
let commas = list (Re_str.regexp "[ \t\r\f]*,[ \t\r\f]*") "comma"
79-
let semicolons = list (Re_str.regexp "[ \t\r\f]*;[ \t\r\f]*") "semicolon"
77+
let spaces = list (Re_str.regexp "[ \t\r\n]+") "space"
78+
let commas = list (Re_str.regexp "[ \t\r\n]*,[ \t\r\n]*") "comma"
79+
let semicolons = list (Re_str.regexp "[ \t\r\n]*;[ \t\r\n]*") "semicolon"
8080

81-
let spaces_or_commas_regexp = Re_str.regexp "\\([ \t\r\f]*,[ \t\r\f]*\\)\\|[ \t\r\f]+"
81+
let spaces_or_commas_regexp = Re_str.regexp "\\([ \t\r\n]*,[ \t\r\n]*\\)\\|[ \t\r\n]+"
8282
let spaces_or_commas_ = exp_list spaces_or_commas_regexp "space- or comma"
8383
let spaces_or_commas = list spaces_or_commas_regexp "space- or comma"
8484

@@ -348,7 +348,7 @@ let offset =
348348
end [@metaloc loc]
349349

350350
let transform_item =
351-
let regexp = Re_str.regexp "\\([a-zA-Z]+\\)[ \t\r\f]*(\\([^)]*\\))" in
351+
let regexp = Re_str.regexp "\\([a-zA-Z]+\\)[ \t\r\n]*(\\([^)]*\\))" in
352352

353353
fun ?separated_by:_ ?default:_ loc name s ->
354354
if not @@ does_match regexp s then
@@ -409,8 +409,8 @@ let transform_item =
409409
Some e
410410

411411
let rec transform =
412-
let regexp_wsp = Re_str.regexp "[ \t\r\f]*" in
413-
let regexp = Re_str.regexp "[ \t\r\f]*\\([a-zA-Z]+[ \t\r\f]*([^)]*)\\)\\(.*\\)" in
412+
let regexp_wsp = Re_str.regexp "[ \t\r\n]*" in
413+
let regexp = Re_str.regexp "[ \t\r\n]*\\([a-zA-Z]+[ \t\r\n]*([^)]*)\\)\\(.*\\)" in
414414

415415
fun ?separated_by:_ ?default:_ loc name s ->
416416
if does_match regexp_wsp s then
@@ -419,9 +419,9 @@ let rec transform =
419419
begin
420420
let item = Re_str.matched_group 1 s in
421421
let rest = Re_str.matched_group 2 s in
422-
Option.bind (transform_item ~separated_by ~default loc name item) (fun item ->
423-
Option.bind (transform ~separated_by ~default loc name rest) (fun l ->
424-
Some (item :: l)))
422+
Option.bind (transform_item loc name item) (fun item ->
423+
Option.bind (transform loc name rest) (fun l ->
424+
Some [%expr [%e item] :: [%e l]]))
425425
end
426426
else
427427
Common.error loc "Value of %s is not a list of SVG transform" name

0 commit comments

Comments
 (0)