This is a Roslyn-based tool for C# syntax rewriting with the purpose of source-code desugaring.
There are 2 varieties of rewriter:
- a purely syntactic one,
Rewriter, and - a symbolic one,
SymbolicRewriter.
For the rewriting, the former relies on syntactic information only; the latter also relies on symbolic information by means of a SemanticModel.
BlockifyExpressionBodyDeanonymizeTypeDecomposeNullConditionalEmplaceGlobalStatementEnsureVisibleConstructorExpandForeachImplementAutoPropertyImposeExplicitReturnImposeThisPrefixInitializeOutArgumentReplicateLocalInitializationStoreObjectCreationTranslateLinqUncoalesceCoalescedNullUninterpolateStringsUnparameterizeRecordDeclaration
Hint: A "description" of the exact rewrite performed by a given rewriter, you might want to check the tests.
voidApplyRewrite(IRewriterrewriter,SyntaxTreetree){SyntaxTreetree_P;if(rewriter.IsPurelySyntactic()){tree_P=((Rewriter)rewriter).Apply(tree);}else{Compilationcompilation=/* ... */tree_P=((SymbolicRewriter)rewriter).Apply(tree,compilation.GetSemanticModel(tree));}}