mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:14:25 +02:00
pastojs: fixed multi add element position
git-svn-id: trunk@49122 -
(cherry picked from commit 204f2a3bc1
)
This commit is contained in:
parent
fabb4b45f3
commit
f90f5a390a
@ -9750,7 +9750,7 @@ begin
|
|||||||
B:=ConvertExpression(SubBin.right,AContext);
|
B:=ConvertExpression(SubBin.right,AContext);
|
||||||
if aResolver<>nil then
|
if aResolver<>nil then
|
||||||
begin
|
begin
|
||||||
aResolver.ComputeElement(El.right,RightResolved,Flags);
|
aResolver.ComputeElement(SubBin.right,RightResolved,Flags);
|
||||||
Result:=ConvertBinaryExpressionRes(SubBin,AContext,LeftResolved,RightResolved,A,B);
|
Result:=ConvertBinaryExpressionRes(SubBin,AContext,LeftResolved,RightResolved,A,B);
|
||||||
if (Result<>nil) then
|
if (Result<>nil) then
|
||||||
begin
|
begin
|
||||||
@ -9763,7 +9763,7 @@ begin
|
|||||||
if Result=nil then
|
if Result=nil then
|
||||||
begin
|
begin
|
||||||
// +
|
// +
|
||||||
R:=TJSBinary(CreateElement(TJSAdditiveExpressionPlus,El));
|
R:=TJSBinary(CreateElement(TJSAdditiveExpressionPlus,SubBin));
|
||||||
R.A:=A; A:=nil;
|
R.A:=A; A:=nil;
|
||||||
R.B:=B; B:=nil;
|
R.B:=B; B:=nil;
|
||||||
Result:=R;
|
Result:=R;
|
||||||
|
@ -3314,8 +3314,10 @@ procedure TTestModule.TestMultiAdd;
|
|||||||
begin
|
begin
|
||||||
StartProgram(false);
|
StartProgram(false);
|
||||||
Add([
|
Add([
|
||||||
|
'function Fly: string; external name ''fly'';',
|
||||||
'function TryEncodeDate(Year, Month, Day: Word): Boolean;',
|
'function TryEncodeDate(Year, Month, Day: Word): Boolean;',
|
||||||
'var Date: double;',
|
'var',
|
||||||
|
' Date: double;',
|
||||||
'begin',
|
'begin',
|
||||||
' Result:=(Year>0) and (Year<10000) and',
|
' Result:=(Year>0) and (Year<10000) and',
|
||||||
' (Month >= 1) and (Month<=12) and',
|
' (Month >= 1) and (Month<=12) and',
|
||||||
@ -3324,7 +3326,10 @@ begin
|
|||||||
'end;',
|
'end;',
|
||||||
'var s: string;',
|
'var s: string;',
|
||||||
'begin',
|
'begin',
|
||||||
' s:=''a''+''b''+''c''+''d'';']);
|
' s:=''a''+''b''+''c''+''d'';',
|
||||||
|
' s:=s+Fly+''e'';',
|
||||||
|
' s:=Fly+Fly+Fly;',
|
||||||
|
'']);
|
||||||
ConvertProgram;
|
ConvertProgram;
|
||||||
CheckSource('TestMultiAdd',
|
CheckSource('TestMultiAdd',
|
||||||
LinesToStr([ // statements
|
LinesToStr([ // statements
|
||||||
@ -3339,6 +3344,8 @@ begin
|
|||||||
'']),
|
'']),
|
||||||
LinesToStr([ // this.$main
|
LinesToStr([ // this.$main
|
||||||
'$mod.s = "a" + "b" + "c" + "d";',
|
'$mod.s = "a" + "b" + "c" + "d";',
|
||||||
|
'$mod.s = $mod.s + fly() + "e";',
|
||||||
|
'$mod.s = fly() + fly() + fly();',
|
||||||
'']));
|
'']));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user