Change parsing and representation of extensions to accommodate generic parameters.

The eventual goal for extensions of generic types is to require them
to specify their generic parameters, e.g.,

  extension Array<T> { ... }

rather than today's

  extension Array { ... }

Start parsing (optional) generic parameters here, and update the
representation of ExtensionDecl to accomodate this new grammar
production. Aside from the parser changes, there's no intended
functionality change here.

Swift SVN r20682
This commit is contained in:
Doug Gregor
2014-07-29 19:17:00 +00:00
parent e466b4621b
commit a0bc9274db
13 changed files with 259 additions and 139 deletions

View File

@@ -461,7 +461,7 @@ bool ModelASTWalker::walkToDeclPre(Decl *D) {
SN.Kind = SyntaxStructureKind::Extension;
SN.Range = charSourceRangeFromSourceRange(SM, ED->getSourceRange());
SN.BodyRange = innerCharSourceRangeFromSourceRange(SM, ED->getBraces());
SourceRange NSR = ED->getExtendedTypeLoc().getSourceRange();
SourceRange NSR = ED->getExtendedTypeRange();
SN.NameRange = charSourceRangeFromSourceRange(SM, NSR);
for (const TypeLoc &TL : ED->getInherited()) {