fix
This commit is contained in:
parent
ae2b764821
commit
3ee85d7766
1 changed files with 19 additions and 16 deletions
|
@ -67,15 +67,18 @@ let rec synth_expression
|
||||||
: HopixTypes.typing_environment -> HopixAST.expression Position.located
|
: HopixTypes.typing_environment -> HopixAST.expression Position.located
|
||||||
-> HopixTypes.aty
|
-> HopixTypes.aty
|
||||||
=
|
=
|
||||||
fun env Position.{ value = e; position = pos } -> function
|
fun env Position.{ value = e; position = pos } ->
|
||||||
|
match e with
|
||||||
| Literal l -> type_of_literal l.value
|
| Literal l -> type_of_literal l.value
|
||||||
| Variable(id,tlist) -> failwith "Students! This is your job! Variable"
|
| Variable (id, tlist) -> failwith "Students! This is your job! Variable"
|
||||||
| Tagged(cons,_,[]) -> HopixTypes.hbool (*Pas sûr, j'ai regardé comme dans hopixInterpreter au début*)
|
| Tagged (cons, _, []) ->
|
||||||
| Apply(a,b) -> failwith "Students! This is your job! Apply"
|
HopixTypes.hbool (*Pas sûr, j'ai regardé comme dans hopixInterpreter au début*)
|
||||||
| Record(field,tliste) -> failwith "Students! This is your job! Record"
|
| Apply (a, b) -> failwith "Students! This is your job! Apply"
|
||||||
| Fun(_) -> failwith "Students! This is your job! Fun synth" (* TODO : ici on ne peut pas synthesisé. cf Cours*)
|
| Record (field, tliste) -> failwith "Students! This is your job! Record"
|
||||||
| TypeAnnotation(expr,t) -> failwith "Students! This is your job! TypeAnnotation"
|
| Fun _ ->
|
||||||
|
failwith "Students! This is your job! Fun synth"
|
||||||
|
(* TODO : ici on ne peut pas synthesisé. cf Cours*)
|
||||||
|
| TypeAnnotation (expr, t) -> failwith "Students! This is your job! TypeAnnotation"
|
||||||
|
|
||||||
and type_of_literal l =
|
and type_of_literal l =
|
||||||
match l with
|
match l with
|
||||||
|
@ -87,16 +90,16 @@ and check_expression
|
||||||
: HopixTypes.typing_environment -> HopixAST.expression Position.located
|
: HopixTypes.typing_environment -> HopixAST.expression Position.located
|
||||||
-> HopixTypes.aty -> unit
|
-> HopixTypes.aty -> unit
|
||||||
=
|
=
|
||||||
fun env (Position.{ value = e; position = pos } as exp) expected -> function
|
fun env (Position.{ value = e; position = pos } as exp) expected ->
|
||||||
|
match e with
|
||||||
| Fun df -> failwith "Students! This is your job! Fun check"
|
| Fun df -> failwith "Students! This is your job! Fun check"
|
||||||
|
| _ -> failwith "Students! This is your job! check_expression wildcard"
|
||||||
|
|
||||||
|
|
||||||
and check_value_definition
|
and check_value_definition
|
||||||
: HopixTypes.typing_environment -> HopixAST.value_definition
|
: HopixTypes.typing_environment -> HopixAST.value_definition
|
||||||
-> HopixTypes.typing_environment
|
-> HopixTypes.typing_environment
|
||||||
=
|
=
|
||||||
fun env -> function
|
fun env -> function
|
||||||
| SimpleValue (id, Some ty, ex) ->
|
| SimpleValue (id, Some ty, ex) ->
|
||||||
failwith "Students! This is your job! (check_value_definition | SimpleValue)"
|
failwith "Students! This is your job! (check_value_definition | SimpleValue)"
|
||||||
| RecFunctions _ ->
|
| RecFunctions _ ->
|
||||||
|
|
Reference in a new issue