Allow application of the unary ! operator to floating constants.

The following is an example of a program that requires this:

#include <stdio.h>
int main(void)
{
    int true = !0.0;
    int false = !1.1;
    printf("%i %i\n", true, false);
}
This commit is contained in:
Stephen Heumann 2016-12-20 21:41:48 -06:00
parent cd9a424499
commit 40bed0a93e
1 changed files with 5 additions and 0 deletions

View File

@ -1341,6 +1341,11 @@ var
op^.token.kind := doubleConst;
op^.token.rval := -rop1;
end;
excch : begin {!}
op^.token.class := intConstant;
op^.token.kind := intconst;
op^.token.ival := ord(rop1 = 0.0);
end;
otherwise : begin {illegal operation}
Error(66);
op^.token.class := doubleConstant;