@@ -309,12 +309,12 @@ let rec ends_by_semi_semi = function
309309 | [ h ] -> Astring.String. is_suffix ~affix: " ;;" h
310310 | _ :: xs -> ends_by_semi_semi xs
311311
312- let version_enabled version =
312+ let version_enabled versions =
313313 let + curr_version = Ocaml_version. of_string Sys. ocaml_version in
314- match version with
315- | Some (op , v ) ->
316- Label.Relation. compare op (Ocaml_version. compare curr_version v) 0
317- | None -> true
314+ List. for_all
315+ ( fun (op , v ) ->
316+ Label.Relation. compare op (Ocaml_version. compare curr_version v) 0 )
317+ versions
318318
319319let os_type_enabled os_type =
320320 match os_type with
@@ -349,7 +349,7 @@ type block_config = {
349349 env : string option ;
350350 dir : string option ;
351351 skip : bool ;
352- version : (Label.Relation .t * Ocaml_version .t ) option ;
352+ version : (Label.Relation .t * Ocaml_version .t ) list ;
353353 os_type : (Label.Relation .t * string ) option ;
354354 set_variables : (string * string ) list ;
355355 unset_variables : string list ;
@@ -369,7 +369,10 @@ let get_block_config l =
369369 env = get_label (function Env x -> Some x | _ -> None ) l;
370370 dir = get_label (function Dir x -> Some x | _ -> None ) l;
371371 skip = List. exists (function Label. Skip -> true | _ -> false ) l;
372- version = get_label (function Version (x , y ) -> Some (x, y) | _ -> None ) l;
372+ version =
373+ List. filter_map
374+ (function Label. Version (x , y ) -> Some (x, y) | _ -> None )
375+ l;
373376 os_type = get_label (function Os_type (x , y ) -> Some (x, y) | _ -> None ) l;
374377 set_variables =
375378 List. filter_map (function Label. Set (v , x ) -> Some (v, x) | _ -> None ) l;
0 commit comments