diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Tango.Protobuf | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.Protobuf')
| -rw-r--r-- | Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs | 39 |
2 files changed, 2 insertions, 39 deletions
diff --git a/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs b/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs index fe0744b94..096caaa21 100644 --- a/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs +++ b/Software/Visual_Studio/Tango.Protobuf/CompilerFileResult.cs @@ -34,7 +34,7 @@ namespace Tango.Protobuf /// <summary> /// Gets the file content. /// </summary> - public String Content { get; internal set; } + public String Content { get; private set; } /// <summary> /// Gets or sets the relative file path. diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs index 707466857..91f8d1502 100644 --- a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Text.RegularExpressions; using System.Threading.Tasks; using Tango.Core.Helpers; using Tango.Core.IO; @@ -17,11 +16,6 @@ namespace Tango.Protobuf.Compilers public class CCompiler : ProtoCompiler { /// <summary> - /// Gets or sets a value indicating whether this <see cref="CCompiler"/> will minimize the code by omitting hard coded strings. - /// </summary> - public bool Minimize { get; set; } - - /// <summary> /// Gets the compiler language. /// </summary> public override CompilerLanguage Language => CompilerLanguage.C; @@ -100,38 +94,7 @@ namespace Tango.Protobuf.Compilers File.WriteAllText(file, str); } - var result = base.CompileFolder(temp.Path); - - if (Minimize) - { - MinimizeFolder(result); - } - - return result; - } - - private void MinimizeFolder(CompilerFolderResult folder) - { - foreach (var childFolder in folder.Results.OfType<CompilerFolderResult>()) - { - MinimizeFolder(childFolder); - } - - foreach (var childFile in folder.Results.OfType<CompilerFileResult>()) - { - MinimizeFile(childFile); - } - } - - private void MinimizeFile(CompilerFileResult file) - { - file.Content = MinimizeCode(file.Content); - } - - private String MinimizeCode(String code) - { - Regex reg = new Regex("(?<=\")(\\w{1,})(?=\")"); - return reg.Replace(code, ""); + return base.CompileFolder(temp.Path); } } } |
