ts2c
ts2c copied to clipboard
Syntax errors are handled incorrectly
ts2c often produces incorrect output from JavaScript programs that contain syntax errors. When I try to compile this program:
console.log("This shouldn't compile."); ( (
ts2c produces this program, which also contains a syntax error:
#include <stdio.h>
int main(void) {
printf("This shouldn't compile.\n");
(());
return 0;
}
This is probably a bug: ts2c should have detected this syntax error before trying to compile the program to C.