fix #1934
This commit is contained in:
parent
835a811f51
commit
79bdbecec0
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "5";
|
public const string Minor = "5";
|
||||||
public const string Build = "0";
|
public const string Build = "0";
|
||||||
public const string Revision = "2188";
|
public const string Revision = "2189";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%COREVERSION%=0
|
|
||||||
%REVISION%=2188
|
|
||||||
%MINOR%=5
|
%MINOR%=5
|
||||||
|
%REVISION%=2189
|
||||||
|
%COREVERSION%=0
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.5.0.2188'
|
!define VERSION '3.5.0.2189'
|
||||||
|
|
|
||||||
|
|
@ -1720,6 +1720,10 @@ namespace PascalABCCompiler.SyntaxTree
|
||||||
{
|
{
|
||||||
return new SyntaxTree.dot_node(this, id, sc);
|
return new SyntaxTree.dot_node(this, id, sc);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Сервисное поле для реализации механизма ?. Оно - типа question_colon_expression
|
||||||
|
/// </summary>
|
||||||
|
public object ExprToQCE = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class expression
|
public partial class expression
|
||||||
|
|
|
||||||
|
|
@ -163,19 +163,28 @@ namespace SyntaxVisitors.SugarVisitors
|
||||||
if (st == null)
|
if (st == null)
|
||||||
throw new SyntaxVisitorError("?._CANNOT_BE_IN_THIS_CONTEXT", dqn.source_context);
|
throw new SyntaxVisitorError("?._CANNOT_BE_IN_THIS_CONTEXT", dqn.source_context);
|
||||||
var tname = "#dqn_temp" + UniqueNumStr();
|
var tname = "#dqn_temp" + UniqueNumStr();
|
||||||
var tt = new var_statement(new ident(tname), dqn.left, dqn.source_context);
|
|
||||||
|
dot_question_node rif = null;
|
||||||
|
var qce = ConvertToQCE1(dqn, tname);
|
||||||
|
if (qce.ret_if_false is dot_question_node dn)
|
||||||
|
{
|
||||||
|
rif = dn;
|
||||||
|
var expr = new question_colon_expression(qce.condition, qce.ret_if_true, rif.left);
|
||||||
|
rif.left.ExprToQCE = expr;
|
||||||
|
}
|
||||||
|
var sug = sugared_addressed_value.NewP(dqn, qce, dqn.source_context);
|
||||||
|
ReplaceUsingParent(dqn, sug);
|
||||||
|
//Replace(dqn, sug); // Этот не подходит!
|
||||||
|
|
||||||
|
var dl = (dqn.left.ExprToQCE == null ? dqn.left : dqn.left.ExprToQCE) as addressed_value;
|
||||||
|
var tt = new var_statement(new ident(tname), dl, dqn.source_context);
|
||||||
tt.var_def.Parent = tt;
|
tt.var_def.Parent = tt;
|
||||||
var l = new List<statement>();
|
var l = new List<statement>();
|
||||||
l.Add(tt);
|
l.Add(tt);
|
||||||
l.Add(st as statement);
|
l.Add(st as statement);
|
||||||
|
|
||||||
var qce = ConvertToQCE1(dqn, tname);
|
|
||||||
var sug = sugared_addressed_value.NewP(dqn, qce, dqn.source_context);
|
|
||||||
//ReplaceUsingParent(dqn, sug);
|
|
||||||
Replace(dqn, sug); // SSM 30/09/18
|
|
||||||
visit(qce);
|
|
||||||
|
|
||||||
ReplaceStatementUsingParent(st as statement, l);
|
ReplaceStatementUsingParent(st as statement, l);
|
||||||
|
visit(qce);
|
||||||
visit(tt);
|
visit(tt);
|
||||||
}
|
}
|
||||||
/*public override void visit(dot_question_node dqn)
|
/*public override void visit(dot_question_node dqn)
|
||||||
|
|
|
||||||
|
|
@ -577,6 +577,10 @@ type
|
||||||
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure): AnimationBase;
|
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure): AnimationBase;
|
||||||
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд
|
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд
|
||||||
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real := 1): AnimationBase := AnimRotateAt(axis,angle,center,seconds,nil);
|
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real := 1): AnimationBase := AnimRotateAt(axis,angle,center,seconds,nil);
|
||||||
|
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд. В конце анимации выполняется процедура Completed
|
||||||
|
function AnimRotateAtAbsolute(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure): AnimationBase;
|
||||||
|
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд
|
||||||
|
function AnimRotateAtAbsolute(axis: Vector3D; angle: real; center: Point3D; seconds: real := 1): AnimationBase := AnimRotateAtAbsolute(axis,angle,center,seconds,nil);
|
||||||
|
|
||||||
/// Клонирует 3D-объект
|
/// Клонирует 3D-объект
|
||||||
function Clone: Object3D := Invoke&<Object3D>(CloneT);
|
function Clone: Object3D := Invoke&<Object3D>(CloneT);
|
||||||
|
|
@ -673,6 +677,8 @@ type
|
||||||
public
|
public
|
||||||
/// Добавить дочерний подобъект
|
/// Добавить дочерний подобъект
|
||||||
procedure AddChild(obj: Object3D) := Invoke(AddT, obj);
|
procedure AddChild(obj: Object3D) := Invoke(AddT, obj);
|
||||||
|
/// Удалить дочерний подобъект
|
||||||
|
procedure RemoveChild(obj: Object3D) := Invoke(RemoveT, obj);
|
||||||
/// i-тый дочерний подобъект
|
/// i-тый дочерний подобъект
|
||||||
property Items[i: integer]: Object3D read GetObj; default;
|
property Items[i: integer]: Object3D read GetObj; default;
|
||||||
|
|
||||||
|
|
@ -767,6 +773,14 @@ type
|
||||||
foreach var xx in lst do
|
foreach var xx in lst do
|
||||||
AddChild(xx);
|
AddChild(xx);
|
||||||
end;
|
end;
|
||||||
|
public
|
||||||
|
procedure UnGroup;
|
||||||
|
begin
|
||||||
|
for var i := l.Count-1 downto 0 do
|
||||||
|
begin
|
||||||
|
RemoveChild(l[i]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
/// ВОзвращает клон группы 3D-объектов
|
/// ВОзвращает клон группы 3D-объектов
|
||||||
function Clone := (inherited Clone) as Group3D;
|
function Clone := (inherited Clone) as Group3D;
|
||||||
|
|
@ -1282,8 +1296,10 @@ type
|
||||||
begin
|
begin
|
||||||
el := new RotateTransform3D();
|
el := new RotateTransform3D();
|
||||||
el.Rotation := new AxisAngleRotation3D();
|
el.Rotation := new AxisAngleRotation3D();
|
||||||
|
|
||||||
Element.transfgroup.Children.Insert(0,el); // До основной матрицы, связанной с поворотом
|
if Absolute then
|
||||||
|
Element.transfgroup.Children.Add(el) // После основной матрицы, связанной с поворотом
|
||||||
|
else Element.transfgroup.Children.Insert(0,el); // До основной матрицы, связанной с поворотом
|
||||||
var rottransform := el;
|
var rottransform := el;
|
||||||
rottransform.CenterX := center.x;
|
rottransform.CenterX := center.x;
|
||||||
rottransform.CenterY := center.y;
|
rottransform.CenterY := center.y;
|
||||||
|
|
@ -1309,9 +1325,20 @@ type
|
||||||
(vx, vy, vz, angle, center) := (vvx, vvy, vvz, a, c)
|
(vx, vy, vz, angle, center) := (vvx, vvy, vvz, a, c)
|
||||||
end;
|
end;
|
||||||
public
|
public
|
||||||
|
auto property Absolute: boolean;
|
||||||
function Clone: AnimationBase; override := new RotateAtAnimation(Element,Seconds,vx,vy,vz,angle,center,nil);
|
function Clone: AnimationBase; override := new RotateAtAnimation(Element,Seconds,vx,vy,vz,angle,center,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
RotateAtAbsoluteAnimation = class(RotateAtAnimation)
|
||||||
|
public
|
||||||
|
constructor(e: Object3D; sec: real; vvx, vvy, vvz, a: real; c: Point3D; Completed: procedure := nil);
|
||||||
|
begin
|
||||||
|
inherited Create(e,sec,vvx,vvy,vvz,a,c,Completed);
|
||||||
|
Absolute := True;
|
||||||
|
end;
|
||||||
|
function Clone: AnimationBase; override := new RotateAtAbsoluteAnimation(Element,Seconds,vx,vy,vz,angle,center,nil);
|
||||||
|
end;
|
||||||
|
|
||||||
CompositeAnimation = class(AnimationBase)
|
CompositeAnimation = class(AnimationBase)
|
||||||
private
|
private
|
||||||
ll: List<AnimationBase>;
|
ll: List<AnimationBase>;
|
||||||
|
|
@ -2696,6 +2723,8 @@ function Object3D.AnimRotate(vx, vy, vz, angle, seconds: real; Completed: proced
|
||||||
|
|
||||||
function Object3D.AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure) := new RotateAtAnimation(Self, seconds, axis.X, axis.y, axis.z, angle, center, Completed);
|
function Object3D.AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure) := new RotateAtAnimation(Self, seconds, axis.X, axis.y, axis.z, angle, center, Completed);
|
||||||
|
|
||||||
|
function Object3D.AnimRotateAtAbsolute(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure) := new RotateAtAbsoluteAnimation(Self, seconds, axis.X, axis.y, axis.z, angle, center, Completed);
|
||||||
|
|
||||||
procedure Object3D.AddToObject3DList := Object3DList.Add(Self);
|
procedure Object3D.AddToObject3DList := Object3DList.Add(Self);
|
||||||
|
|
||||||
procedure Object3D.DeleteFromObject3DList;
|
procedure Object3D.DeleteFromObject3DList;
|
||||||
|
|
|
||||||
17
TestSuite/dqn_2.pas
Normal file
17
TestSuite/dqn_2.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
type A = class
|
||||||
|
x: A;
|
||||||
|
o: object := 999;
|
||||||
|
constructor Create;
|
||||||
|
begin
|
||||||
|
x := Self;
|
||||||
|
end;
|
||||||
|
procedure p;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
var q: A := new A;
|
||||||
|
var ob := q?.x?.o;
|
||||||
|
Assert(integer(ob) = 999);
|
||||||
|
end.
|
||||||
|
|
@ -577,6 +577,10 @@ type
|
||||||
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure): AnimationBase;
|
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure): AnimationBase;
|
||||||
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд
|
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд
|
||||||
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real := 1): AnimationBase := AnimRotateAt(axis,angle,center,seconds,nil);
|
function AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real := 1): AnimationBase := AnimRotateAt(axis,angle,center,seconds,nil);
|
||||||
|
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд. В конце анимации выполняется процедура Completed
|
||||||
|
function AnimRotateAtAbsolute(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure): AnimationBase;
|
||||||
|
/// Возвращает анимацию поворота объекта вокруг вектора axis, направленного из точки center, на величину angle за seconds секунд
|
||||||
|
function AnimRotateAtAbsolute(axis: Vector3D; angle: real; center: Point3D; seconds: real := 1): AnimationBase := AnimRotateAtAbsolute(axis,angle,center,seconds,nil);
|
||||||
|
|
||||||
/// Клонирует 3D-объект
|
/// Клонирует 3D-объект
|
||||||
function Clone: Object3D := Invoke&<Object3D>(CloneT);
|
function Clone: Object3D := Invoke&<Object3D>(CloneT);
|
||||||
|
|
@ -673,6 +677,8 @@ type
|
||||||
public
|
public
|
||||||
/// Добавить дочерний подобъект
|
/// Добавить дочерний подобъект
|
||||||
procedure AddChild(obj: Object3D) := Invoke(AddT, obj);
|
procedure AddChild(obj: Object3D) := Invoke(AddT, obj);
|
||||||
|
/// Удалить дочерний подобъект
|
||||||
|
procedure RemoveChild(obj: Object3D) := Invoke(RemoveT, obj);
|
||||||
/// i-тый дочерний подобъект
|
/// i-тый дочерний подобъект
|
||||||
property Items[i: integer]: Object3D read GetObj; default;
|
property Items[i: integer]: Object3D read GetObj; default;
|
||||||
|
|
||||||
|
|
@ -767,6 +773,14 @@ type
|
||||||
foreach var xx in lst do
|
foreach var xx in lst do
|
||||||
AddChild(xx);
|
AddChild(xx);
|
||||||
end;
|
end;
|
||||||
|
public
|
||||||
|
procedure UnGroup;
|
||||||
|
begin
|
||||||
|
for var i := l.Count-1 downto 0 do
|
||||||
|
begin
|
||||||
|
RemoveChild(l[i]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
/// ВОзвращает клон группы 3D-объектов
|
/// ВОзвращает клон группы 3D-объектов
|
||||||
function Clone := (inherited Clone) as Group3D;
|
function Clone := (inherited Clone) as Group3D;
|
||||||
|
|
@ -1282,8 +1296,10 @@ type
|
||||||
begin
|
begin
|
||||||
el := new RotateTransform3D();
|
el := new RotateTransform3D();
|
||||||
el.Rotation := new AxisAngleRotation3D();
|
el.Rotation := new AxisAngleRotation3D();
|
||||||
|
|
||||||
Element.transfgroup.Children.Insert(0,el); // До основной матрицы, связанной с поворотом
|
if Absolute then
|
||||||
|
Element.transfgroup.Children.Add(el) // После основной матрицы, связанной с поворотом
|
||||||
|
else Element.transfgroup.Children.Insert(0,el); // До основной матрицы, связанной с поворотом
|
||||||
var rottransform := el;
|
var rottransform := el;
|
||||||
rottransform.CenterX := center.x;
|
rottransform.CenterX := center.x;
|
||||||
rottransform.CenterY := center.y;
|
rottransform.CenterY := center.y;
|
||||||
|
|
@ -1309,9 +1325,20 @@ type
|
||||||
(vx, vy, vz, angle, center) := (vvx, vvy, vvz, a, c)
|
(vx, vy, vz, angle, center) := (vvx, vvy, vvz, a, c)
|
||||||
end;
|
end;
|
||||||
public
|
public
|
||||||
|
auto property Absolute: boolean;
|
||||||
function Clone: AnimationBase; override := new RotateAtAnimation(Element,Seconds,vx,vy,vz,angle,center,nil);
|
function Clone: AnimationBase; override := new RotateAtAnimation(Element,Seconds,vx,vy,vz,angle,center,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
RotateAtAbsoluteAnimation = class(RotateAtAnimation)
|
||||||
|
public
|
||||||
|
constructor(e: Object3D; sec: real; vvx, vvy, vvz, a: real; c: Point3D; Completed: procedure := nil);
|
||||||
|
begin
|
||||||
|
inherited Create(e,sec,vvx,vvy,vvz,a,c,Completed);
|
||||||
|
Absolute := True;
|
||||||
|
end;
|
||||||
|
function Clone: AnimationBase; override := new RotateAtAbsoluteAnimation(Element,Seconds,vx,vy,vz,angle,center,nil);
|
||||||
|
end;
|
||||||
|
|
||||||
CompositeAnimation = class(AnimationBase)
|
CompositeAnimation = class(AnimationBase)
|
||||||
private
|
private
|
||||||
ll: List<AnimationBase>;
|
ll: List<AnimationBase>;
|
||||||
|
|
@ -2696,6 +2723,8 @@ function Object3D.AnimRotate(vx, vy, vz, angle, seconds: real; Completed: proced
|
||||||
|
|
||||||
function Object3D.AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure) := new RotateAtAnimation(Self, seconds, axis.X, axis.y, axis.z, angle, center, Completed);
|
function Object3D.AnimRotateAt(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure) := new RotateAtAnimation(Self, seconds, axis.X, axis.y, axis.z, angle, center, Completed);
|
||||||
|
|
||||||
|
function Object3D.AnimRotateAtAbsolute(axis: Vector3D; angle: real; center: Point3D; seconds: real; Completed: procedure) := new RotateAtAbsoluteAnimation(Self, seconds, axis.X, axis.y, axis.z, angle, center, Completed);
|
||||||
|
|
||||||
procedure Object3D.AddToObject3DList := Object3DList.Add(Self);
|
procedure Object3D.AddToObject3DList := Object3DList.Add(Self);
|
||||||
|
|
||||||
procedure Object3D.DeleteFromObject3DList;
|
procedure Object3D.DeleteFromObject3DList;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue