Page MenuHomeFeedback Tracker

Script compiler doesn't generate an error on a missing close curly brace
New, NormalPublic

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Scripting
Steps To Reproduce

Enter the following script into the debug console of a mission and press LOCAL EXEC. Note the lack of a closing curly brace on the spawn block.

[] spawn
{
    while { true } do
    {
        systemchat format ["Hello %1", diag_tickTime];
        sleep 1;
    }

Add the closing curly brace, press LOCAL_EXEC and the script will spawn.

Misspell "systemchat", press LOCAL EXEC and the compiler will report an error.

Additional Information

The first time this happened to me, I was stuck for hours. I never considered that a compiler wouldn't report a basic syntax error.

Note that the author of a large mission or mod can have a terrible time figuring out what went wrong. Symbols will simply be undefined, and the scripting language is pretty tolerant of undefined symbols, meaning even less information to go by.

Event Timeline

JB47394 created this task.Feb 18 2018, 4:46 PM