blougvision / addi

Automatically exported from code.google.com/p/addi
0 stars 0 forks source link

elseif #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a file called testfunc.m with the code:

function t=testfunc(n)
if n==1
    t=13;
elseif n==2
    t=121;
else
    t=31;
end

2. navigate with addi to the directory of the file testfunc.m, and call the 
function testfunc with a parameter: testfunc(2)

What is the expected output? What do you see instead?

expected output:
ans = 121

What do you see instead?
Error: PARSER: if missing(

What version of the product are you using? On what operating system?
Addi 1.8
Android OS, v2.3 (Gingerbread)

Please provide any additional information below.
In matlab an if statement can have an arbitrary number of branches starting 
with elseif. Both matlab and Octave execute the above code without 
errormessages. But addi does not seem to recognize elseif, and outputs the 
error message "Error: PARSER: if missing(", if the keyword elseif occurs at 
least once. As the goal is for 100 % Octave compliance, one might expect that 
addi recognizes elseif.

Original issue reported on code.google.com by TristanB...@gmail.com on 10 Nov 2011 at 12:28

GoogleCodeExporter commented 8 years ago
remember that it is a goal...there is no statement that it is working fully 
yet.  thanks for the bug.  

Original comment by corbi...@gmail.com on 10 Nov 2011 at 12:56

GoogleCodeExporter commented 8 years ago
fixed in latest version.  it was expecting elseif (condtion) with the 
parenthesis in the parser.  fixed previous issue where if was expecting 
(condition), but wasn't thorough enough to check elseif as well.  

Original comment by corbi...@gmail.com on 10 Nov 2011 at 7:17