{: test that enum & constant expression syntax errors are well handled }

program e1062( output );

type
   colour = ( black, brown, red, orange, yellow, green, blue, violet, grey, white);

const
   cm  = pred(maxchar);
   ncm = ord(cm);

type
   t01 = (chr(ord(cm) div 2)) .. maxchar;  {OK}
   t02 = t01;                              {OK}
   t03 = cm .. maxchar;                    {OK}
   t04 = (cm) .. maxchar;                  {OK}
   t05 = (cm1,cm2,cm3);                    {OK}
   t06 = (cm0);                            {OK}
   e01 = (chr(ord(cm) div 2) .. maxchar;   {!!! missing rparen}
   e02 = (chr(ord(cm) div 2))) .. maxchar; {!!! extra lparen}
   t11 = (chr(ord(cm) div 2)) ... maxchar; {!!! range symbol error}
   t12 = (cm) ... maxchar;                 {!!! range symbol error}
   t13 = (cm) . . maxchar;                 {!!! range symbol error}
   t14 = cm ... maxchar;                   {!!! range symbol error}
   t15 = cm . . maxchar;                   {!!! range symbol error}

   t21 = (ch(ord(cm) div 2)) .. maxchar;   {!!! ch undefined}
   t22 = (char(ord(cm) div 2)) .. maxchar; {!!! char is a type}
   t23 = (chr(ord(cm) / 2)) .. maxchar;    {!!! ch undefined}
   t24 = (ncm / 2) .. ord(maxchar);        {!!! / is real operator}
   t25 = ncm/2 .. ord(maxchar);            {!!! / is real operator}

   t31 = (one;


var
   e : colour;
   n : integer;
   s : packed array[1..20] of char;

begin { e1062 }

   e := black;
   n := 2;

   writeln( 'constant expression syntax error not detected' );
end. { e1062 }

