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

Soc2c : print "_true" instead of "true" for true constant (ditto for false).

test: 238->203 failures
parent b1ce1e9f
No related branches found
No related tags found
No related merge requests found
(** Time-stamp: <modified the 12/06/2014 (at 09:32) by Erwan Jahier> *) (** Time-stamp: <modified the 13/06/2014 (at 16:28) by Erwan Jahier> *)
open Lxm open Lxm
open Lic open Lic
......
(* Time-stamp: <modified the 13/06/2014 (at 15:36) by Erwan Jahier> *) (* Time-stamp: <modified the 13/06/2014 (at 16:23) by Erwan Jahier> *)
(* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *) (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
...@@ -81,6 +81,8 @@ let (is_memory_less : Soc.t -> bool) = ...@@ -81,6 +81,8 @@ let (is_memory_less : Soc.t -> bool) =
let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) =
fun soc -> function fun soc -> function
| Const("true", _) -> "_true"
| Const("false", _) -> "_false"
| Const(id, _) -> id2s id | Const(id, _) -> id2s id
| Var ("mem_pre",_) -> (* Clutch! it's not an interface var... *) "ctx->mem_pre" | Var ("mem_pre",_) -> (* Clutch! it's not an interface var... *) "ctx->mem_pre"
| Var (id,_) -> | Var (id,_) ->
...@@ -408,10 +410,10 @@ let (gen_loop_file : Soc.t -> unit) = ...@@ -408,10 +410,10 @@ let (gen_loop_file : Soc.t -> unit) =
static int ISATTY; static int ISATTY;
/* MACROS DEFINITIONS ****************/ /* MACROS DEFINITIONS ****************/
#ifndef TT #ifndef TT
#define TT \"true\" #define TT \"1\"
#endif #endif
#ifndef FF #ifndef FF
#define FF \"false\" #define FF \"0\"
#endif #endif
#ifndef BB #ifndef BB
#define BB \"bottom\" #define BB \"bottom\"
......
(* Time-stamp: <modified the 11/06/2014 (at 14:54) by Erwan Jahier> *) (* Time-stamp: <modified the 13/06/2014 (at 16:24) by Erwan Jahier> *)
let colcol = Str.regexp "::" let colcol = Str.regexp "::"
let id2s id = (* XXX Refuser les noms de module à la con plutot *) let id2s id = (* XXX Refuser les noms de module à la con plutot *)
let str = let str =
match Str.split colcol id with match Str.split colcol id with
| ["true"] -> "_true" (* a good idea to do that here ? *)
| ["false"] -> "_false"
| [s] -> s | [s] -> s
| [m;s] -> if Lv6MainArgs.global_opt.Lv6MainArgs.no_prefix then s else m^"_"^s | [m;s] -> if Lv6MainArgs.global_opt.Lv6MainArgs.no_prefix then s else m^"_"^s
| _ -> id | _ -> id
......
This diff is collapsed.
testcase ./lus2lic.tests/non-reg.exp completed in 118 seconds testcase ./lus2lic.tests/non-reg.exp completed in 121 seconds
testcase ./lus2lic.tests/progression.exp completed in 1 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds
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