Skip to content

Preprocessor  #26

Description

@lcnvdl

Hi, I'm having problems with "preprocessor" conditions:

if I have the next code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CSharpMinifier.GUI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
#if DEBUG
            string text  = "";
#else
            string myOtherTestText = "hi";
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain());
        }
    }
}

The code is not minified correctly:

using System;using System.Collections.Generic;using System.Linq;using System.
Threading.Tasks;using System.Windows.Forms;static class b{[STAThread]static void
Main(){
#if DEBUG
                                            string text  = "";
#else
var a="hi";
#endif
Application.EnableVisualStyles();Application.
SetCompatibleTextRenderingDefault(false);Application.Run(new frmMain());}}

As you see, the first variable's name "text" stills unminified.

Can you add "preprocessor" support?

Thank you very much!

Best regards,
Luciano Rasente

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions