File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -494,19 +494,20 @@ let fill_opacity =
494494 if not @@ does_match regexp s then bad_form name loc;
495495
496496 begin
497- let n =
498- match float_exp loc (Re_str. matched_group 1 s) with
499- | Some n -> n
500- | None -> bad_form name loc
501- in
502497
503- let v =
504- if group_matched 2 s then (n /. 100. )
505- else n in
498+ try
499+ let n = float_of_string (Re_str. matched_group 1 s) in
500+
501+ let v =
502+ if group_matched 2 s then (n /. 100. )
503+ else n in
504+
505+ if v > = 0. && v < = 1. then Some [% expr [% e v]]
506+ else
507+ Common. error loc " Value of %s must be between 0 and 1." name
508+
509+ with Failure _ -> bad_form name loc
506510
507- if v > = 0. && v < = 1. then Some [% expr [% e v]]
508- else
509- Common. error loc " Value of %s must be between 0 and 1." name
510511 end [@ metaloc loc]
511512
512513let fill_rule ?separated_by :_ ?default:_ loc _name s =
You can’t perform that action at this time.
0 commit comments