Ticket #93 (closed defect: fixed)
Module names need to be filtred in generated C code
| Reported by: | erikd@… | Owned by: | benl |
|---|---|---|---|
| Priority: | trivial | Milestone: | 0.1.3 |
| Component: | Compilation Driver | Version: | 0.1.2 |
| Keywords: | Cc: |
Description
If a code module is named 'hello-world.ds' containing:
main = print "Hello World."
the generated C code will result in output C code with illegal C identifiers like:
#include "hello-world.ddc.h"
Obj** _ddcCAF_hello-world_main = 0;
Obj* symddcInitModule_helloMsworld () {
/**/ _ddcCAF_hello-world_main = _ddcSlotPtr++; /**/ _CAF(hello-world_main) = 0; /**/ _CAF(hello-world_main) = hello-world_main();
}
Obj* hello-world_main () {
Obj* _vxSS0; _ENTER (2);
symhelloMsworld_main_start: _S(0) = Data_String_boxString("Hello world!"); _S(1) = System_Console_print (_S(0)); _vxSS0 = _S(1); _LEAVE (2); return _vxSS0;
}
