Commit Graph

16 Commits

Author SHA1 Message Date
Xi Ge
2e03eac75c [WIP] Re-apply "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" (#14506)
After removing white space changes and attempting to configure dependencies
correctly.
2018-02-11 09:38:53 -08:00
Doug Gregor
774bee2294 Revert "Re-apply "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" (#14465)"
This reverts commit f8c77e17ce.
2018-02-08 22:58:45 -08:00
Doug Gregor
b060667877 Revert "[sourcekitd] Rename module SwiftSourceKit to SwiftLang. (#14497)"
This reverts commit 43435af7ee.
2018-02-08 22:58:43 -08:00
Xi Ge
43435af7ee [sourcekitd] Rename module SwiftSourceKit to SwiftLang. (#14497)
The sourcekitd client library provides parsing APIs for SwiftSyntax users.
The internal use of sourcekit service is an implementation detail that end users
shouldn't worry about.
2018-02-08 17:26:00 -08:00
Xi Ge
f8c77e17ce Re-apply "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" (#14465) 2018-02-08 15:11:31 -08:00
Xi Ge
50cde06cf0 Revert "SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)" 2018-02-06 23:20:42 -08:00
Xi Ge
871c9dac2a SwiftSyntax: Teach SwiftSyntax to use SourceKitd to serialize syntax trees. (#14424)
When using SwiftSyntax as a standalone tool, we invoke Swiftc
internally to get serialized syntax trees. This is not ideal for
several reasons: (1) we have to hard-code the relative path of swiftc
to invoke it; (2) we have to rely on standard input/output to pass the
tree across the process boundaries; and (3) we have to maintain two
different ways to get syntax tree (swiftc and sourcekitd).

This patch attempts to teach SwiftSyntax to use SourceKitd to get the
tree just like other clients. We first add a SourceKitd client library
written in Swift; and next teach SwiftSyntax to adopt this SourceKitd
client-side library. For platforms other than MacOS, we still use Swiftc
to get syntax trees. This client library also allows us to add 
SourceKitd tests in Swift.

This patch also re-enables several flaky tests.
2018-02-06 19:40:16 -08:00
Rintaro Ishizaki
fced748790 [Syntax] Represent missing optioanl nodes as nullptr (#14300)
Allocating RawSyntax/SyntaxData for missing optional node is a waste of
resource.
2018-01-31 19:24:00 +09:00
Xi Ge
f0e906c7d2 [test] Disable a flaky test: SwiftSyntax/ParserFile. rdar://36740859 (#14095) 2018-01-23 16:40:45 -08:00
Harlan
9185ef5610 [Syntax] Add #selector and #keyPath tokens (#13615)
* [Syntax] Add #selector and #keyPath tokens

* [Syntax][test] Add #selector and #keyPath to syntax parsing tests

* [Syntax] Don't fatalError on an unknown token kind

* Fix test build error
2017-12-29 12:35:08 -05:00
Harlan
a0512cd48a re-enable SwiftSyntax tests (#13399) 2017-12-14 23:39:16 -05:00
Harlan
d0339c2767 Add contextual_keyword and string_interpolation_anchor to SwiftSyntax (#13321) 2017-12-08 16:13:49 -05:00
Harlan
1d2d0a6f71 [CMake] Only build SwiftSyntax if building SDK overlays (#12141)
* [CMake] Only build SwiftSyntax if building SDK overlays

SwiftSyntax depends on Foundation, which depends on the SDK overlays
being built. However, the existing build configuration tried to build
SwiftSyntax even if the SDK overlays were not built. Ensure we're
building overlays before building SwiftSyntax, and guard tests with an
sdk_overlay test.

* Remove TODO comment
2017-10-04 15:30:02 -04:00
Harlan
fab6178f39 [CMake] Include stdlib/ before tools/ (#11752)
This is, unfortunately, the quickest workaround to get SwiftSyntax
building properly and generating a proper module. I'm going to take some
time to figure out what global mutable state exactly is touched inside
stdlib/ that suddenly makes this work, but for now, get the tests re-enabled.
2017-09-26 14:03:39 -04:00
Harlan Haskins
738508cad4 Disable SwiftSyntax tests (for now) 2017-08-14 18:08:48 -07:00
Harlan
ade67ca899 [Syntax] Swift libSyntax API (#11320)
* Create Swift libSyntax API

This patch is an initial implementation of the Swift libSyntax API. It
aims to provide all features of the C++ API but exposed to Swift.

It currently resides in SwiftExperimental and will likely exist in a
molten state for a while.

* Only build SwiftSyntax on macOS
2017-08-14 16:47:48 -07:00