dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Identifiers with ' (single quotes) parse but generate illegal C #109

Closed gstew5 closed 9 years ago

gstew5 commented 9 years ago

The following code:

fun foo'(x : int) { return x }
let comp main = read[int] >>> map foo' >>> write[int]

generates illegal C (C identifiers cannot contain single quote), causing gcc warnings and errors:

gcc -std=c99 -msse3 -I . -c test.c -o test.o
test.c:26:10: warning: missing terminating ' character [enabled by default]
 int32 foo'_ln1_1(int32 x2);
          ^
...

Two potential fixes:

ghost commented 9 years ago

Possible duplicate: https://github.com/dimitriv/Ziria/issues/80

gstew5 commented 9 years ago

Closed as duplicate of #80