diff --git a/pcomp/pcomp.pas b/pcomp/pcomp.pas index 8c8c310..89d5ff9 100644 --- a/pcomp/pcomp.pas +++ b/pcomp/pcomp.pas @@ -3517,6 +3517,9 @@ begin GtEqToken: begin emitSwap; emitSetIsSubset; end; end; + if tok in [ EqToken, NotEqToken, LtEqToken, GtEqToken ] then + setBaseType(typeA, BooleanType); + tok := curToken.tokenKind; end; end; @@ -5076,6 +5079,7 @@ end; Otherwise, you should pass a MemLocation instance where the memLoc field is set to NoMem. A temporary is then created and its MemLocation passed back in optionalDest. + FIXME: this is not implemented? A temporary is always created. Argument passing: Args are passed on the eval stack. diff --git a/tests/settest.pas b/tests/settest.pas new file mode 100644 index 0000000..13cfa48 --- /dev/null +++ b/tests/settest.pas @@ -0,0 +1,11 @@ +program settest; +type myset = set of (alpha, beta, gamma, delta); +var a,b:myset; +begin + a := [alpha, gamma]; + b := [alpha, gamma, delta]; + writeln (a <= b); + writeln (a >= b); + writeln (b >= a); + writeln ((b - [alpha, gamma]) >= a); +end.