Debugger gives wrong error if missing a }

Report problems with documented functionality
steventaitinger
Posts: 20
Joined: 14 Jan 2014, 10:28
Contact:

Debugger gives wrong error if missing a }

17 Oct 2014, 16:16

Hi,

I have found several times that under certain circumstances if I am missing a } somewhere in my script than it will error out and give me an error that it can't find whatever the first library function I use is. In my case that is always Acc_x function in the Acc library in my lib folder. It threw me off for the longest time but after one time I put every acc function in my script then it finally gave me the missing } error that I needed.

Steve

Autohotkey 1.1.09.00
Windows 7 Enterprise 64 bit unicode
lexikos
Posts: 9599
Joined: 30 Sep 2013, 04:07
Contact:

Re: Debugger gives wrong error if missing a }

17 Oct 2014, 19:52

The program can't read your mind to know what code is intended to be inside the braces despite the brace missing. It just parses the code under the assumption that you've written it correctly, and reports the first problem that it encounters.

For instance, the error below is "Functions cannot contain functions", not "missing close brace":

Code: Select all

function1() {
    
function2() {
}
Library auto-includes are appended after the whole script is read, so by pasting them into your script you've probably changed their location relative to the braces.
steventaitinger
Posts: 20
Joined: 14 Jan 2014, 10:28
Contact:

Re: Debugger gives wrong error if missing a }

03 Dec 2014, 10:00

Thanks Lexikos! That doesn't fully makes sense to me as I put my functions at the end of the script too but if it isn't a bug than it doesn't matter. I will just have to watch my code more!
lexikos
Posts: 9599
Joined: 30 Sep 2013, 04:07
Contact:

Re: Debugger gives wrong error if missing a }

04 Dec 2014, 21:13

Auto-included files are added incrementally after some other parts of the main script (or prior auto-includes) have already been processed, which may include processing of braces. It is possible for pre-processing to halt at an error within the main file before the auto-include is even considered, so it's not just about location.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 17 guests