ts2c icon indicating copy to clipboard operation
ts2c copied to clipboard

Syntax errors are handled incorrectly

Open jarble opened this issue 2 years ago • 0 comments

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.

jarble avatar Jul 12 '21 22:07 jarble