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.
- Host: GitHub
- URL: https://github.com/kvanttt/csharp-minifier
- Owner: KvanTTT
- License: apache-2.0
- Created: 2013-10-16T13:55:22.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2019-02-20T09:43:05.000Z (over 7 years ago)
- Last Synced: 2025-04-04T03:33:23.054Z (over 1 year ago)
- Topics: c-sharp, minification, nrefactory
- Language: C#
- Homepage:
- Size: 1020 KB
- Stars: 41
- Watchers: 5
- Forks: 20
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.