Question: seems like bug in Maple mint

 

This proc is valid, yet Maple mint thinks there is syntax error

foo:= proc(x)
local z := "";
    if not x in ["A","B"] then
        return;
    fi;

    z:=cat("A
            B");    
end proc;

mint t.mpl gives

on line     7:     z:=cat("A
                          ^ Syntax error
A "then" was found without a previous matching "if".
An "end" may be needed to close the "in" construct from line 3.

But these two below procs below it gives no syntax error

foo:= proc(x)
local z := "";
    if not x in ["A","B"] then
        return;
    fi;  
end proc;

And

foo:= proc(x)
local z := "";
    z:=cat("A
            B");    
end proc;

No syntax error on either one. the syntax error only shows up when combining them. 

What does if not x in ["A","B"] then  have to do with the cat  below it? And why when they are combined, the syntax error shows?

I know of workaround, such as changing the cat to  z:=cat("A\nB");     or keep the strings on two lines, but do it like this

    z:=cat("A\n
           B");

Or write it like this

   z:=cat("A "
           "B"); 

But none of these changes were needed before adding the not x in ["A","B"]  before.

Is this a bug in mint? Is there a work around so the first example above still works using 

    z:=cat("A
            B");   

?

Please Wait...