SQFvm / runtime

Custom implementation of the Arma script language SQF
GNU Lesser General Public License v3.0
98 stars 30 forks source link

[BUG] compileFinal keyword does not compile correctly #168

Closed NeutraleNull closed 3 years ago

NeutraleNull commented 3 years ago

Describe the bug

SQC:

final function getMiddle(xPos,yPos) { return [xPos+(cellSize/2), yPos+(cellSize/2)]; }

SQF: getMiddle= compileFinal "{ scopename ""___sqc_func""; params [""_xpos"", ""_ypos""]; [_xpos + cellsize / 2, _ypos + cellsize / 2] breakout ""___sqc_func"" }"; [1,2] call getMiddle;

Result: => { scopename "___sqc_func"; params ["_xpos", "_ypos"]; [_xpos + cellsize / 2, _ypos + cellsize / 2] breakout "___sqc_func" }

It does not return the expected result but the functioncode

To Reproduce Steps to reproduce the behavior: copy and paste it the editor

Expected behavior function should be compiled and stored in the variable correctly.

Screenshots

Additional context