Im currently writing a jass parser (to replace the syntax check of the world editor for performance sake), which starts off parsing the common.j and blizzard.j files (to gather functions, vars etc.)
Now, oddly, my program is giving me a syntax error in the blizzard.j. The bad function is this one:
This function seemingly manages to cast a trigger to an event, which is something one should not be capable of doing. Basically, if i copy and paste the function into my map script and rename it, the world editors very own parser will tell me that its not allowed.
Am i missing something, or is the blizzard.j just more powerful than what we can write?
Now, oddly, my program is giving me a syntax error in the blizzard.j. The bad function is this one:
JASS:
function TriggerRegisterDestDeathInRegionEvent takes trigger trig, rect r returns event
set bj_destInRegionDiesTrig = trig
set bj_destInRegionDiesCount = 0
call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionEnum)
return trig
endfunction
This function seemingly manages to cast a trigger to an event, which is something one should not be capable of doing. Basically, if i copy and paste the function into my map script and rename it, the world editors very own parser will tell me that its not allowed.
Am i missing something, or is the blizzard.j just more powerful than what we can write?