Replace fun2string by tree2code(macr2tree()) after fun2string removal (https://codere... 98/16798/1
Vincent COUVERT [Mon, 6 Jul 2015 13:10:24 +0000 (15:10 +0200)]
Test: test_run core bug_8531

Change-Id: I70fde009b552172e0f12cde8f69e6b20ec65de93

scilab/modules/core/macros/edit.sci

index d3768ba..3fcd592 100644 (file)
@@ -53,8 +53,7 @@ function edit(macroname,linenumber)
                 found = isfile(fname);
             elseif isdef(macroname)
                 if typeof(evstr(macroname)) == "function" then
-                    txt = fun2string(evstr(macroname));
-                    txt = strsubst(txt, "=ans(", " = " + macroname + "(");
+                    txt = tree2code(macr2tree(evstr(macroname)));
                     fname = tmpfile;
                     mputl(txt, fname);
                     found = %t;