Commit Graph

16 Commits

Author SHA1 Message Date
Rintaro Ishizaki
2c06060165 [Syntax] Add CarriageReturn trivia kind
To distinguish '\r' from '\n'.
2017-12-19 09:24:34 +09:00
Harlan
a0512cd48a re-enable SwiftSyntax tests (#13399) 2017-12-14 23:39:16 -05:00
Rintaro Ishizaki
ef29650acd [Syntax] Parse: add support for TupleType and FunctionType
For now using SyntaxParsingContext.
2017-12-14 14:55:27 +09:00
Slava Pestov
bbb21c84ca SwiftSyntax: Fix resilient build
Address-only types do not support multiple case labels yet.
2017-12-12 21:10:59 -08:00
Harlan
2cc756414b [SwiftSyntax] Swift Diagnostics API (#11511)
This patch provides an API and Serialization for clang-style diagnostics
from within Swift. Libraries can use this API to pop their own custom
diagnostics that can be serialized to JSON.
2017-12-12 15:55:22 -05:00
Rintaro Ishizaki
2b1e316cf6 [Syntax] Add parsing hashbang (shebang) as a trivia.
Added GarbageText trivia kind for any skipped text.
2017-12-08 12:07:00 +09:00
Xi Ge
fec040d95e libSyntax: support generic parameter clause. (#13286)
This patch also performs minor refactoring to align syntax parsing
context with the right scope. We start to support the generic clauses
because they are necessary pieces to construct struct or
function syntax node.
2017-12-05 19:34:55 -08:00
Rintaro Ishizaki
e7cfae0ba9 [libSyntax] Support parsing type-identifier 2017-11-29 09:57:59 +09:00
Robert Widmann
cd64938e6b Provide an explicit iterator for SyntaxCollection (#13112)
The default IndexingIterator for a custom collection is not suitable for
subclasses that specialize the element type the way libSyntax does.
Overriding it with a more specific iterator, even with something like
covariant overrides, would not work because it the iterator is generic
over its base collection, not its element type.

Provide a custom iterator parameterized by the element type instead.
2017-11-28 15:23:35 -05:00
Harlan
f552f55969 Update SwiftSyntax's expectations now that -emit-syntax is emitting a SourceFileSyntax (#12860) 2017-11-10 15:48:13 -08:00
Tony Allevato
1187890ca4 [SwiftSyntax] Fix SyntaxChildren iteration (#12319)
* [SwiftSyntax] Fix SyntaxChildren iteration

SyntaxChildren.Iterator stops the first time it sees a nil child;
since it traverses all indexes without considering presence, this
causes it to terminate iteration early if there is a missing child
in the list.

* [SwiftSyntax] Add tests for SyntaxChildren
2017-10-15 00:38:35 -04:00
David Ungar
f81136040e Use an autoreleasepool instead of explicitly closing the files. 2017-09-27 10:52:12 -07:00
David Ungar
f282babc6a Close files after invoking swiftc in SwiftSyntax tool 2017-09-25 09:21:16 -07:00
Kuba (Brecka) Mracek
d03a575279 Unify the capitalization across all user-visible error messages (#11599)
* Unify the capitalization across all user-visible error messages (fatal errors, assertion failures, precondition failures) produced by the runtime, standard library and the compiler.

* Update some more tests to the new expectations.
2017-08-29 12:16:04 -07:00
Harlan
cba8a865e2 Split RawSyntax.presence into multiple cases (#11526) 2017-08-19 07:43:42 -07: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