|
@@ -127,7 +127,7 @@ implementation
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
globtype,systems,constexp,compinnr,
|
|
globtype,systems,constexp,compinnr,
|
|
cutils,verbose,globals,widestr,
|
|
cutils,verbose,globals,widestr,
|
|
- tokens,
|
|
|
|
|
|
+ tokens,
|
|
symconst,symdef,symsym,symcpu,symtable,defutil,defcmp,
|
|
symconst,symdef,symsym,symcpu,symtable,defutil,defcmp,
|
|
cgbase,
|
|
cgbase,
|
|
htypechk,pass_1,
|
|
htypechk,pass_1,
|
|
@@ -157,7 +157,8 @@ implementation
|
|
{ when a comp or currency is used, use always the
|
|
{ when a comp or currency is used, use always the
|
|
best float type to calculate the result }
|
|
best float type to calculate the result }
|
|
if (tfloatdef(t2).floattype in [s64comp,s64currency]) or
|
|
if (tfloatdef(t2).floattype in [s64comp,s64currency]) or
|
|
- (tfloatdef(t2).floattype in [s64comp,s64currency]) then
|
|
|
|
|
|
+ (tfloatdef(t2).floattype in [s64comp,s64currency]) or
|
|
|
|
+ (cs_excessprecision in current_settings.localswitches) then
|
|
result:=pbestrealtype^
|
|
result:=pbestrealtype^
|
|
else
|
|
else
|
|
if floatweight[tfloatdef(t2).floattype]>floatweight[tfloatdef(t1).floattype] then
|
|
if floatweight[tfloatdef(t2).floattype]>floatweight[tfloatdef(t1).floattype] then
|
|
@@ -1317,14 +1318,14 @@ implementation
|
|
|
|
|
|
{ allow operator overloading }
|
|
{ allow operator overloading }
|
|
hp:=self;
|
|
hp:=self;
|
|
-
|
|
|
|
- if is_dynamic_array(left.resultdef) and is_dynamic_array(right.resultdef) and
|
|
|
|
- (nodetype=addn) and
|
|
|
|
- (m_array_operators in current_settings.modeswitches) and
|
|
|
|
- isbinaryoverloaded(hp,[ocf_check_non_overloadable,ocf_check_only]) then
|
|
|
|
- message3(parser_w_operator_overloaded_hidden_3,left.resultdef.typename,arraytokeninfo[_PLUS].str,right.resultdef.typename);
|
|
|
|
-
|
|
|
|
- if isbinaryoverloaded(hp,[]) then
|
|
|
|
|
|
+
|
|
|
|
+ if is_dynamic_array(left.resultdef) and is_dynamic_array(right.resultdef) and
|
|
|
|
+ (nodetype=addn) and
|
|
|
|
+ (m_array_operators in current_settings.modeswitches) and
|
|
|
|
+ isbinaryoverloaded(hp,[ocf_check_non_overloadable,ocf_check_only]) then
|
|
|
|
+ message3(parser_w_operator_overloaded_hidden_3,left.resultdef.typename,arraytokeninfo[_PLUS].str,right.resultdef.typename);
|
|
|
|
+
|
|
|
|
+ if isbinaryoverloaded(hp,[]) then
|
|
begin
|
|
begin
|
|
result:=hp;
|
|
result:=hp;
|
|
exit;
|
|
exit;
|
|
@@ -1384,7 +1385,12 @@ implementation
|
|
if (right.resultdef.typ=floatdef) and
|
|
if (right.resultdef.typ=floatdef) and
|
|
(left.resultdef.typ=floatdef) and
|
|
(left.resultdef.typ=floatdef) and
|
|
(tfloatdef(left.resultdef).floattype=tfloatdef(right.resultdef).floattype) then
|
|
(tfloatdef(left.resultdef).floattype=tfloatdef(right.resultdef).floattype) then
|
|
- resultrealdef:=left.resultdef
|
|
|
|
|
|
+ begin
|
|
|
|
+ if cs_excessprecision in current_settings.localswitches then
|
|
|
|
+ resultrealdef:=pbestrealtype^
|
|
|
|
+ else
|
|
|
|
+ resultrealdef:=left.resultdef
|
|
|
|
+ end
|
|
{ when there is a currency type then use currency, but
|
|
{ when there is a currency type then use currency, but
|
|
only when currency is defined as float }
|
|
only when currency is defined as float }
|
|
else
|
|
else
|
|
@@ -3444,7 +3450,7 @@ implementation
|
|
{ Can we optimize multiple dyn. array additions into a single call?
|
|
{ Can we optimize multiple dyn. array additions into a single call?
|
|
This need to be done on a complete tree to detect the multiple
|
|
This need to be done on a complete tree to detect the multiple
|
|
add nodes and is therefor done before the subtrees are processed }
|
|
add nodes and is therefor done before the subtrees are processed }
|
|
- if (m_array_operators in current_settings.modeswitches) and canbemultidynarrayadd(self) then
|
|
|
|
|
|
+ if (m_array_operators in current_settings.modeswitches) and canbemultidynarrayadd(self) then
|
|
begin
|
|
begin
|
|
result:=genmultidynarrayadd(self);
|
|
result:=genmultidynarrayadd(self);
|
|
exit;
|
|
exit;
|