From 40bed0a93eab0e0204f1ea87992fa6fda499a6cd Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 20 Dec 2016 21:41:48 -0600 Subject: [PATCH] Allow application of the unary ! operator to floating constants. The following is an example of a program that requires this: #include int main(void) { int true = !0.0; int false = !1.1; printf("%i %i\n", true, false); } --- Expression.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Expression.pas b/Expression.pas index 2350723..683b742 100644 --- a/Expression.pas +++ b/Expression.pas @@ -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;