
{: test that 2 consecutive exponents cause a compilation error }

program e1004( output );

const m3 = -3;

var
   x,y :  real;
   i   :  integer;
begin
   i := 13;
   x := 12.5;
   y := 4.0;

   {integer exponents}
   x := ((-m3)**i)**3;  {OK}
   x := (-m3)**(i**3);  {OK}
   x := (-m3)**i**3;  {!!! 2 consecutive exponentiation operators}

   {real exponents}
   x := ((-m3)**y)**3.1;  {OK}
   x := (-m3)**(y**3.1);  {OK}
   x := (-m3)**y**3.1;  {!!! 2 consecutive exponentiation operators}

   writeln( 'exponentiation error not detected, x is ', x:1:1, ', i is ', i:1 );
end. { e1004 }

