Commit Graph

14 Commits

Author SHA1 Message Date
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
Rintaro Ishizaki
941cfa80bb [Syntax] Don't construct complete Syntax nodes in parsing
Instead, directly use RawSyntax.
2018-01-31 17:13:00 +09:00
Rintaro Ishizaki
d8f6ff0019 [Syntax] Reserve capacity for vector when possible 2018-01-31 15:21:21 +09:00
Rintaro Ishizaki
0780c529c4 [Syntax] Unify RawSyntax and RawTokenSyntax using union and TrailingObjects
It better matches with SwiftSyntax model.

Using TrailingObjects reduces the number of heap allocation which
gains 18% performance improvement.
2018-01-18 14:49:46 +09: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
Harlan Haskins
69151171db Clean up removals of friend declarations 2017-06-23 13:36:02 -07:00
Harlan Haskins
a77029a0e4 Remove friend declarations for SyntaxData 2017-06-23 13:34:08 -07:00
Harlan Haskins
b73725ad41 Fix SyntaxCollection template errors 2017-06-23 11:34:58 -07:00
Harlan Haskins
972502d024 Remove subclasses of SyntaxData and move validation logic into Syntax subclasses. 2017-06-22 21:52:59 -07:00
Harlan
d90032cc45 [Syntax] Make FunctionTypeSyntax use a FunctionParameterList (#8270)
* Made FunctionType use a FunctionParameterList instead of TupleTypeElementList

* Added round-trip test

* Removed unused test variables
2017-03-23 09:57:11 -04:00
Harlan
631c7d8064 [Syntax] Refactor Tuple Type Syntax (#8254)
* Refactor Tuple Type Syntax

This patch:

- Refactors TypeArgumentListSyntax and
  TypeArgumentListSyntaxData to use the SyntaxCollection and
  SyntaxCollectionData APIs.
- Refactors TupleTypeElementSyntax to own its trailing comma, and
  updates the tests accordingly.
- Provides an infrastructure for promoting types to use
  the SyntaxCollection APIs

* Addressed comments.

* Renamed makeBlankTypeArgumentList()

* Update makeTupleType

* Changed makeTupleType to take an element list.

* Updated comment.

* Improved API for creating TupleTypeElementListSyntax'es

* Added round-trip test

* Removed last TypeArgumentList holdovers.

* Fixed round-trip test invocation
2017-03-22 08:02:29 -04:00
practicalswift
0cf00ac487 [gardening] Add missing headers. 2017-03-07 16:44:53 +01:00
David Farler
e565392f81 [Syntax] Add convenience iterator for SyntaxCollections 2017-03-02 17:02:50 -08:00
David Farler
7ce3b81001 Add generic Syntax collection for unbounded list of nodes
Just a little reusable collection type for things like argument lists,
statement lists, etc.
2017-03-02 17:02:50 -08:00