diff --git a/Compiler/Compiler.csproj b/Compiler/Compiler.csproj index 3796bd0e0..a4f355944 100644 --- a/Compiler/Compiler.csproj +++ b/Compiler/Compiler.csproj @@ -142,6 +142,10 @@ {613E0DDA-AA8A-437C-AC45-507B47429FF9} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + {4d36d4ce-56fd-4bec-b846-d54b3a39ffd5} + StandardSyntaxTreeConverter + {f10a5330-dcf4-4533-877c-7b1b1be23884} SyntaxTreeConverters diff --git a/Compiler/SemanticTreeConverters/SemanticTreeConvertersController.cs b/Compiler/SemanticTreeConverters/SemanticTreeConvertersController.cs index 8676bb3ad..e5d709304 100644 --- a/Compiler/SemanticTreeConverters/SemanticTreeConvertersController.cs +++ b/Compiler/SemanticTreeConverters/SemanticTreeConvertersController.cs @@ -40,7 +40,11 @@ namespace PascalABCCompiler.SemanticTreeConverters private void AddConverters(string DirectoryName) { DirectoryInfo di = new DirectoryInfo(DirectoryName); - FileInfo[] dllfiles = di.GetFiles("*Conversion.dll"); + + // динамически подключаемые конверторы. Не очень устойчивая конструкция!!! + // Делается это для ликвидации зависимости от семантического уровня - это понятно + // Но - должен быть другой - нормальный - путь + FileInfo[] dllfiles = di.GetFiles("*Conversion.dll"); System.Reflection.Assembly assembly = null; ISemanticTreeConverter Converter; foreach (FileInfo fi in dllfiles) diff --git a/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs b/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs index cc6bac740..03513c023 100644 --- a/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs +++ b/Compiler/SyntaxTreeConvertersController/SyntaxTreeConvertersController.cs @@ -7,6 +7,7 @@ using System.Text; using System.IO; using PascalABCCompiler.SyntaxTree; using PascalABCCompiler.Errors; +using PascalABCCompiler.SyntaxTreeConverters; namespace PascalABCCompiler.SyntaxTreeConverters { @@ -36,17 +37,23 @@ namespace PascalABCCompiler.SyntaxTreeConverters this.Compiler = Compiler; } + public void AddStandardConverters() + { + var st = new StandardSyntaxTreeConverter(); + syntaxTreeConverters.Add(st); + } public void AddConverters() { - AddConverters(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)); + AddStandardConverters(); + AddExternalConvertersAsPlugins(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)); } - private void AddConverters(string DirectoryName) + private void AddExternalConvertersAsPlugins(string DirectoryName) { DirectoryInfo di = new DirectoryInfo(DirectoryName); - List dllfiles = di.GetFiles("*ConversionSyntax.dll").ToList(); - List standartdllfile = di.GetFiles("StandardSyntaxTreeConverter.dll").ToList(); - if (standartdllfile.Count>0) - dllfiles.Insert(0, standartdllfile[0]); + List dllfiles = di.GetFiles("*ConversionSyntax.dll").ToList(); // Это только YieldConversionSyntax.dll + //List standartdllfile = di.GetFiles("StandardSyntaxTreeConverter.dll").ToList(); + //if (standartdllfile.Count>0) + // dllfiles.Insert(0, standartdllfile[0]); //dllfiles.Insert(0,new FileInfo("StandardSyntaxTreeConverter.dll")); System.Reflection.Assembly assembly = null; diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index b4032d53b..67d822e41 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 = "2"; public const string Build = "0"; - public const string Revision = "1373"; + public const string Revision = "1374"; 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 73179c445..4630e75e2 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=0 -%REVISION%=1373 %MINOR%=2 +%REVISION%=1374 +%COREVERSION%=0 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 2c3696dc8..4c4839a0f 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.2.0.1373' +!define VERSION '3.2.0.1374' diff --git a/StandardSyntaxTreeConverter/StandardSyntaxConverters.cs b/StandardSyntaxTreeConverter/StandardSyntaxConverters.cs deleted file mode 100644 index 8f80b0d40..000000000 --- a/StandardSyntaxTreeConverter/StandardSyntaxConverters.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using PascalABCCompiler.SyntaxTree; - -namespace PascalABCCompiler.SyntaxTreeConverters -{ - class StandardSyntaxTreeConverter: ISyntaxTreeConverter - { - public string Name { get; } = "Standard"; - public syntax_tree_node Convert(syntax_tree_node root) - { - FillParentNodeVisitor.New.ProcessNode(root); // прошивание ссылками на Parent nodes. Должно идти первым - StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root); // выносим выражения с лямбдами из заголовка foreach - - return root; - } - } -} diff --git a/StandardSyntaxTreeConverter/StandardSyntaxTreeConverter.csproj b/StandardSyntaxTreeConverter/StandardSyntaxTreeConverter.csproj index 18b8e7947..81604fcc7 100644 --- a/StandardSyntaxTreeConverter/StandardSyntaxTreeConverter.csproj +++ b/StandardSyntaxTreeConverter/StandardSyntaxTreeConverter.csproj @@ -40,7 +40,7 @@ - + diff --git a/bin/Lib/PABCRtl.dll b/bin/Lib/PABCRtl.dll index 4f643d7c9..692c2ee40 100644 Binary files a/bin/Lib/PABCRtl.dll and b/bin/Lib/PABCRtl.dll differ