Commit Graph

10 Commits

Author SHA1 Message Date
Rintaro Ishizaki
8768832f24 Revert "Merge pull request #27281 from rintaro/reapply-syntaxparse-genericparam"
This reverts commit 5d3e8d6c83, reversing
changes made to 27e881d97e.
2019-10-14 12:46:31 -07:00
Rintaro Ishizaki
bf5aa0a5a1 Revert "Merge pull request #27325 from rintaro/syntaxparse-cctype"
This reverts commit 439b9111b7, reversing
changes made to 4e476ff243.
2019-10-14 12:20:57 -07:00
Rintaro Ishizaki
1a9b6d0dbf [SyntaxParse] Introduce CodeCompletionTypeSyntax
To represent a type with code completion.

  type? '.'? <code-completion-token>

This is "parser only" node which is not exposed to SwiftSyntax.
Using this, defer to set the parsed type to code-completion callbacks.
2019-09-24 10:21:38 -07:00
Rintaro Ishizaki
0569cbfb28 Revert "Revert "[SyntaxParse] Parse generic parameter clause and generic where clause""
This reverts commit 1584e87aa7.
2019-09-20 15:26:04 -07:00
Rintaro Ishizaki
1584e87aa7 Revert "[SyntaxParse] Parse generic parameter clause and generic where clause" 2019-09-20 14:02:53 -07:00
Rintaro Ishizaki
f919b2ddd8 [SyntaxParse] Parse generic parameter clause and generic where clause 2019-09-19 23:09:58 -07:00
Rintaro Ishizaki
98fc073e2e [Syntax] Don't rebuild Syntax with RawSyntax in SyntaxVisitor (#14057)
We don't guarantee RawSyntax nodes as unique object in the tree, while
we do that for SyntaxData. We shouldn't recreate SyntaxData once it was
built.
2018-01-22 14:24:20 -08: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
Xi Ge
031488bada libSyntax: several enhancements on source location bridging. (#13956)
libSyntax nodes don't maintain absolute source location on each
individual node. Instead, the absolute locations are calculated on
demand with a given root by accumulating the length of all the other
nodes before the target node. This bridging is important for issuing
diagnostics from libSyntax entities.

With the observation that our current implementation of the source
location calculation has multiple bugs, this patch re-implemented this
bridging by using the newly-added syntax visitor. Also, we moved the function
from RawSyntax to Syntax for better visibility.

To test this source location calculation, we added a new action in
swift-syntax-test. This action parses a given file as a
SourceFileSyntax, calculates the absolute location of the
EOF token in the SourceFileSyntax, and dump the buffer from the start
of the input file to the absolute location of the EOF. Finally, we compare
the dump with the original input to ensure they are identical.
2018-01-15 16:39:17 -08:00
Xi Ge
b85f6d9c58 libSyntax: add a C++ side read-only syntax visitor to facilitate verification. NFC (#13882) 2018-01-11 16:17:44 -08:00