Commit Graph

93 Commits

Author SHA1 Message Date
Alex Hoppen
8bb1167e21 [libSyntax] Restructure RawSyntax to more closely resemble the SwiftSyntax implementation 2021-01-29 13:08:12 +01:00
Alex Hoppen
bfe0a00551 Merge pull request #35429 from ahoppen/remove-bytetree
Remove ByteTree serialization format
2021-01-15 09:28:19 +01:00
Alex Hoppen
8ec8516893 Remove ByteTree serialization format
It was originally designed for faster trasmission of syntax trees from
C++ to SwiftSyntax, but superceded by the CLibParseActions. There's no
deserializer for it anymore, so let's just remove it.
2021-01-14 20:37:49 +01:00
Slava Pestov
28e7ed03d0 AST: Remove the 'legacy' request dependency graph implementation 2021-01-08 23:17:12 -05:00
Arnold Schwaighofer
8346bf7e90 Pre-specialization: This is an experimental feature
Only enable if explicitly required.
2020-11-20 09:13:16 -08:00
Robert Widmann
9fd5918786 Swap InputFileKind for ParseInputMode
Tying InputFile to this option meant that every input that was not one of the explictly-blessed kinds was modeled as a Swift file.

With the new InputFile that infers file kinds, we no longer need CompilerInvocation::setInputKind
2020-09-11 22:28:58 -06:00
Tony Allevato
db2dd20ce6 Parse concurrency syntax when parsing for syntax-tree-only mode.
This allows the syntax parser library and SwiftSyntax to successfully
parse code using this experimental feature without requiring an API
to pass compiler flags into the parser.
2020-08-11 20:13:15 -07:00
Doug Gregor
b1802fa2eb [Concurrency] Minor fixes for parsing and syntax of 'async' 2020-07-28 22:06:18 -07:00
Hamish Knight
1ed810653c [Frontend] Remove performParseOnly
Most clients were only using it to populate the
main module with files, which is now done by
`getMainModule`. Instead, they can now just rely
on parsing happening lazily.
2020-06-08 12:44:15 -07:00
Hamish Knight
5d72c464eb [Frontend] Remove parsing option params from performParseOnly
Lift the `DisablePoundIfEvaluation` parsing option
into `LangOptions` to subsume the need for the
`EvaluateConditionals` parameter, and sink the
computation of `CanDelayBodies` down into
`createSourceFileForMainModule`.
2020-06-08 12:44:13 -07:00
Owen Voorhees
45bc578ae5 [SourceManager] Rename line and column APIs for clarity 2020-05-21 12:54:07 -05:00
Argyrios Kyrtzidis
791309155d [Parse] Fix issue with incremental re-parsing for SwiftSyntax emitting bogus parsing error
rdar://60232712
2020-03-18 16:00:04 -07:00
Argyrios Kyrtzidis
1882b50555 [libSyntax] Enhance incremental re-parsing testing to also check whether unexpected diagnostics were emitted
Enhances `swift-syntax-test` to output the parser diagnostics so we can verify that
if the incremental parse resulted in parser diagnostics, those diagnostics were also emitted during the full parse.
2020-03-18 11:52:21 -07:00
Jonas Devlieghere
b4d268e9e1 Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances in the swift repo.
2019-08-15 11:32:39 -07:00
Michael Munday
ce3aff12da [Basic] Always serialize integers in little-endian byte order
This change fixes the ExponentialGrowthAppendingBinaryByteStream
tests on big endian machines.

Force ExponentialGrowthAppendingBinaryByteStreams to use little-
endian byte order. We always used little-endian byte order anyway
and it seems very unlikely we'll need the flexibility to make the
stream big-endian in the future. The benefit of this is that we
can use portable APIs while still allowing the compiler to remove
conditional byte swaps.

Also replace writeRaw with writeInteger and make it explicitly
little-endian to make the API cleaner and more portable.
2019-07-02 11:36:58 -04:00
Nathan Hawes
1e1025291d Add test for the SwiftSyntax tree produced when parsing '= super' in a module interface 2019-04-16 15:21:26 -07:00
Nathan Hawes
9003d83ffe [gardening] convert ByteBasedSourceRange to CharSourceRange rather than SourceRange
The only client of the 'toSourceRange' method immediately constructs a
CharSourceRange from it, and ByteBasedSourceRange's EndLoc isn't the start of
the last token in the range (as SourceRange expects).
2018-10-11 14:36:09 -07:00
Alex Hoppen
9d9bb5377a [incrParse] Fix issue that did not report the first reparsed character as reparsed 2018-10-11 17:54:35 +02:00
Alex Hoppen
5f341999e5 Merge pull request #18905 from ahoppen/semantic-version-number
[libSyntax] Make the ByteTree protocol version consist of a major and minor component
2018-08-29 16:40:08 -07:00
Alex Hoppen
49d0d5b7a3 [libSyntax] Make the ByteTree protocol version consist of a major and minor component 2018-08-29 13:40:50 -07:00
Xi Ge
9f7e2f7610 swift-syntax-test: teach the test driver to accept RequestEvaluatorGraphVizPath. 2018-08-29 11:13:42 -07:00
Alex Hoppen
33d86d5cb6 [byteTree] Write fixed sized data using an optimized form
If we know the size of a type at compile time (like we do for all the
integer types), it is cheaper to assign the data buffer directly instead
of using a memcpy.
2018-08-24 15:27:23 -07:00
Alex Hoppen
34a89d45e2 [libSyntax] Make the ByteTree format forwards-compatible 2018-08-22 12:07:57 -07:00
Alex Hoppen
da7cdbb122 [libSyntax] Add test cases for ByteTree serialization and deserialization 2018-08-21 10:55:15 -07:00
Alex Hoppen
e9e7d5cf68 [libSyntax] Generate TokenKinds.def from gyb_syntax_support 2018-08-15 11:11:27 -07:00
swift-ci
7a25818d82 Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 13:49:49 -07:00
Alex Hoppen
775beece65 [libSyntax] Add a swift token classifier for syntax highlighting 2018-07-30 14:54:43 -07:00
swift-ci
4b684e97ef Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 19:29:15 -07:00
Rintaro Ishizaki
6346e9b437 [libSyntax] Fix compiler error (#18243)
Another instance of 7ad81a88b9.
2018-07-26 11:12:24 +09:00
swift-ci
879a10aa57 Merge remote-tracking branch 'origin/master' into master-next 2018-07-25 15:29:05 -07:00
Alex Hoppen
57196f8902 [libSyntax] Enable serialization of syntax trees for incremental transfer 2018-07-23 12:32:49 -07:00
swift-ci
7b5e5028b7 Merge remote-tracking branch 'origin/master' into master-next 2018-07-20 13:49:10 -07:00
swift-ci
770b29634b Merge remote-tracking branch 'origin/master' into master-next 2018-07-19 14:50:16 -07:00
Alex Hoppen
d9d5afd15a [incrParse] Refactor the test utility to be more modular
This way we can use the same core of the test utility to verify
round-tripness of incrementally transferring the syntax tree to
swiftSyntax.
2018-07-19 14:47:58 -07:00
Alex Hoppen
419ba044f1 [libSyntax] Record reused node IDs
This is cheaper than recording reused region offsets and the reused node
IDs will later be used to incrementally transfer the syntax to
SwiftSyntax.
2018-07-19 13:55:57 -07:00
swift-ci
3e0444534b Merge remote-tracking branch 'origin/master' into master-next 2018-07-19 10:49:42 -07:00
Alex Hoppen
705f5b79a2 [libSyntax] Rename getAbsolutePosition-related methods for more clarity 2018-07-19 09:15:53 -07:00
swift-ci
c4feb3611d Merge remote-tracking branch 'origin/master' into master-next 2018-07-18 17:09:20 -07:00
Alex Hoppen
7a750bf024 [libSyntax] Allow syntax cache reuse info to be passed back via SourceKit 2018-07-18 13:35:10 -07:00
Bob Wilson
e1cbc560f9 [master-next] More changes to adapt to new LLVM flags in r334221
My previous change for this issue (033b884de6) did not fix all the
affected code. This gets the rest of them. Thanks for Jason Molenda
for helping with this. rdar://problem/41025365
2018-06-12 14:55:40 -07:00
Alex Hoppen
2decf8ffaf [libSyntax] Rename recordReuseInformation to setRecordReuseInformation 2018-05-22 09:07:56 -07:00
Alex Hoppen
b26dd1118c [incrParse] Fix swift-syntax-test not complaining about unexpected reparsed functions 2018-05-22 08:52:40 -07:00
Alex Hoppen
c31a880a47 [incrParse] Allow whitespaces to be reparsed in test
This greatly improves the ergonomics of writing tests and outweighs the
ability to test which whitespaces get parsed since their parsing
overhead should be minimal.
2018-05-22 08:52:38 -07:00
Alex Hoppen
d026b2da04 [incrParse] Add verification of reparsed regions to swift-syntax-test 2018-05-22 08:52:37 -07:00
Alex Hoppen
4da37b1702 [incrParse] Add option to force coloured output 2018-05-22 08:52:36 -07:00
Alex Hoppen
6135f10151 [incrParse] Outdated documentation fixes 2018-05-22 08:52:36 -07:00
Alex Hoppen
bc5e4d709a [incrParse] Compute byte offsets of pre-edit file based on that file 2018-05-22 08:52:35 -07:00
Alex Hoppen
d9fd523897 [swift-syntax-test] Refactor to allow incremental parsing on all actions 2018-05-22 08:52:34 -07:00
Alex Hoppen
8998b27dd4 [incrParse] Add coloured output indicating which code got reused 2018-05-22 08:52:34 -07:00
Alex Hoppen
92f8f34d22 [incrParse] Store reused regions and output them after parsing 2018-05-22 08:52:34 -07:00