m1maker / NGT

New open source game toolkit
https://ngtcode.dev/
20 stars 11 forks source link

Script Fails to Compile without Error Messages When Method Called without Parentheses in For Loop #4

Open bobi6666 opened 6 months ago

bobi6666 commented 6 months ago

The script fails to compile when a method is called inside a for loop without using parentheses (). Instead of using parentheses, a semicolon ; is placed at the end of the method call. This causes the script to not compile, but surprisingly, it does not throw any error messages, leading to a silent failure.

Steps to Reproduce:

  1. Create a script with a for loop.
  2. Inside the for loop, call a method without using parentheses () but end the line with a semicolon ;.
  3. Attempt to compile the script.

Expected Behavior:

The script should either compile successfully if the syntax is correct, or it should throw an error message indicating the syntax issue when parentheses are omitted in the method call.

Actual Behavior:

The script does not compile, and no error messages are displayed, leading to a lack of feedback on the syntax error.

Possible Impact:

This issue can lead to significant debugging challenges, as the lack of error messages makes it difficult to pinpoint the syntax error in large codebases.

bobi6666 commented 6 months ago

example for(int i=0; i<tiles.length; i++) { }

bobi6666 commented 6 months ago

I found out by chance that the problem probably does not lie in the methods, but in the fact that if I press enter on the ngt file for the first time, it will show me a compilation error, but if I do not modify it but open it again, the error will no longer appear.