SwiftFiddle/swift-ast-explorer

What usage does this AST explorer have?

Closed this issue · 1 comments

mfaani commented

This greatly shows what's happening under the hood in regards to AST generation.

I also understand it's part of the Swift Compiler/Driver pipeline. But what usage does it have for developers? I was trying to find something in the README.md but I couldn't.

Is it just a demonstration tool or you were seeking something else and had to create this explorer for it?

This tool displays the results of running SwiftSyntax, a parser used internally by the Swift compiler.

SwiftSyntax is not only used internally by the compiler, but also by static analysis tools such as swift-format and SwiftLint, and code generators such as Sourcery.

In addition, macros will soon be introduced to Swift, and SwiftSyntax will be used to implement macros.
The authors of these metaprogramming tools use SwiftSyntax, so we need a tool to easily see the results of how SwiftSyntax parses the Swift code.