increpare / PuzzleScript

Open Source HTML5 Puzzle Game Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent behaviour on compile with errors

david-pfx opened this issue · comments

MAX_ERRORS is set to 5 in compiler.js. If this limit is hit the compiler emits a console message and exits.

The HTML system error message 'Errors detected during compilation' is then not hit, so there is no error message during export. A bad export will fail silently.

MAX_ERRORS_FOR_REAL is set to 100 in parser.js, so the function TooManyErrors() and its message is never hit.

Suggested fix: remove MAX_ERRORS and any tests using it.

example file
https://www.puzzlescript.net/editor.html?hack=d12f7d3b74015e7b407eca3186905618

note that building produces errors to the console, but if you export, the downloaded file doesn't show any errors

(if you remove one of the 'objects' lines, and fewer errors are generated, they are once again displayed in the exported file)