Skip to content

Commit 4ad8efc

Browse files
committed
[Parse] Remove unused HandleCodeCompletion param in parseType()
NFC
1 parent 147015d commit 4ad8efc

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

include/swift/Parse/Parser.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,15 +1176,12 @@ class Parser {
11761176

11771177
ParserResult<TypeRepr> parseType();
11781178
ParserResult<TypeRepr> parseType(Diag<> MessageID,
1179-
bool HandleCodeCompletion = true,
11801179
bool IsSILFuncDecl = false);
11811180

11821181
ParserResult<TypeRepr>
1183-
parseTypeSimpleOrComposition(Diag<> MessageID,
1184-
bool HandleCodeCompletion = true);
1182+
parseTypeSimpleOrComposition(Diag<> MessageID);
11851183

1186-
ParserResult<TypeRepr> parseTypeSimple(Diag<> MessageID,
1187-
bool HandleCodeCompletion = true);
1184+
ParserResult<TypeRepr> parseTypeSimple(Diag<> MessageID);
11881185

11891186
/// Parse layout constraint.
11901187
LayoutConstraint parseLayoutConstraint(Identifier LayoutConstraintID);

lib/Parse/ParseType.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ LayoutConstraint Parser::parseLayoutConstraint(Identifier LayoutConstraintID) {
151151
/// type-simple '!'
152152
/// type-collection
153153
/// type-array
154-
ParserResult<TypeRepr> Parser::parseTypeSimple(Diag<> MessageID,
155-
bool HandleCodeCompletion) {
154+
ParserResult<TypeRepr> Parser::parseTypeSimple(Diag<> MessageID) {
156155
ParserResult<TypeRepr> ty;
157156

158157
if (Tok.is(tok::kw_inout) ||
@@ -175,8 +174,6 @@ ParserResult<TypeRepr> Parser::parseTypeSimple(Diag<> MessageID,
175174
ty = parseTypeTupleBody();
176175
break;
177176
case tok::code_complete:
178-
if (!HandleCodeCompletion)
179-
break;
180177
if (CodeCompletion)
181178
CodeCompletion->completeTypeSimpleBeginning();
182179
return makeParserCodeCompletionResult<TypeRepr>(
@@ -358,7 +355,6 @@ ParserResult<TypeRepr> Parser::parseSILBoxType(GenericParamList *generics,
358355
/// type-composition 'async'? 'throws'? '->' type
359356
///
360357
ParserResult<TypeRepr> Parser::parseType(Diag<> MessageID,
361-
bool HandleCodeCompletion,
362358
bool IsSILFuncDecl) {
363359
// Start a context for creating type syntax.
364360
SyntaxParsingContext TypeParsingContext(SyntaxContext,
@@ -404,8 +400,7 @@ ParserResult<TypeRepr> Parser::parseType(Diag<> MessageID,
404400
return parseSILBoxType(generics, attrs, GenericsScope);
405401
}
406402

407-
ParserResult<TypeRepr> ty =
408-
parseTypeSimpleOrComposition(MessageID, HandleCodeCompletion);
403+
ParserResult<TypeRepr> ty = parseTypeSimpleOrComposition(MessageID);
409404
if (ty.isNull())
410405
return ty;
411406
auto tyR = ty.get();
@@ -834,8 +829,7 @@ Parser::parseTypeIdentifier(bool isParsingQualifiedDeclBaseType) {
834829
/// 'some'? type-simple
835830
/// type-composition '&' type-simple
836831
ParserResult<TypeRepr>
837-
Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
838-
bool HandleCodeCompletion) {
832+
Parser::parseTypeSimpleOrComposition(Diag<> MessageID) {
839833
SyntaxParsingContext SomeTypeContext(SyntaxContext, SyntaxKind::SomeType);
840834
// Check for the opaque modifier.
841835
// This is only semantically allowed in certain contexts, but we parse it
@@ -859,8 +853,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
859853

860854
SyntaxParsingContext CompositionContext(SyntaxContext, SyntaxContextKind::Type);
861855
// Parse the first type
862-
ParserResult<TypeRepr> FirstType = parseTypeSimple(MessageID,
863-
HandleCodeCompletion);
856+
ParserResult<TypeRepr> FirstType = parseTypeSimple(MessageID);
864857
if (FirstType.isNull())
865858
return FirstType;
866859
if (!Tok.isContextualPunctuator("&")) {
@@ -918,7 +911,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
918911

919912
// Parse next type.
920913
ParserResult<TypeRepr> ty =
921-
parseTypeSimple(diag::expected_identifier_for_type, HandleCodeCompletion);
914+
parseTypeSimple(diag::expected_identifier_for_type);
922915
if (ty.hasCodeCompletion())
923916
return makeParserCodeCompletionResult<TypeRepr>();
924917
Status |= ty;

lib/SIL/Parser/ParseSIL.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,6 @@ bool SILParser::parseSILType(SILType &Result,
12591259
}
12601260

12611261
ParserResult<TypeRepr> TyR = P.parseType(diag::expected_sil_type,
1262-
/*handleCodeCompletion*/ true,
12631262
/*isSILFuncDecl*/ IsFuncDecl);
12641263

12651264
if (TyR.isNull())

0 commit comments

Comments
 (0)