Complete fix for the identifiers problem

This commit is contained in:
Cédric Pasteur 2010-07-16 14:09:37 +02:00
parent d42e56203b
commit b6583f22b6
3 changed files with 7 additions and 7 deletions

View file

@ -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 "@[<v>%a %s(@[<hov>%a@]);@ @]@\n"
pp_cty retty n pp_param_list args
fprintf fmt "@[<v>%a %a(@[<hov>%a@]);@ @]@\n"
pp_cty retty pp_string n pp_param_list args
let pp_cdef fmt cdef = match cdef with
| Cfundef cfd ->
fprintf fmt
"@[<v>@[<v 2>%a %s(@[<hov>%a@]) {%a@]@ }@ @]@\n"
pp_cty cfd.f_retty cfd.f_name pp_param_list cfd.f_args
"@[<v>@[<v 2>%a %a(@[<hov>%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

View file

@ -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

View file

@ -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