vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.16k stars 138 forks source link

Ambiguous nested if-statements #64

Open tueda opened 8 years ago

tueda commented 8 years ago

Mixing use of the two versions of if-statements in a nested construct can be ambiguous. Consider the following code:

S x,y;
L F = x;
if (count(x,1))
  if (count(y,1));
    P "FOUND: %t";  * Expected to be executed when the term has both x and y.
  endif;
.end

which is parsed as (with -y option)

    S x,y;
 S,x,y
    L F = x;
 L,F=x
    if (count(x,1))
      if (count(y,1));
 if,(count(x,1))if(count(y,1))
        P "FOUND: %t";  *
 P,"FOUND: %t"
     Expected to be executed when the term has both x and y.
      endif;
 endif
    .end

but running this program prints

FOUND:  + x