So, if you are interested in how some code is generated from vJass to Jass, or from Zinc to vJass to Jass maybe, you may find this interesting.
This is also very useful to see the inlined output as well and I discovered this just today
Code:
Basically, if you want to see the exact Jass code inside war3map.j without opening it with some mpq editor, you will place
How this works: Basically, when you pass code to function, and try to pass that local(function's argument) into function, that expect return type of
Basically, the code up there will compile with Debug Mode on, but if you disable Debug Mode, it will pop error with the fully made code with inlined stuff and all the goodies and that is because a(function f) is inlined into Filter(function f), but clearly function f doesnt return boolean, but nothing
This is also very useful to see the inlined output as well and I discovered this just today
Code:
JASS:
library ShowJHOutput
//! textmacro SHOW_JH_CODE
private function a takes code c returns nothing
call Filter(c)
endfunction
private function b takes nothing returns nothing
endfunction
private function c takes nothing returns nothing
call a(function b)
endfunction
//! endtextmacro
endlibrary
Basically, if you want to see the exact Jass code inside war3map.j without opening it with some mpq editor, you will place
//! runtextmacro SHOW_JH_CODE()
, and compile.How this works: Basically, when you pass code to function, and try to pass that local(function's argument) into function, that expect return type of
boolean
it will not pop error even if the function returns nothing(exploited by http://www.hiveworkshop.com/forums/jass-resources-412/snippet-registerplayerunitevent-203338/) but when JassHelper's optimizer kicks in, it first optimizes and then checks for the function's return type.Basically, the code up there will compile with Debug Mode on, but if you disable Debug Mode, it will pop error with the fully made code with inlined stuff and all the goodies and that is because a(function f) is inlined into Filter(function f), but clearly function f doesnt return boolean, but nothing