Skip to content

Commit

Permalink
Revert "Merge pull request swiftlang#26952 from rintaro/syntaxparse-t…
Browse files Browse the repository at this point in the history
…ype-failedpostfix"

This reverts commit 987b856, reversing
changes made to 4fa3cef.
  • Loading branch information
rintaro committed Oct 14, 2019
1 parent 71aa44d commit 5a6e14b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 8 additions & 3 deletions lib/Parse/ParseType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,11 @@ Parser::TypeResult Parser::parseTypeSimple(Diag<> MessageID,
}

// '.Type', '.Protocol', '?', '!', and '[]' still leave us with type-simple.
while (Result->isSuccess()) {
auto PrevType = Result->getResult();

while (Result->isSuccess() || !Result->getUnknownNodes().empty()) {
auto PrevType = Result->isSuccess()
? Result->getResult()
: ParsedSyntaxRecorder::makeUnknownType(
Result->getUnknownNodes(), *SyntaxContext);
if ((Tok.is(tok::period) || Tok.is(tok::period_prefix)) &&
(peekToken().isContextualKeyword("Type") ||
peekToken().isContextualKeyword("Protocol"))) {
Expand All @@ -235,6 +237,9 @@ Parser::TypeResult Parser::parseTypeSimple(Diag<> MessageID,
continue;
}
}
if (!Result->isSuccess())
Result =
makeParsedResult<ParsedTypeSyntax>({PrevType}, Result->getStatus());
break;
}

Expand Down
5 changes: 0 additions & 5 deletions test/IDE/complete_type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNBOUND_DOT | %FileCheck %s -check-prefix=UNBOUND_DOT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=UNBOUND_DOT_2 | %FileCheck %s -check-prefix=UNBOUND_DOT_2

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERICARG_OPTIONAL | %FileCheck %s -check-prefix=GENERICARG_OPTIONAL

//===--- Helper types that are used in this test

struct FooStruct {
Expand Down Expand Up @@ -1131,6 +1129,3 @@ func testUnbound2(x: OuterStruct<Int>.Inner.#^UNBOUND_DOT_2^#) {}
// UNBOUND_DOT_2: Begin completions
// UNBOUND_DOT_2-DAG: Keyword/None: Type[#OuterStruct<Int>.Inner.Type#]; name=Type
// UNBOUND_DOT_2: End completions

func testGenericArgForOptional() -> Set<#^GENERICARG_OPTIONAL^#>? {}
// GENERICARG_OPTIONAL: Begin completions

0 comments on commit 5a6e14b

Please sign in to comment.