Compiler hang on missing semicolon

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Compiler hang on missing semicolon

herruppohoppa
Hello, sorry for the formatting, not sure how to work this forum, guess the code is small enough that it isn't a big problem. Anyway I think I have found a bug in the supplied Jack compiler.

function void bar() {
        var int mask;
        let mask = mask + 1
        return;
}

The piece of code above is syntactically illformed, because it is missing a semicolon after the let statement. Normally I would expect to get a nice error message from the Jack compiler but instead it hangs forever. The error doesn't happen if I change it to a simple assignment but it does happen for other binary operators as well.

Regards
Pontus