diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 8e1d01f16..2bb6198c3 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 = "6"; public const string Build = "3"; - public const string Revision = "2564"; + public const string Revision = "2568"; 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 50db45a90..492a655b8 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %COREVERSION%=3 -%REVISION%=2564 +%REVISION%=2568 %MINOR%=6 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 0517e9151..e287b0672 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.6.3.2564 +3.6.3.2568 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 62635e3dc..553380969 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.6.3.2564' +!define VERSION '3.6.3.2568' diff --git a/TestSuite/CompilationSamples/GlobalTupleInit.pas b/TestSuite/CompilationSamples/GlobalTupleInit.pas index 1433bae60..7827bab96 100644 --- a/TestSuite/CompilationSamples/GlobalTupleInit.pas +++ b/TestSuite/CompilationSamples/GlobalTupleInit.pas @@ -1,5 +1,5 @@ -var (a,b) := (1,2); +var (a,b) := (1,2); begin - + //Print(b); end. \ No newline at end of file diff --git a/TestSuite/CompilationSamples/GraphWPF.pas b/TestSuite/CompilationSamples/GraphWPF.pas index 69a0fe4ee..fc456e094 100644 --- a/TestSuite/CompilationSamples/GraphWPF.pas +++ b/TestSuite/CompilationSamples/GraphWPF.pas @@ -208,6 +208,8 @@ type property Width: real read GetWidth; /// Высота графического окна property Height: real read GetHeight; + /// Клиентский прямоугольник графического окна + function ClientRect: GRect; /// Центр графического окна function Center: Point; /// Сохраняет содержимое графического окна в файл с именем fname @@ -1670,6 +1672,8 @@ end; function GraphWindowType.Center: Point := Pnt(Width/2,Height/2); +function GraphWindowType.ClientRect: GRect := Rect(0,0,Width,Height); + procedure WindowTypeWPF.Save(fname: string) := GraphWindow.Save(fname); diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 02e7b114f..993710d8a 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -20666,7 +20666,8 @@ namespace PascalABCCompiler.TreeConverter //var tt = new var_statement(new ident(tname), new semantic_addr_value(expr)); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название var tt = new var_statement(new ident(tname), asstup.expr); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название - var st = new statement_list(tt); + var st = new statement_list(new SyntaxTree.empty_statement()); + st.Add(tt); var n = asstup.vars.variables.Count(); for (var i = 0; i < n; i++) @@ -20676,7 +20677,7 @@ namespace PascalABCCompiler.TreeConverter asstup.vars.variables[i].source_context); st.Add(a); } - visit(st); + //visit(st); // Замена 1 оператор на 1 оператор - всё OK ReplaceUsingParent(asstup, st);*/ } @@ -20691,18 +20692,19 @@ namespace PascalABCCompiler.TreeConverter var tt = new var_statement(new ident(tname), assvartup.expr); // тут для assvartup.expr внутри повторно вызывается convert_strong, это плохо, но если там лямбда, то иначе - с semantic_addr_value - не работает!!! //var tt = new var_statement(new ident(tname), new semantic_addr_value(expr)); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название - visit(tt); // обходится первый элемент - вместо asstup + //visit(tt); // обходится первый элемент - вместо asstup var sl = new List(); + sl.Add(new SyntaxTree.empty_statement()); sl.Add(tt); // он же помещается в новое синтаксическое дерево - var n = assvartup.vars.variables.Count(); + var n = assvartup.idents.idents.Count(); for (var i = 0; i < n; i++) { - var rr = assvartup.vars.variables[i] as ident; + var rr = assvartup.idents.idents[i] as ident; var a = new var_statement(rr, new dot_node(new ident(tname),new ident("Item" + (i + 1).ToString())), - assvartup.vars.variables[i].source_context + assvartup.idents.idents[i].source_context ); // Остальные элементы обходить не надо (!!!уже надо!) - они обходятся на следующих итерациях при обходе внешнего statement_list //visit(a); @@ -20711,6 +20713,45 @@ namespace PascalABCCompiler.TreeConverter ReplaceStatementUsingParent(assvartup, sl);*/ } + public override void visit(var_tuple_def_statement vtd) + { + AddError(get_location(vtd), "SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR", vtd.GetType().Name); + + // Состоит из var_def_statements. Некоторые являются var_tuple_def_statement + // Их надо найти и сделать несколько секций variable_definitions - без семантических проверок. + // Каждую var_tuple_def_statement надо заменить на assign_var_tuple - одну на секцию variable_definitions + // А потом оставшаяся часть визитора сделает семантические проверки + + /*var tname = "#temp_var" + UniqueNumStr(); + var vd = new List(); + vd.Add(new semantic_check_sugared_var_def_statement_node(typeof(assign_var_tuple), new List { vtd.vars, vtd.inital_value }, vtd.source_context)); // Это нужно для проверок на этапе преобразования в семантику + visit(vd[0]); + var tt1 = new var_def_statement(new ident(tname), vtd.inital_value); + vd.Add(tt1); + var nn = vtd.vars.idents.Count(); + for (var i = 0; i < nn; i++) + { + var a = new var_def_statement(vtd.vars.idents[i], + new dot_node(new ident(tname), new ident("Item" + (i + 1).ToString())), + vtd.vars.idents[i].source_context); + vd.Add(a); + } + + ReplaceVarTupleDefStatementUsingParent(vtd, vd);*/ + } + public void ReplaceVarTupleDefStatementUsingParent(var_tuple_def_statement from, IEnumerable to) + { + foreach (var x in to) + x.Parent = from.Parent; + var sl = from.Parent as variable_definitions; + if (sl != null) + { + sl.ReplaceInList(from, to); + } + } + + + public override void visit(SyntaxTree.slice_expr sl) // сахарный узел { AddError(get_location(sl), "SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR", sl.GetType().Name); diff --git a/VisualPascalABCNET/Form1.cs b/VisualPascalABCNET/Form1.cs index 3d34cdf16..11d29d1ce 100644 --- a/VisualPascalABCNET/Form1.cs +++ b/VisualPascalABCNET/Form1.cs @@ -32,6 +32,13 @@ namespace VisualPascalABC public partial class Form1 : Form, VisualPascalABCPlugins.IWorkbench, VisualPascalABCPlugins.IWorkbenchDocumentService { + static string VersionInTitle(string s) + { + // VersionInTitle(RevisionClass.FullVersion) + var i = s.LastIndexOf('.'); + return s.Substring(0, i); + } + private const string MainFormTitle = "PascalABC.NET"; private static bool DesignerUseable = true; private static bool ProjectsUseable = true; @@ -667,8 +674,8 @@ namespace VisualPascalABC this.Text = String.Format(FTSFormat,MainFormText,Form1StringResources.Get("FTS_LOADING")); break; case VisualEnvironmentState.FinishCompilerLoading: - //this.Text = String.Format("{0} v{1}",MainFormText,PascalABCCompiler.Compiler.ShortVersion); - this.Text = MainFormText; + this.Text = String.Format("{0} {1}",MainFormText,PascalABCCompiler.Compiler.ShortVersion); + //this.Text = MainFormText; openFileDialog1.Filter = saveFileDialog1.Filter = VisualEnvironmentCompiler.GetFilterForDialogs(); openProjectDialog.Filter = VisualEnvironmentCompiler.GetProjectFilterForDialogs(); VisualEnvironmentCompiler.Compiler.CompilerOptions = WorkbenchServiceFactory.BuildService.CompilerOptions;