Commit Graph

3166 Commits

Author SHA1 Message Date
Xi Ge
e0d167f1dd libSyntax: create syntax nodes for variable declarations.
Variable declarations are declarations led by either 'var' or 'let'. It
can contain multiple pattern bindings as children.

For patterns, this patch only creates syntax nodes for simple identifier
patterns, e.g. 'a = 3'. The rest of the pattern kinds are still left
unknown (UnknownPattern).
2017-12-19 12:25:51 -08:00
Xi Ge
fe1a4ca0d2 libSyntax: create libSyntax node for var decl accessors. 2017-12-18 15:16:14 -08:00
Rintaro Ishizaki
8e967adc0e [Syntax] Parse attributed type node 2017-12-18 08:28:24 -08:00
Faiçal Tchirou
5e41098851 libSyntax: specialize class declaration syntax node. (#13485) 2017-12-16 11:36:58 -08:00
Robert Widmann
451516df4d Merge pull request #8818 from Bouke/patch-2
Shallow clone specific branch
2017-12-15 23:24:54 -05:00
Erik Eckstein
754267c24f Fix the check-incremental script
It didn't work for compiler command lines, which didn't produce an object file
2017-12-15 16:20:18 -08:00
Xi Ge
df7db884cf libSyntax: create syntax nodes for IfConfigDecl. 2017-12-15 13:36:47 -08:00
Rintaro Ishizaki
53b2e0fe14 [Syntax] Parse composition type node 2017-12-15 10:52:10 -08:00
Xi Ge
b4b638651d libSyntax: create syntax node for typealias declarations. (#13450) 2017-12-14 17:44:54 -08:00
Xi Ge
a6b3559a8a libSyntax: specialize import declaration. (#13437) 2017-12-14 12:27:52 -08:00
Rintaro Ishizaki
e616b2ad37 [Syntax] Use initializer clause syntax node for function parameter (#13430) 2017-12-14 08:12:10 -08:00
Rintaro Ishizaki
ef29650acd [Syntax] Parse: add support for TupleType and FunctionType
For now using SyntaxParsingContext.
2017-12-14 14:55:27 +09:00
Xi Ge
796c51cb1f libSyntax: specialize closure expression. (#13421) 2017-12-13 18:25:44 -08:00
Xi Ge
9ddd60d4ef libSyntax: create syntax nodes for closure signature. (#13415)
This patch also refactors the structure of function signature node so
that closure signature can re-use parts of function signature. For
instance, we group arrow and return type to be "ReturnClause". And we
group parenthesized parameter list to be "ParamClause".

This structure of closure signature also calls for a good way to
represent either-or node in libSyntax APIs, since we've two ways to
specify parameters in closure: one is as regular function parameter and
the other is dot-separated simple names.
2017-12-13 16:48:24 -08:00
Xi Ge
9e8d0aea81 libSyntax: create syntax node for closure capture list. (#13408) 2017-12-12 20:14:04 -08:00
Xi Ge
2a39598b4f libSyntax: specialize try expression.
Optional try, forced try and regular try expressions are handled in
this syntax node.
2017-12-12 16:17:48 -08:00
David Ungar
c1f81867d7 Merge pull request #13268 from davidungar/PR3A-rb
FrontendInputs data structure redo, rebased.
2017-12-11 20:44:10 -08:00
swift-ci
017323c831 Merge pull request #13377 from nkcsgexi/lib-syntax-protocol 2017-12-11 17:21:07 -08:00
Xi Ge
fda8dfcfd3 libSyntax: specialize protocol declaration syntax. 2017-12-11 16:17:13 -08:00
Michael Gottesman
0539b9b913 [build-script] I am finding that I also need clang-tablegen-targets as well to get --xcode --skip-build-llvm to work. 2017-12-11 15:22:06 -08:00
Michael Gottesman
4c762cffab [build-script] When skipping building LLVM, make sure to call intrinsics_gen as well as clang-headers.
SILGen depends on headers generated by this build step.
2017-12-11 09:46:58 -08:00
Rintaro Ishizaki
a0f49ca935 Merge pull request #13339 from rintaro/syntax-parserposition
[Syntax] Fix roundtrip test
2017-12-11 09:49:21 +09:00
Rintaro Ishizaki
1615a6746f [libSyntax] Fix round-trip-syntax-test script
was always success because of logic error in the script.
2017-12-09 14:48:21 +09:00
Xi Ge
8256b1f88f libSyntax: function declaration syntax should accept operators as name. 2017-12-08 16:30:45 -08:00
Harlan
d0339c2767 Add contextual_keyword and string_interpolation_anchor to SwiftSyntax (#13321) 2017-12-08 16:13:49 -05:00
Ben Cohen
4ddac3fbbd [stdlib] Eradicate IndexDistance associated type (#12641)
* Eradicate IndexDistance associated type, replacing with Int everywhere

* Consistently use Int for ExistentialCollection’s IndexDistance type.

* Fix test for IndexDistance removal

* Remove a handful of no-longer-needed explicit types

* Add compatibility shims for non-Int index distances

* Test compatibility shim

* Move IndexDistance typealias into the Collection protocol
2017-12-08 12:00:23 -08:00
Xi Ge
1b24d23c1e libSyntax: support function parameter nodes. (#13324) 2017-12-07 14:09:17 -08:00
Ross Bayer
6d2c465071 Fixed overzealous path expansion for the --build-subdir argument which caused all build directories to generate relative to the directory build-script was invoked from. (#13319) 2017-12-07 13:18:17 -08:00
Rintaro Ishizaki
8bbe4d20ef [libSyntax] Support TypeExpr (#13317)
Just for `Any` for now.
2017-12-07 11:40:05 -08:00
Xi Ge
c4604d700e libSyntax: specialize struct declaration syntax node. (#13307)
To construct struct syntax, this patch first specialized type
inheritance clause. For protocol's class requirement, we currently
treat it as an unknown type.

This patch also teaches SyntaxParsingContext to collect syntax nodes
from back in place. This is useful to squash multiple decl modifiers
for declarations like function. This is not used for struct declaration
because only accessibility modifier is allowed.
2017-12-06 14:12:12 -08:00
Ross Bayer
5a8a25e59e [build-script] Argument Builder DSL Conversion: Episode 3 (#13231)
* Updated the PathType and StorePathAction classes to allow for asserting if a path contains an executable.

* Converted the top-level argument group to use the new builder DSL.

* Updated tests for StorePathType to not actually test the functionality of the PathType class.

* Implemented a CompilerVersion type to mimic the existing wrapper in swift_build_support and return a more detailed object from ClangVersionType and SwiftVersionType.

* Updated action tests.

* Fixed a filter() mistake.

* Code review.
2017-12-06 12:36:48 -08: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
Ben Cohen
85d190cd7d [stdlib] Replace various uses of BlahSlice with Slice to reduce warnings (#13263)
* Kill the slice variants from the gybbed collection test types

* Handful more SDK instances

* Fix SequencesCollections.swift.gyb
2017-12-05 19:09:56 -08:00
David Ungar
28b206008f FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
2017-12-05 17:28:03 -08:00
Ross Bayer
0f1b6163f2 [build-script] Argument Builder DSL Conversion: Episode 2 (#13164)
* Converted the host and cross-compilation targets argument group to use the new builder DSL.

* Converted the projects argument group to use the new builder DSL.

* Converted the extra actions argument group to use the new builder DSL.

* Converted the build variant argument group to use the new builder DSL.

* Converted the build variant override argument group to use the new builder DSL.

* Converted the run tests argument group to use the new builder DSL.

* Converted the run build argument group to use the new builder DSL.

* Converted the skip test argument group to use the new builder DSL.

* Export missing ShellSplitType from the argparse.types module.
2017-12-05 13:34:57 -08:00
Xi Ge
1a7f1911b8 libSyntax: support declaration modifiers, like static, private, etc. (#13221)
Some declaration modifiers may have more details attached, like
"private(set)". This patch represents the detail part "(set)" as a token
list.
2017-12-04 13:03:02 -08:00
Jordan Rose
fd11da5d88 resolve-crashes.py: remove "REQUIRES: asserts" as well (#13215) 2017-12-04 09:30:42 -08:00
Xi Ge
68348944e2 libSyntax: parse declaration attribute list (@attributes). (#13212)
This commit starts to support syntax nodes for @ attributes list for
declarations. These attributes don't include modifiers like "static" or
access keywords. Along with the function change, the commit refactors
some existing code to reduce duplication.
2017-12-01 16:15:17 -08:00
swift-ci
f2783bb3a1 Merge pull request #13104 from apple/preset-smoke-test-build-lldb 2017-12-01 12:29:18 -08:00
Xi Ge
9cd54c45f6 libSyntax: encapsulate members of a struct declaration into MemberDeclBlock. (#13193) 2017-12-01 09:19:13 -08:00
Ross Bayer
4274233420 [build-script] Argument Builder DSL Conversion: Episode 1 (#13117)
* Imported the new argparse overlay module and added the setup code for the DSL.

* Converted the CMake generator flags to use the new builder DSL.

* Converted the assertions argument group to use the new builder DSL.

* Converted the LLVM-specific settings argument group to use the new builder DSL.

* Converted the Android build settings argument group to use the new builder DSL.

* Removed unused action aliases from the builder DSL setup section to appease the flake8 gods.

* Fixed small typo in help message for --eclipse option.
2017-11-30 17:46:57 -08:00
Xi Ge
5ace363dbc libSyntax: specialize As expression and Is expression. (#13179)
This patch also handles variants like "as!" and "as?".
2017-11-30 15:05:22 -08:00
Ross Bayer
e05c2ccab0 Updated the action class hierarchy to have more default metavars. (#13167) 2017-11-30 12:44:41 -08:00
Rintaro Ishizaki
d389a812e2 [libSyntax] Support parsing postfix type nodes
* OptionalType (?)
* ImplicitlyUnwrappedOptional (!)
* MetatypeType (.Type, .Protocol)
2017-11-30 14:31:21 +09:00
Rintaro Ishizaki
5923e4fee4 [libSyntax] Support parsing collection types 2017-11-30 11:49:39 +09:00
Mishal Shah
7202c5a68c [Preset] Use system debugserver and release lldb build 2017-11-29 18:14:18 -08:00
Jordan Rose
572a37520c [build-script] Translate "RelWithDebInfo" to "Release" for Mac LLDB (#13154)
Not all CMake configuration names are valid Xcode configurations at
the moment, but Xcode's "Release" still includes debug info, so it's
probably close enough.
2017-11-29 17:55:14 -08:00
Rintaro Ishizaki
0ba59a3256 Merge pull request #13110 from rintaro/syntax-parse-builder
[libSyntax] Support parsing type-identifier
2017-11-29 10:55:45 +09:00
Rintaro Ishizaki
e7cfae0ba9 [libSyntax] Support parsing type-identifier 2017-11-29 09:57:59 +09:00
Jason Molenda
5590a2ff91 Merge pull request #13120 from jasonmolenda/add-asan-presets-for-lldb
Add LLDB_Swift_DebugAssert_asan & LLDB_Swift_ReleaseAssert_asan
2017-11-28 16:54:04 -08:00