eudoxia0 / cmacro

Lisp macros for C
881 stars 29 forks source link

return -1 becomes return- 1 #10

Closed klaufir closed 5 months ago

klaufir commented 9 years ago

Given the following input file

// file: test.cmc
int main() {
    return -1;
}

Cmc generates the following output

$ cmc test.cmc -o test.c && cat test.c

int main () {
return- 1;
}

And this code doesn't compile, while the original is valid C code.

edit: Wow, reponse under 4 minutes: thats top notch support :) Thanks for looking into it!

eudoxia0 commented 9 years ago

Thanks. I think this will just be a matter of improving the parsing of negative numbers.

In the meantime you can use return(-1); (A hack, I know).