X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=lib%2Fwhenutils.ml;h=d53ac7e852e0cdbe02bfcf2c353b81486de3a23d;hp=9614ef89b4fb625b86f9445a6a2d5370f3e25e1a;hb=05ade7bb494f37bbbfb4b20d59d487e5ede98b05;hpb=fc824db2d9688b955ff5556483f45c783d27f804 diff --git a/lib/whenutils.ml b/lib/whenutils.ml index 9614ef8..d53ac7e 100644 --- a/lib/whenutils.ml +++ b/lib/whenutils.ml @@ -41,6 +41,9 @@ module StringSet = Set.Make (String) let (//) = Filename.concat +let isalpha = function 'a'..'z' | 'A'..'Z' -> true | _ -> false +let isalnum = function 'a'..'z' | 'A'..'Z' | '0'..'9' -> true | _ -> false + let rec filter_map f = function | [] -> [] | x :: xs -> @@ -246,7 +249,7 @@ and expr_of_iexpr _loc = function | IExpr_app (("change"|"changes"|"changed"|"inc"|"increase"|"increases"|"increased"|"dec"|"decrease"|"decreases"|"decreased"|"prev"|"previous") as op, _) -> invalid_arg (sprintf "%s: '%s' operator must be followed by a variable name" - op (Loc.to_string _loc)) + (Loc.to_string _loc) op) | IExpr_app (op, _) -> invalid_arg (sprintf "%s: unknown operator in expression: %s"