Jump to content
Guest

Comments cleanup tool

Recommended Posts

If someone is interesting in source code:

using System;
using System.IO;
using System.Text.RegularExpressions;

internal class a
{
  private static string b(string A_0)
  {
    string pattern = "(@(?:\"[^\"]*\")+|\"(?:[^\"\\n\\\\]+|\\\\.)*\"|'(?:[^'\\n\\\\]+|\\\\.)*')|//.*|/\\*(?s:.*?)\\*/";
    return Regex.Replace(A_0, pattern, "$1");
  }

  private static string aa(string A_0)
  {
    return Regex.Replace(A_0, "^\\s+$[\\r\\n]*", "", RegexOptions.Multiline);
  }

  private static void Main(string[] A_0)
  {
    Console.Title = "Comments removal tool - Rtz";
    Console.WriteLine("Please enter the path to the file:\n");
    try
    {
      string path = Console.ReadLine();
      string contents = a.aa(a.b(File.ReadAllText(path)));
      File.WriteAllText(path, contents);
      Console.WriteLine("\nAll comments were successfully removed from - " + path);
      Console.WriteLine("\nPress any key to exit");
    }
    catch (Exception ex)
    {
      Console.WriteLine(Environment.NewLine + ex.Message);
    }
    Console.ReadKey();
  }
}

 

Share this post


Link to post
Share on other sites
2 hours ago, Lua said:

any1 got a new link for this?

 

On 10/23/2016 at 12:28 AM, Wrexor said:

If someone is interesting in source code:


using System;
using System.IO;
using System.Text.RegularExpressions;

internal class a
{
  private static string b(string A_0)
  {
    string pattern = "(@(?:\"[^\"]*\")+|\"(?:[^\"\\n\\\\]+|\\\\.)*\"|'(?:[^'\\n\\\\]+|\\\\.)*')|//.*|/\\*(?s:.*?)\\*/";
    return Regex.Replace(A_0, pattern, "$1");
  }

  private static string aa(string A_0)
  {
    return Regex.Replace(A_0, "^\\s+$[\\r\\n]*", "", RegexOptions.Multiline);
  }

  private static void Main(string[] A_0)
  {
    Console.Title = "Comments removal tool - Rtz";
    Console.WriteLine("Please enter the path to the file:\n");
    try
    {
      string path = Console.ReadLine();
      string contents = a.aa(a.b(File.ReadAllText(path)));
      File.WriteAllText(path, contents);
      Console.WriteLine("\nAll comments were successfully removed from - " + path);
      Console.WriteLine("\nPress any key to exit");
    }
    catch (Exception ex)
    {
      Console.WriteLine(Environment.NewLine + ex.Message);
    }
    Console.ReadKey();
  }
}

 

just build it in vs 

Share this post


Link to post
Share on other sites

I tried to compile using vs2019 and it compiles correctly (but the program doesn't work as it should). Should I use another version of vs?


nagi_no_asukara_signature_by_tsukii_h0sh

Share this post


Link to post
Share on other sites
On 1/27/2022 at 5:35 PM, Lua said:

I tried to compile using vs2019 and it compiles correctly (but the program doesn't work as it should). Should I use another version of vs?

I think it doesn't depend on Visual Studio version. What specific errors in the program did you notice?


Share this post


Link to post
Share on other sites
On 2/1/2022 at 3:40 AM, V3ct0r said:

I think it doesn't depend on Visual Studio version. What specific errors in the program did you notice?

It simply doesn't change anything on the archive ://


nagi_no_asukara_signature_by_tsukii_h0sh

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...