Skip to content
Snippets Groups Projects
Commit 1184114d authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Lookup provided constants that are used in iterators, and issue a better error

message if the constant is abstract ("an integer is expected whereas an int is
provided" was not a great message...).
parent e7ef1b90
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ utest_lv4:
ci:src/version.ml
make test && git commit -F log && rm -f src/version.ml
make alltest && git commit -F log && rm -f src/version.ml
cia:src/version.ml
make alltest && git commit -a -F log && rm -f src/version.ml
\ No newline at end of file
(** Time-stamp: <modified the 12/03/2009 (at 09:41) by Erwan Jahier> *)
(** Time-stamp: <modified the 26/05/2009 (at 16:39) by Erwan Jahier> *)
open Printf
open Lxm
......@@ -255,7 +255,10 @@ and string_of_decl var_info_eff =
in
let clk_str = (string_of_clock (snd var_info_eff.var_clock_eff)) in
let vt_str =
if !Global.ec && snd var_info_eff.var_clock_eff <> BaseEff
if !Global.ec &&
(match (snd var_info_eff.var_clock_eff) with
BaseEff | ClockVar _ -> false
| _ -> true)
then "(" ^ vt_str ^ ")"
else vt_str
in
......
(** Time-stamp: <modified the 26/05/2009 (at 15:34) by Erwan Jahier> *)
(** Time-stamp: <modified the 26/05/2009 (at 15:36) by Erwan Jahier> *)
open Predef
open Lxm
......@@ -82,6 +82,20 @@ let (get_node_and_constant: Lxm.t ->
| [NodeStaticArgEff(_,(n, inlist, outlist));
ConstStaticArgEff(_,Int_const_eff c)] -> n, inlist, outlist, c
| [NodeStaticArgEff(_,(n, inlist, outlist));
ConstStaticArgEff(_, Abstract_const_eff(l,_,Int_const_eff c, true))] ->
n, inlist, outlist, c
| [NodeStaticArgEff(_,_); ConstStaticArgEff(_, Extern_const_eff(l, _))] ->
let msg = "an integer is expected, whereas an extern constant (" ^
(Ident.string_of_long l) ^ ") was provided.\n"
in
raise (Compile_error(lxm, msg))
| [NodeStaticArgEff(_,_); ConstStaticArgEff(_, Abstract_const_eff(l,_,_, false))] ->
let msg = "an integer is expected, whereas an abstract constant (" ^
(Ident.string_of_long l) ^ ") was provided.\n"
in
raise (Compile_error(lxm, msg))
| [NodeStaticArgEff(_,(n, inlist, outlist)); ConstStaticArgEff(_, const)] ->
let msg = "an integer is expected, whereas a " ^
(LicDump.string_of_type_eff4msg (Eff.type_of_const const)) ^
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment