diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs | 39 |
1 files changed, 1 insertions, 38 deletions
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); } } } |
