From be0b395f26eb5fb1020d9252ce06ce22e4c27529 Mon Sep 17 00:00:00 2001 From: miks1965 Date: Fri, 17 Aug 2018 23:07:18 +0300 Subject: [PATCH] fix #425 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- .../QuestionPointDesugarVisitor.cs | 2 +- TestSuite/errors/err0248.pas | 5 +++ bin/Lib/WPFObjects.pas | 38 ++++++++++++------- 6 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 TestSuite/errors/err0248.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 5629e5173..b6e984ffb 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "4"; public const string Build = "0"; - public const string Revision = "1746"; + public const string Revision = "1747"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index a16455dcc..b2218a0a6 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=4 -%REVISION%=1746 %COREVERSION%=0 +%REVISION%=1747 +%MINOR%=4 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index e00137479..05aa806ab 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.4.0.1746' +!define VERSION '3.4.0.1747' diff --git a/SyntaxVisitors/SugarVisitors/QuestionPointDesugarVisitor.cs b/SyntaxVisitors/SugarVisitors/QuestionPointDesugarVisitor.cs index bc6358a0a..c5bab6dda 100644 --- a/SyntaxVisitors/SugarVisitors/QuestionPointDesugarVisitor.cs +++ b/SyntaxVisitors/SugarVisitors/QuestionPointDesugarVisitor.cs @@ -156,7 +156,7 @@ namespace SyntaxVisitors.SugarVisitors public override void visit(dot_question_node dqn) { var st = dqn.Parent; - while (!(st is statement) /*&& (st != null)*/) + while ((st != null) && !(st is statement)) st = st.Parent; if (st == null) throw new SyntaxVisitorError("?._CANNOT_BE_IN_THIS_CONTEXT", dqn.source_context); diff --git a/TestSuite/errors/err0248.pas b/TestSuite/errors/err0248.pas new file mode 100644 index 000000000..6a718d236 --- /dev/null +++ b/TestSuite/errors/err0248.pas @@ -0,0 +1,5 @@ +var a := Arr(6,2,3); +var q := a?.Max; + +begin +end. \ No newline at end of file diff --git a/bin/Lib/WPFObjects.pas b/bin/Lib/WPFObjects.pas index f6b652028..a0961d492 100644 --- a/bin/Lib/WPFObjects.pas +++ b/bin/Lib/WPFObjects.pas @@ -189,7 +189,7 @@ type begin InitOb(x,y,w,h,o,SetWH); Color := c; - BorderColor := Colors.Black; + //BorderColor := Colors.Black; end; procedure EF(value: GColor) := Element.Fill := new SolidColorBrush(Value); procedure ES(value: GColor) := Element.Stroke := new SolidColorBrush(Value); @@ -395,6 +395,29 @@ type function GetInternalGeometry: Geometry; override := new EllipseGeometry(Center,Width/2,Height/2); end; + PolygonWPF = class(BoundedObjectWPF) + private + procedure InitOb2(pp: array of Point; c: GColor); + begin + var x1 := pp.Min(p->p.x); + var x2 := pp.Max(p->p.x); + var y1 := pp.Min(p->p.y); + var y2 := pp.Max(p->p.y); + var a := pp.Select(p->Pnt(p.x-x1,p.y-y1)).ToArray; + a.Println; + Println(x1,x2,y1,y2); + InitOb1(x1,x2,x2-x1,y2-y1,c,CreatePolygon(a)); + end; + function CreatePolygon(pp: array of Point): Polygon; + begin + var p := new Polygon(); + p.Points := new PointCollection(pp); + Result := p; + end; + public + constructor (pp: array of Point; c: GColor) := Invoke(InitOb2,pp,c); + end; + PictureWPF = class(ObjectWPF) private function CreateBitmapImage(fname: string) := new BitmapImage(new System.Uri(fname,System.UriKind.Relative)); @@ -424,19 +447,6 @@ type function GetInternalGeometry: Geometry; override := new RectangleGeometry(Rect(X,Y,Width,Height)); end; - {PolygonWPF = class(BoundedObjectWPF) - private - procedure InitOb2(c: GColor; pp: array of Point) := InitOb1(0,0,real.NaN,real.NaN,c,CreatePolygon(pp)); - function CreatePolygon(pp: array of Point): Polygon; - begin - var p := new Polygon(); - p.Points := new PointCollection(pp); - Result := p; - end; - public - constructor (pp: array of Point; c: GColor) := Invoke(InitOb2,c,pp); - end;} - /// Главное окно var Window: WindowType; /// Графическое окно