diff --git a/include/swift/Parse/Parser.h b/include/swift/Parse/Parser.h index 3ba0dd8a6b5..2ca988cc2a3 100644 --- a/include/swift/Parse/Parser.h +++ b/include/swift/Parse/Parser.h @@ -121,12 +121,6 @@ public: IVOLP_InLet } InVarOrLetPattern = IVOLP_NotInVarOrLet; - bool GreaterThanIsOperator = true; - - /// FIXME: Temporary hack to keep the selector-style declaration - /// syntax working. - bool ArgumentIsParameter = false; - bool InPoundLineEnvironment = false; LocalContext *CurLocalContext = nullptr; @@ -222,24 +216,6 @@ public: } }; - /// A RAII object for temporarily changing whether an operator starting with - /// '>' is an operator. - class GreaterThanIsOperatorRAII { - Parser &P; - bool OldValue; - - public: - GreaterThanIsOperatorRAII(Parser &p, bool newValue) - : P(p), OldValue(p.GreaterThanIsOperator) - { - P.GreaterThanIsOperator = newValue; - } - - ~GreaterThanIsOperatorRAII() { - P.GreaterThanIsOperator = OldValue; - } - }; - /// Describes the kind of a lexical structure marker, indicating /// what kind of structural element we started parsing at a /// particular location. diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index b480784c432..1358f7f99c4 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -185,10 +185,6 @@ parse_operator: switch (Tok.getKind()) { case tok::oper_binary_spaced: case tok::oper_binary_unspaced: { - // If '>' is not an operator and this token starts with a '>', we're done. - if (!GreaterThanIsOperator && startsWithGreater(Tok)) - goto done; - // If this is an "&& #available()" expression (or related things that // show up in a stmt-condition production), then don't eat it. // @@ -1589,10 +1585,6 @@ ParserResult Parser::parseExprPostfix(Diag<> ID, bool isExprBasic) { // Check for a postfix-operator suffix. if (Tok.is(tok::oper_postfix)) { - // If '>' is not an operator and this token starts with a '>', we're done. - if (!GreaterThanIsOperator && startsWithGreater(Tok)) - return Result; - Expr *oper = parseExprOperator(); Result = makeParserResult( new (Context) PostfixUnaryExpr(oper, Result.get())); diff --git a/lib/Parse/ParsePattern.cpp b/lib/Parse/ParsePattern.cpp index 42c5786af5d..dcae41bd649 100644 --- a/lib/Parse/ParsePattern.cpp +++ b/lib/Parse/ParsePattern.cpp @@ -908,14 +908,8 @@ ParserResult Parser::parsePattern() { Pattern *Parser::createBindingFromPattern(SourceLoc loc, Identifier name, bool isLet) { - VarDecl *var; - if (ArgumentIsParameter) { - var = new (Context) ParamDecl(isLet, SourceLoc(), loc, name, loc, name, - Type(), CurDeclContext); - } else { - var = new (Context) VarDecl(/*static*/ false, /*IsLet*/ isLet, - loc, name, Type(), CurDeclContext); - } + auto var = new (Context) VarDecl(/*static*/ false, /*IsLet*/ isLet, + loc, name, Type(), CurDeclContext); return new (Context) NamedPattern(var); }