1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// <-- Non-regression test for bug 1636 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1636
//
// <-- Short Description -->
// When processing an m-file with multiple continuation lines in the
// initial funtion statement, i.e the first line, I received an index
// error in line 181 of m2sci_syntax. On investigation, I found the index
// k was zero and traced this to lines 141 and 171 which set k=k-1 after
// appending line k to line k-1. I have produced a modified
// m2sci_syntax.sci file with the line if k<> 1 then k=k-1; end instead of
// k=k-1 for lines 141 and 181 which seems to work OK. No errors and
// produces an sci file
// Copyright INRIA
// Scilab Project - F. Belahcene
MFILECONTENTS=["function A = bug1636(x,y,...";
"z,t,...";
"u,v,w,...";
"z)";
"a=x+y+z+t+u+v+w+z;"]
MFILE=TMPDIR+"/bug1636.m"
SCIFILE=TMPDIR+"/bug1636.sci"
mputl(MFILECONTENTS,MFILE);
mfile2sci(MFILE,TMPDIR,%f,%t);
SCIFILECONTENTS=mgetl(SCIFILE);
SCIFILECONTENTSREF=["function [A] = bug1636(x,y,z,t,u,v,w,z)";
"";
"// Ouput variables initialisation (not found in input variables)"
"A=[];";
"";
"// Display mode";
"mode(0);"
"";
"// Display warning for floating point exception";
"ieee(1);";
"";
"";
"";
"";
"a = mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(mtlb_a(x,y),z),t),u),v),w),z);"
"endfunction"]
if or(SCIFILECONTENTSREF<>SCIFILECONTENTS) then
affich_result(%F,1636);
else
affich_result(%T,1636);
end
|