1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2009 - DIGITEO - Vincent COUVERT
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- JVM NOT MANDATORY -->
// <-- Non-regression test for bug 3543 -->
//
// <-- Bugzilla URL -->
// http://bugzilla.scilab.org/show_bug.cgi?id=3543
//
// <-- Short Description -->
// Wrong parenthesize in struct indices (code generated by tree2code).
testtxt = ["function bug_3543()";
"index = 12;";
"st.name = ""test"";";
"st.value(1,index) = index;";
"a = st.val(1,index);";
"endfunction"];
mputl(testtxt, TMPDIR+filesep()+"bug_3543.sci");
exec(TMPDIR+filesep()+"bug_3543.sci");
generated = tree2code(macr2tree(bug_3543));
if generated(4)<>testtxt(4) | generated(5)<>testtxt(5) then bugmes();quit;end
|