From d6b29e05bcb3253e723fe5576682232c56c491ea Mon Sep 17 00:00:00 2001 From: Erwan Jahier <jahier@imag.fr> Date: Tue, 26 May 2009 17:28:26 +0200 Subject: [PATCH] Enhance some error messages. --- src/test/test.res.exp | 4 ++++ src/unifyClock.ml | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/test.res.exp b/src/test/test.res.exp index d0b31223..31bb2c43 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -10960,6 +10960,7 @@ returns ( clock4_y:bool when clock4_x); *** Error in file "should_work/clock/when_not.lus", line 7, col 12 to 17, token 'clock4': *** +*** clock error: The two following clocks are not unifiable: @@ -21784,6 +21785,7 @@ Opening file should_fail/clock/bad_call02.lus *** Error in file "should_fail/clock/bad_call02.lus", line 6, col 4 to 4, token '=': *** +*** clock error: The two following clocks are not unifiable: @@ -21813,6 +21815,7 @@ returns ( y:bool when x); *** Error in file "should_fail/clock/clock.lus", line 23, col 12 to 17, token 'clock4': *** +*** clock error: The two following clocks are not unifiable: @@ -21847,6 +21850,7 @@ extern node when_enum::tutu(u:_when_enum::t) returns (x:bool); extern node when_enum::toto(u:bool; v:bool) returns (x:bool; y:bool); *** Error in file "should_fail/clock/when_enum.lus", line 10, col 12 to 15, token 'toto': *** +*** clock error: The two following clocks are not unifiable: diff --git a/src/unifyClock.ml b/src/unifyClock.ml index c8c6ebed..57c20b98 100644 --- a/src/unifyClock.ml +++ b/src/unifyClock.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 25/05/2009 (at 17:13) by Erwan Jahier> *) +(** Time-stamp: <modified the 26/05/2009 (at 17:02) by Erwan Jahier> *) open LicDump @@ -252,9 +252,9 @@ let (f : Lxm.t -> subst -> Eff.clock -> Eff.clock -> subst) = ) else let msg = - "\n*** clock error: The expression has clock '" ^ - (ci2str ci1) ^ "', \n*** but it is used with clock '" ^ - (ci2str ci2) ^ "'.\n" + ("\n*** clock error: The two following clocks are not unifiable:\n***\t" ^ + (ci2str ci1) ^ "\n***\t" ^ + (ci2str ci2) ^ "\n") in raise(Compile_error(lxm, msg)) -- GitLab