mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-02 19:29:21 +00:00
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:
parent
cd9a424499
commit
40bed0a93e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user