Commit Graph

6 Commits

Author SHA1 Message Date
Alex Hoppen
8430eff670 [libSyntax] Add syntax coloring based on the syntax tree 2018-07-13 17:48:47 -07:00
Harlan
2a3d4cb598 Initial infrastructure for documenting SwiftSyntax API (#14701) 2018-02-26 13:43:11 -05:00
Harlan
a339c82c1e [SwiftSyntax] Make Syntax nodes structs instead of classes (#14122)
* [Experiment] Make Syntax nodes structs instead of classes

* [Experiment] Add Hashable conformance to concrete types

* Fix pep8 violation

* Remove AnySyntax, explicitly specialize SyntaxCollection nodes

* Refine the comment for SyntaxCollection nodes
2018-01-24 23:17:25 -05:00
Xi Ge
6c1f682af9 libSyntax: allow children of syntax nodes to have multiple choices. rdar://35879331 (#13562)
Some structures of syntax nodes can have children choices, e.g. a
dictionary expression can either contain a single ':' token or a list of
key-value pairs.

This patch gives the existing code generation infrastructure a way to
specify such node choices. Node choices are specified under a child
declaration with two constraints: a choice cannot be declared as
optional, and a choice cannot have further recursive choices.

Since we don't have too many node structures with choices, part of the
SyntaxFactory code for these nodes is manually typed.

This patch also teaches AccessorBlock to use node choices.
2017-12-20 15:33:57 -08: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
Harlan
a5098e6b69 Generate libSyntax API (#10926)
* Generate libSyntax API

This patch removes the hand-rolled libSyntax API and replaces it with an
API that's entirely automatically generated. This means the API is
guaranteed to be internally stylistically and functionally consistent.
2017-07-25 18:19:58 -07:00