From a673c447e3d45dc04203f9ffa4d358f19f64205a Mon Sep 17 00:00:00 2001 From: Arnaud DABY-SEESARAM Date: Tue, 20 Dec 2022 16:41:21 +0100 Subject: [PATCH] [messages] better comment and errors --- src/cprint.ml | 4 ++-- src/parser.mly | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cprint.ml b/src/cprint.ml index c9faf22..a47edcd 100644 --- a/src/cprint.ml +++ b/src/cprint.ml @@ -319,8 +319,8 @@ and cp_expression fmt (expr, hloc) = -(** [cp_main] tries to print a main function to the C code. - * If there is a function [main] in the lustre program, it will generate a main +(** [cp_main] prints a main function to the C code if necessary: + * if there is a function [main] in the lustre program, it will generate a main * function in the C code, otherwise it does not do anything. *) let cp_main_fn fmt (prog, sts) = diff --git a/src/parser.mly b/src/parser.mly index f15de24..e2e0853 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -216,8 +216,8 @@ node_content: if vars_distinct e_in e_out (snd $10) then (Hashtbl.add defined_nodes node_name n; n) else raise (MyParsingError - ("There is a conflict between the names of local, input \ - or output variables.", + ("There is a conflict between the names of local,\ + input or output variables.", current_location())) end}; @@ -324,22 +324,22 @@ expr: "Addition expects both arguments to be (the same kind of) numbers." } | expr MINUS expr { make_binop_nonbool $1 $3 BOp_sub - "You should know better; subtraction hates booleans" } + "Substraction expects both arguments to be (the same kind of) numbers." } | expr BO_mul expr { make_binop_nonbool $1 $3 BOp_mul - "You should know better; multiplication hates booleans" } + "Multiplication expects both arguments to be (the same kind of) numbers." } | expr BO_div expr { make_binop_nonbool $1 $3 BOp_div - "You should know better; division hates booleans" } + "Division expects both arguments to be (the same kind of) numbers." } | expr BO_mod expr { make_binop_nonbool $1 $3 BOp_mod - "You should know better; modulo hates booleans" } + "Modulo expects both arguments to be numbers." } | expr BO_and expr { make_binop_bool $1 $3 BOp_and - "You should know better; conjunction hates numbers" } + "Conjunction expects both arguments to be booleans." } | expr BO_or expr { make_binop_bool $1 $3 BOp_or - "You should know better; disjunction hates numbers" } + "Disjunction expects both arguments to be booleans." } | expr BO_arrow expr { let e1 = $1 in let t1 = type_exp e1 in let e2 = $3 in let t2 = type_exp e2 in