Skip to content

Instantly share code, notes, and snippets.

Created December 24, 2012 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4368720 to your computer and use it in GitHub Desktop.
Save anonymous/4368720 to your computer and use it in GitHub Desktop.
let ast = SyntaxTree.ParseText badCode
let root = ast.GetRoot()
let compiler = compile ast
ignore <| compiler.Emit(@"original.dll")
//Fix bad code
let model = compiler.GetSemanticModel(ast)
let root' = root.Accept(FixBadUseOfCountRewriter(model, true)) :?> CompilationUnitSyntax
let ast' = SyntaxTree.Create(root')
let compiler' = compile ast'
ignore <| compiler'.Emit(@"fixed.dll")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment