Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gstew5 opened this issue Jun 18, 2015 · 2 comments
Closed

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

gstew5 opened this issue Jun 18, 2015 · 2 comments

Comments

@gstew5
Copy link
Collaborator

gstew5 commented Jun 18, 2015

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:

  • Catch single-quote ids at parse-time (by making them illegal), or
  • Choose related (fresh) names for these identifiers before code generation.
@ghost
Copy link

ghost commented Jul 7, 2015

Possible duplicate: #80

@gstew5
Copy link
Collaborator Author

gstew5 commented Jul 7, 2015

Closed as duplicate of #80

@gstew5 gstew5 closed this as completed Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant