Skip to content
Snippets Groups Projects
Commit 8f54a0e2 authored by erwan's avatar erwan
Browse files

print node pragmas in -lv4 mode

parent 07c1d09f
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 16/11/2023 (at 11:09) by Erwan Jahier> *)
(* Time-stamp: <modified the 16/11/2023 (at 12:16) by Erwan Jahier> *)
(*
This module is used both for
......@@ -588,7 +588,10 @@ and (string_of_by_pos_op_eff: bool -> Lic.by_pos_op srcflagged -> Lic.val_exp li
||
global_opt.one_op_per_equation
then
if String.length str >0 && str.[0] <> ' ' then " "^str^ " " else str
let lstr = String.length str in
let str = if lstr>0 && str.[0] <> ' ' then " "^str else str in
let str = if lstr>0 && str.[String.length str - 1] <> ' ' then str^ " " else str in
str
else
("(" ^ str ^ ")")
......@@ -816,16 +819,22 @@ and node_of_node_exp_eff forprint (neff: Lic.node_exp): string =
profile_of_node_exp_eff forprint neff
)
^
let pragma = if global_opt.lv4 then
(Lxm.pragma neff.lxm) |>
List.map (function Pragma(cid,c) -> Printf.sprintf "(*@%s %s*)\n" cid c) |>
String.concat "\n"
else ""
in
(match neff.def_eff with
| ExternLic -> ";\n"
| ExternLic -> ";\n" ^ pragma
| MetaOpLic -> (
(* on écrit juste un alias *)
" = " ^(string_of_node_key_def forprint neff.node_key_eff)^ ";\n"
" = " ^(string_of_node_key_def forprint neff.node_key_eff)^ ";\n" ^ pragma
)
| AbstractLic _ -> "; \n"
| AbstractLic _ -> "; \n" ^ pragma
| BodyLic _ -> (
(if global_opt.kcg then "\n" else ";\n") ^
(if global_opt.kcg then "\n" else ";\n" ^ pragma) ^
(match neff.loclist_eff with
| None -> ""
| Some [] -> ""
......
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