• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Jass Helper error: missing endblock

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

I wrote some stuff, and then I got this error, which doesn't even point to the new code I added, it's saying there's an error in the map configuration, but I didn't write any code for map config...So I have no idea where to look, besides the new code I added but I can't seem to find the cause of the error.

5drupe.png


Edit: I did a brute force search (disabled each module one at a time) and found the error, I was missing an endif .

But why would this cause the syntax error to be somewhere entirely else, and not just an error: missing endif block?
Or did it really parse that if statements' statements to extend all the way to mapconfig?
 
Level 11
Joined
Oct 11, 2012
Messages
711
Hi,

I wrote some stuff, and then I got this error, which doesn't even point to the new code I added, it's saying there's an error in the map configuration, but I didn't write any code for map config...So I have no idea where to look, besides the new code I added but I can't seem to find the cause of the error.

5drupe.png


Edit: I did a brute force search (disabled each module one at a time) and found the error, I was missing an endif .

But why would this cause the syntax error to be somewhere entirely else, and not just an error: missing endif block?
Or did it really parse that if statements' statements to extend all the way to mapconfig?

I think its the problem of JassHelper. I never get a correct location of where the error is...
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
The world editor doesnt have a crystal ball which tells it what you intended the code to do.

If you have this:
JASS:
function bla takes nothing returns nothing
    if a < 5 then
        set a = 19
    call someFunction()
    call someOtherFunction()
    if b == true then
        set x = 2.2
    endif
    call poop()
endfunction

This function is missing a "endif" in line 4.

But since jass doesnt care about indention, who says the code shouldnt look like this:
JASS:
function bla takes nothing returns nothing
    if a < 5 then
        set a = 19
        call someFunction()
        call someOtherFunction()
        if b == true then
            set x = 2.2
        endif
        call poop()
endfunction
Now it looks like the "endif" is missing in line 10. But its really the same code, the worldeditor cannot know where the missing "endif" should go and is therefore unable to output the correct line.
 
Status
Not open for further replies.
Top