From b6583f22b61b825af86381a18cd7d4330ab80408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Fri, 16 Jul 2010 14:09:37 +0200 Subject: [PATCH] Complete fix for the identifiers problem --- compiler/obc/c/c.ml | 10 +++++----- compiler/obc/c/cgen.ml | 2 +- compiler/obc/c/cmain.ml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/obc/c/c.ml b/compiler/obc/c/c.ml index eeb5aae..f372bfb 100644 --- a/compiler/obc/c/c.ml +++ b/compiler/obc/c/c.ml @@ -225,7 +225,7 @@ and pp_cstm fmt stm = match stm with | Cskip -> fprintf fmt "" | Creturn e -> fprintf fmt "return %a" pp_cexpr e and pp_cexpr fmt ce = match ce with - | Cuop (s, e) -> fprintf fmt "%s(%a)" s pp_cexpr e + | Cuop (s, e) -> fprintf fmt "%s(%a)" s pp_cexpr e | Cbop (s, l, r) -> fprintf fmt "(%a%s%a)" pp_cexpr l s pp_cexpr r | Cfun_call (s, el) -> fprintf fmt "%a(@[%a@])" pp_string s (pp_list1 pp_cexpr ",") el @@ -262,14 +262,14 @@ let pp_cdecl fmt cdecl = match cdecl with List.iter (pp_field fmt) fl; fprintf fmt "@]@ } %a;@ @]@\n" pp_string s | Cdecl_function (n, retty, args) -> - fprintf fmt "@[%a %s(@[%a@]);@ @]@\n" - pp_cty retty n pp_param_list args + fprintf fmt "@[%a %a(@[%a@]);@ @]@\n" + pp_cty retty pp_string n pp_param_list args let pp_cdef fmt cdef = match cdef with | Cfundef cfd -> fprintf fmt - "@[@[%a %s(@[%a@]) {%a@]@ }@ @]@\n" - pp_cty cfd.f_retty cfd.f_name pp_param_list cfd.f_args + "@[@[%a %a(@[%a@]) {%a@]@ }@ @]@\n" + pp_cty cfd.f_retty pp_string cfd.f_name pp_param_list cfd.f_args pp_cblock cfd.f_body | Cvardef (s, cty) -> fprintf fmt "%a %a;@\n" pp_cty cty pp_string s diff --git a/compiler/obc/c/cgen.ml b/compiler/obc/c/cgen.ml index 07486ae..dabf40d 100644 --- a/compiler/obc/c/cgen.ml +++ b/compiler/obc/c/cgen.ml @@ -710,7 +710,7 @@ let cfile_list_of_oprog name oprog = List.iter add_opened_module opened_modules; List.iter add_opened_module deps; - let cfile_name = String.uncapitalize cd.cd_name in + let cfile_name = String.uncapitalize (cname_of_name cd.cd_name) in let struct_decl,(cdecls, cdefs) = cdefs_and_cdecls_of_class_def cd in diff --git a/compiler/obc/c/cmain.ml b/compiler/obc/c/cmain.ml index 4f9262c..5ce1e8f 100644 --- a/compiler/obc/c/cmain.ml +++ b/compiler/obc/c/cmain.ml @@ -288,7 +288,7 @@ let translate name prog = @ (cfile_list_of_oprog modname prog) let program p = - let filename = filename_of_name p.p_modname in + let filename = filename_of_name (cname_of_name p.p_modname) in let dirname = build_path (filename ^ "_c") in let dir = clean_dir dirname in let c_ast = translate filename p in