Skip to content

Rename NonesapableTypes feature #2405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum ExperimentalFeature: String, CaseIterable {
case thenStatements
case typedThrows
case doExpressions
case nonEscapableTypes
case nonescapableTypes

/// The name of the feature, which is used in the doc comment.
public var featureName: String {
Expand All @@ -30,7 +30,7 @@ public enum ExperimentalFeature: String, CaseIterable {
return "typed throws"
case .doExpressions:
return "'do' expressions"
case .nonEscapableTypes:
case .nonescapableTypes:
return "NonEscableTypes"
}
}
Expand Down
4 changes: 2 additions & 2 deletions CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,9 @@ public enum Keyword: CaseIterable {
case .required:
return KeywordSpec("required")
case ._resultDependsOn:
return KeywordSpec("_resultDependsOn", experimentalFeature: .nonEscapableTypes)
return KeywordSpec("_resultDependsOn", experimentalFeature: .nonescapableTypes)
case ._resultDependsOnSelf:
return KeywordSpec("_resultDependsOnSelf", experimentalFeature: .nonEscapableTypes)
return KeywordSpec("_resultDependsOnSelf", experimentalFeature: .nonescapableTypes)
case .rethrows:
return KeywordSpec("rethrows", isLexerClassified: true)
case .retroactive:
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftParser/Modifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extension Parser {
(.declarationModifier(._local), let handle)?,
(.declarationModifier(.__setter_access), let handle)?,
(.declarationModifier(.reasync), let handle)?,
(.declarationModifier(._resultDependsOnSelf), let handle)? where experimentalFeatures.contains(.nonEscapableTypes):
(.declarationModifier(._resultDependsOnSelf), let handle)? where experimentalFeatures.contains(.nonescapableTypes):
let (unexpectedBeforeKeyword, keyword) = self.eat(handle)
elements.append(RawDeclModifierSyntax(unexpectedBeforeKeyword, name: keyword, detail: nil, arena: self.arena))
case (.declarationModifier(.rethrows), _)?:
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftParser/Patterns.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ extension Parser.Lookahead {
&& !self.at(.keyword(.__owned))
&& !self.at(.keyword(.borrowing))
&& !self.at(.keyword(.consuming))
&& !(experimentalFeatures.contains(.nonEscapableTypes) && self.at(.keyword(._resultDependsOn)))
&& !(experimentalFeatures.contains(.nonescapableTypes) && self.at(.keyword(._resultDependsOn)))
{
return true
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftParser/TokenSpecSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ enum DeclarationModifier: TokenSpecSet {
case TokenSpec(.static): self = .static
case TokenSpec(.unowned): self = .unowned
case TokenSpec(.weak): self = .weak
case TokenSpec(._resultDependsOn) where experimentalFeatures.contains(.nonEscapableTypes): self = ._resultDependsOn
case TokenSpec(._resultDependsOnSelf) where experimentalFeatures.contains(.nonEscapableTypes): self = ._resultDependsOnSelf
case TokenSpec(._resultDependsOn) where experimentalFeatures.contains(.nonescapableTypes): self = ._resultDependsOn
case TokenSpec(._resultDependsOnSelf) where experimentalFeatures.contains(.nonescapableTypes): self = ._resultDependsOnSelf
default: return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftParser/generated/ExperimentalFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ extension Parser.ExperimentalFeatures {
public static let doExpressions = Self (rawValue: 1 << 3)

/// Whether to enable the parsing of NonEscableTypes.
public static let nonEscapableTypes = Self (rawValue: 1 << 4)
public static let nonescapableTypes = Self (rawValue: 1 << 4)
}
4 changes: 2 additions & 2 deletions Sources/SwiftParser/generated/Parser+TokenSpecSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extension AttributedTypeSyntax {
self = .borrowing
case TokenSpec(.consuming):
self = .consuming
case TokenSpec(._resultDependsOn) where experimentalFeatures.contains(.nonEscapableTypes):
case TokenSpec(._resultDependsOn) where experimentalFeatures.contains(.nonescapableTypes):
self = ._resultDependsOn
default:
return nil
Expand Down Expand Up @@ -793,7 +793,7 @@ extension DeclModifierSyntax {
self = .public
case TokenSpec(.reasync):
self = .reasync
case TokenSpec(._resultDependsOnSelf) where experimentalFeatures.contains(.nonEscapableTypes):
case TokenSpec(._resultDependsOnSelf) where experimentalFeatures.contains(.nonescapableTypes):
self = ._resultDependsOnSelf
case TokenSpec(.required):
self = .required
Expand Down
8 changes: 4 additions & 4 deletions Tests/SwiftParserTest/DeclarationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3105,7 +3105,7 @@ final class DeclarationTests: ParserTestCase {
}
}
""",
experimentalFeatures: .nonEscapableTypes
experimentalFeatures: .nonescapableTypes
)

assertParse(
Expand All @@ -3116,7 +3116,7 @@ final class DeclarationTests: ParserTestCase {
}
}
""",
experimentalFeatures: .nonEscapableTypes
experimentalFeatures: .nonescapableTypes
)
}

Expand All @@ -3128,7 +3128,7 @@ final class DeclarationTests: ParserTestCase {
return Builtin.unsafeCastToNativeObject(x)
}
""",
experimentalFeatures: .nonEscapableTypes
experimentalFeatures: .nonescapableTypes
)

assertParse(
Expand All @@ -3138,7 +3138,7 @@ final class DeclarationTests: ParserTestCase {
return (Builtin.unsafeCastToNativeObject(x), Builtin.unsafeCastToNativeObject(x))
}
""",
experimentalFeatures: .nonEscapableTypes
experimentalFeatures: .nonescapableTypes
)
}
}