Project

General

Profile

« Previous | Next » 

Revision 13aec2da

Added by Pierre-Loïc Garoche almost 7 years ago

[main] enum typedef in C use the original lustre filename as identifier. This commit cleans the filename to remove dots.

View differences:

src/backends/C/c_backend_common.ml
23 23
    (if !Options.ansi then "ANSI C90" else "C99")
24 24
    (if !Options.mpfr then "MPFR multi-precision" else "(double) floating-point")
25 25

  
26
let protect_filename s =
27
  Str.global_replace (Str.regexp "\\.\\|\\ ") "_" s
28

  
26 29
let file_to_module_name basename =
27 30
  let baseNAME = Ocaml_utils.uppercase basename in
28
  let baseNAME = Str.global_replace (Str.regexp "\\.\\|\\ ") "_" baseNAME in
31
  let baseNAME = protect_filename baseNAME in
29 32
  baseNAME
30 33

  
31 34
(* Generation of a non-clashing name for the self memory variable (for step and reset functions) *)

Also available in: Unified diff