From 92ace6ae1a982e1d619695156b9854ec0f16889b Mon Sep 17 00:00:00 2001 From: Henry Lee Date: Wed, 8 Nov 2023 18:02:37 +0900 Subject: [PATCH] fix: fix cases with syntax errors --- OCaml/lambda-13/buggy/src.ml | 4 ++-- OCaml/lambda-14/buggy/src.ml | 4 ++-- OCaml/lambda-6/buggy/src.ml | 2 +- OCaml/lambda-95/buggy/src.ml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OCaml/lambda-13/buggy/src.ml b/OCaml/lambda-13/buggy/src.ml index e10acbf80..cbfceac5b 100644 --- a/OCaml/lambda-13/buggy/src.ml +++ b/OCaml/lambda-13/buggy/src.ml @@ -4,8 +4,8 @@ and var = string let rec check (a : lambda) : bool = match a with - | V _ -> raise Invalid_argument "check" - | C (a, b) -> raise Invalid_argument "check" + | V _ -> raise (Invalid_argument "check") + | C (a, b) -> raise (Invalid_argument "check") | P (a, V b) -> if a = b then true else false | P (a, C (V b, V c)) -> if a = b || a = c then true else false | P (a, C (P (b, V c), V d)) -> if a = c || a = d then true else false diff --git a/OCaml/lambda-14/buggy/src.ml b/OCaml/lambda-14/buggy/src.ml index d04652d0e..148651d7d 100644 --- a/OCaml/lambda-14/buggy/src.ml +++ b/OCaml/lambda-14/buggy/src.ml @@ -4,8 +4,8 @@ and var = string let rec check (a : lambda) : bool = match a with - | V _ -> raise Invalid_argument "check" - | C (a, b) -> raise Invalid_argument "check" + | V _ -> raise (Invalid_argument "check") + | C (a, b) -> raise (Invalid_argument "check") | P (a, V b) -> if a = b then true else false | P (a, C (V b, V c)) -> if a = b || a = c then true else false | P (a, C (P (b, V c), V d)) -> if a = c && a = d then true else false diff --git a/OCaml/lambda-6/buggy/src.ml b/OCaml/lambda-6/buggy/src.ml index fa06e79f0..aabac5f52 100644 --- a/OCaml/lambda-6/buggy/src.ml +++ b/OCaml/lambda-6/buggy/src.ml @@ -18,4 +18,4 @@ let rec check (met : lambda) : bool = | _ -> check2 a x && check2 a x ) in - match met with P (b, c) -> check2 b c | _ -> raise Error "Illegal input" + match met with P (b, c) -> check2 b c | _ -> raise (Error "Illegal input") diff --git a/OCaml/lambda-95/buggy/src.ml b/OCaml/lambda-95/buggy/src.ml index e5e7b3248..644d525dd 100644 --- a/OCaml/lambda-95/buggy/src.ml +++ b/OCaml/lambda-95/buggy/src.ml @@ -4,7 +4,7 @@ and var = string let isinthelist (l : 'a list) a : bool = let temp : 'a list = - List.filter (fun x y -> if x != y then false else true a) l + List.filter ((fun x y -> if x != y then false else true) a) l in match temp with [] -> false | hd :: tl -> true @@ -12,7 +12,7 @@ let isinthelist (l : 'a list) a : bool = let isnotinthelist (l : 'b list) (a : string) : bool = let temp : 'b list = - List.filter (fun x y -> if x != y then false else true a) l + List.filter ((fun x y -> if x != y then false else true) a) l in match temp with [] -> true | hd :: tl -> false