SwiftFiddle/swift-ast-explorer

Can ast be converted to Swift?

Closed this issue · 3 comments

Can ast be converted to Swift?

@ChengRuipeng Not sure what you mean by "converted to Swift," can you elaborate?

@ChengRuipeng Not sure what you mean by "converted to Swift," can you elaborate?

I can convert Swift to AST by 'swift-ast-explorer', can I convert AST back to Swift?

@ChengRuipeng No you can't. 'swift-ast-explorer' converts AST to HTML for visualization. It is not reversible.

I recommend to use SwiftSyntax directly. SwiftSyntax is created for making it easier to rewrite Swift AST.