|
@@ -256,41 +256,37 @@ implementation
|
|
end;
|
|
end;
|
|
{ we can't accept a equal in type }
|
|
{ we can't accept a equal in type }
|
|
pt1:=comp_expr(not(ignore_equal));
|
|
pt1:=comp_expr(not(ignore_equal));
|
|
- do_resulttypepass(pt1);
|
|
|
|
if (token=_POINTPOINT) then
|
|
if (token=_POINTPOINT) then
|
|
begin
|
|
begin
|
|
consume(_POINTPOINT);
|
|
consume(_POINTPOINT);
|
|
{ get high value of range }
|
|
{ get high value of range }
|
|
pt2:=comp_expr(not(ignore_equal));
|
|
pt2:=comp_expr(not(ignore_equal));
|
|
- do_resulttypepass(pt2);
|
|
|
|
|
|
+ { make both the same type }
|
|
|
|
+ inserttypeconv(pt1,pt2.resulttype);
|
|
{ both must be evaluated to constants now }
|
|
{ both must be evaluated to constants now }
|
|
if (pt1.nodetype=ordconstn) and
|
|
if (pt1.nodetype=ordconstn) and
|
|
(pt2.nodetype=ordconstn) then
|
|
(pt2.nodetype=ordconstn) then
|
|
begin
|
|
begin
|
|
- { check types }
|
|
|
|
- if CheckTypes(pt1.resulttype.def,pt2.resulttype.def) then
|
|
|
|
|
|
+ { Check bounds }
|
|
|
|
+ if tordconstnode(pt2).value<tordconstnode(pt1).value then
|
|
|
|
+ Message(cg_e_upper_lower_than_lower)
|
|
|
|
+ else
|
|
begin
|
|
begin
|
|
- { Check bounds }
|
|
|
|
- if tordconstnode(pt2).value<tordconstnode(pt1).value then
|
|
|
|
- Message(cg_e_upper_lower_than_lower)
|
|
|
|
- else
|
|
|
|
- begin
|
|
|
|
- { All checks passed, create the new def }
|
|
|
|
- case pt1.resulttype.def.deftype of
|
|
|
|
- enumdef :
|
|
|
|
- tt.setdef(tenumdef.create_subrange(tenumdef(pt1.resulttype.def),tordconstnode(pt1).value,tordconstnode(pt2).value));
|
|
|
|
- orddef :
|
|
|
|
- begin
|
|
|
|
- if is_char(pt1.resulttype.def) then
|
|
|
|
- tt.setdef(torddef.create(uchar,tordconstnode(pt1).value,tordconstnode(pt2).value))
|
|
|
|
- else
|
|
|
|
- if is_boolean(pt1.resulttype.def) then
|
|
|
|
- tt.setdef(torddef.create(bool8bit,tordconstnode(pt1).value,tordconstnode(pt2).value))
|
|
|
|
- else
|
|
|
|
- tt.setdef(torddef.create(uauto,tordconstnode(pt1).value,tordconstnode(pt2).value));
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
|
|
+ { All checks passed, create the new def }
|
|
|
|
+ case pt1.resulttype.def.deftype of
|
|
|
|
+ enumdef :
|
|
|
|
+ tt.setdef(tenumdef.create_subrange(tenumdef(pt1.resulttype.def),tordconstnode(pt1).value,tordconstnode(pt2).value));
|
|
|
|
+ orddef :
|
|
|
|
+ begin
|
|
|
|
+ if is_char(pt1.resulttype.def) then
|
|
|
|
+ tt.setdef(torddef.create(uchar,tordconstnode(pt1).value,tordconstnode(pt2).value))
|
|
|
|
+ else
|
|
|
|
+ if is_boolean(pt1.resulttype.def) then
|
|
|
|
+ tt.setdef(torddef.create(bool8bit,tordconstnode(pt1).value,tordconstnode(pt2).value))
|
|
|
|
+ else
|
|
|
|
+ tt.setdef(torddef.create(uauto,tordconstnode(pt1).value,tordconstnode(pt2).value));
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
@@ -590,7 +586,10 @@ implementation
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.23 2001-04-13 01:22:13 peter
|
|
|
|
|
|
+ Revision 1.24 2001-06-03 20:16:19 peter
|
|
|
|
+ * allow int64 in range declaration for new types
|
|
|
|
+
|
|
|
|
+ Revision 1.23 2001/04/13 01:22:13 peter
|
|
* symtable change to classes
|
|
* symtable change to classes
|
|
* range check generation and errors fixed, make cycle DEBUG=1 works
|
|
* range check generation and errors fixed, make cycle DEBUG=1 works
|
|
* memory leaks fixed
|
|
* memory leaks fixed
|