square / Cleanse

Lightweight Swift Dependency Injection Framework
Other
1.78k stars 90 forks source link

Create cleansec xcodeproj and SwiftAstParser framework. #137

Closed sebastianv1 closed 4 years ago

sebastianv1 commented 4 years ago

The cleansec.xcodeproj contents will hold all the targets and code associated with cleansec's implementation. This commit adds two new targets, the cleansec binary, and SwiftAstParser framework. The binary is currently just a skeleton and emits "Hello World" when run.

SwiftAstParser is the associated parsing library that takes the -dump-ast format as input. Influenced heavily by Apple's swift-syntax library, this framework offers a public SyntaxVisitor protocol that implementations can use to traverse the AST tree. The syntax nodes are code generated from known typed AST nodes inside Apple's swift library. If any node is non-parseable, it will fall into the UnknownSyntax path. These are still traversable and provide the raw contents. Currently the nodes are associated with Swift 5.2. Each version of SwiftAstParser will be mapped to a specific swift version.