nojanath / SublimeKSP

Fork of Nils Liberg's SublimeKSP plugin. See README for details.
GNU General Public License v3.0
87 stars 18 forks source link

Combine Callbacks runs always even if disabled, and eradicates empty function declarations #324

Closed mkruselj closed 1 year ago

mkruselj commented 1 year ago

Try running this code with the current state of the repo (commit 39a5779):

on init
    declare ui_button (Button)
end on

function foo()
end function

on ui_control (Button)
    call foo()
end on

It will not compile, saying foo() was not declared. It's because since commit 4050e31, it turns out Combine Callbacks option runs always (in order to raise that parse error) even if disabled, without actually preventing callback combining from taking place, so foo() function declaration gets optimized away. This is a problem - we don't want to remove empty function declarations - there are good reasons to have them stick around!