tree2code() now corrupts the prototype (was OK in 6.0.0): function y=test(x) => function [,y]=test(,x)
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
In Scilab 6.0.0 (and before):
-----------------------------
--> function y=test(x), endfunction
--> tree2code(macr2tree(test))
ans =
!function [y] = test(x) !
! !
!endfunction !
In Scilab 6.0.1
---------------
--> tree2code(macr2tree(test))
ans =
!function [,y] = test(,x) ! <<<< COMMA are wrongly introduced and corrupt the prototype
! !
!endfunction !
This is due to tree2code(), not macr2tree(): both trees provided by macr2tree() with 6.0.0 and 6.0.1 are strictly equal (when saved in 6.0.0, loaded in 6.0.1, and compared with the 6.0.1 one). We get:
--> tree==tree1
ans =
T T T T T T
ERROR LOG:
----------
None. Wrong output
HOW TO REPRODUCE THE BUG:
-------------------------
function y=test(x), endfunction
tree2code(macr2tree(test))
OTHER INFORMATION:
------------------
This hinders all functions based on tree2code().