An open API service indexing awesome lists of open source software.

https://github.com/kvanttt/csharp-minifier

Library for C# code minification based on NRefactory. That is lib for spaces, line breaks, comments removing, reduction of identifiers name length and so on in C# code.
https://github.com/kvanttt/csharp-minifier

c-sharp minification nrefactory

Last synced: about 1 year ago
JSON representation

Library for C# code minification based on NRefactory. That is lib for spaces, line breaks, comments removing, reduction of identifiers name length and so on in C# code.

Awesome Lists containing this project

README

          

CSharp-Minifier
===============

Library for C# code minification based on NRefactory. That is lib for spaces, line breaks, comments removing, reduction of identifiers name length and so on in C# code.

This lib primarily developed for code minification in quines (for my [Freaky-Sources](https://github.com/KvanTTT/Freaky-Sources) project).

Implemented features:

* Identifiers compression (ignored names are supported too):
* Local vars
* Type members
* Types
* Misc minifications:
* private words removing
* namespaces words removing
* vars initialization expression compressing:
* List a = new List() => var a = new List()
* var a = new b() => b a = new b()
* Curly spaces with one expression inside removing ```if (a) { b; } => if (a) b;```
* boolean expressions optimization: ```if (a == true) => if (a); if (a == false) => if (!a)```
* Comments and regions removing
* Whitespaces chars removing with maximum string length limit.

Tests and GUI application are included.