Commit Graph

14 Commits

Author SHA1 Message Date
Alex Hoppen
648edaadbe [libSyntax] Mark parameters that are always passed with move semantics as move-types 2021-02-10 12:16:48 +01:00
Nathan Hawes
97757e4c2a [Parse] Assert that the children of syntax tree nodes have contiguous source ranges
This should help us catch syntax tree round-tripping issues.
2019-10-18 17:22:01 -07:00
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
9fa176051d Revert "Merge pull request #27406 from nathawes/add-syntax-range-assertions"
This reverts commit 325204bd0d, reversing
changes made to 066bb61e8f.
2019-10-14 12:38:46 -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
Nathan Hawes
f1a21348d2 [Parse] Assert that the children of syntax tree nodes have contiguous source ranges
This should help us catch syntax tree round-tripping issues.
2019-09-27 16:02:27 -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
Xi Ge
1015a6024d Syntax: use child name instead of type name for gyb-generated functions
ParsedSyntaxBuilder has a convenient function to add member to a syntax-collection
child. The function name uses the type name of the collection's members,
which can lead to name collision. This patch renames it.
2019-04-19 18:16:13 -07:00
Argyrios Kyrtzidis
57c1f72cc3 [Parse] Optimize syntax parsing: Make ParsedRawSyntaxNode a POD type
This eliminates the overhead of ParsedRawSyntaxNode needing to do memory management.
If ParsedRawSyntaxNode needs to point to some data the memory is allocated from a bump allocator.

There are also some improvements on how the ParsedSyntaxBuilders work.
2019-01-17 12:17:28 -08:00
Argyrios Kyrtzidis
1f1eab638f [Parse/Syntax] Replace ParsedSyntaxRecorder::record* calls from the parser with ParsedSyntaxRecorder::make*
Doing a "direct ParsedSyntaxRecorder::record[some syntax]" call from the parser is not a good idea due to possibility
of being in a backtracking context when the call is made. Replace them with "ParsedSyntaxRecorder::make[some syntax]"
which will implicitly check for backtracking and create a recorded or deferred node accordingly.
2019-01-07 19:56:36 -08:00
Argyrios Kyrtzidis
ab7427723e [Parse/Syntax] Refactoring to decouple the parser from syntax tree creation
Instead of creating syntax nodes directly, modify the parser to invoke an abstract interface 'SyntaxParseActions' while it is parsing the source code.
This decouples the act of parsing from the act of forming a syntax tree representation.
'SyntaxTreeCreator' is an implementation of SyntaxParseActions that handles the logic of creating a syntax tree.
To enforce the layering separation of parsing and syntax tree creation, a static library swiftSyntaxParse is introduced to compose the two.

This decoupling is important for introducing a syntax parser library for SwiftSyntax to directly access parsing.
2019-01-07 19:52:59 -08:00