Skip to content

Rename MisspelledAsyncSpecifiers -> MisspelledAsyncTokenKinds #1767

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
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
16 changes: 8 additions & 8 deletions Sources/SwiftParser/Specifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public enum EffectSpecifier: TokenSpecSet {
protocol RawEffectSpecifiersTrait {
/// The token kinds that should be consumed as misspelled `asyncSpecifier`.
/// Should be a subset of ``AsyncEffectSpecifier``.
associatedtype MisspelledAsyncSpecifiers: TokenSpecSet
associatedtype MisspelledAsyncTokenKinds: TokenSpecSet

/// The token kinds that we can consume as a correct `asyncSpecifier`.
/// Should be a subset of ``AsyncEffectSpecifier``.
Expand Down Expand Up @@ -181,7 +181,7 @@ extension RawEffectSpecifiersTrait {
}

extension RawFunctionEffectSpecifiersSyntax: RawEffectSpecifiersTrait {
enum MisspelledAsyncSpecifiers: TokenSpecSet {
enum MisspelledAsyncTokenKinds: TokenSpecSet {
case await

init?(lexeme: Lexer.Lexeme) {
Expand Down Expand Up @@ -260,7 +260,7 @@ extension RawFunctionEffectSpecifiersSyntax: RawEffectSpecifiersTrait {
}

extension RawTypeEffectSpecifiersSyntax: RawEffectSpecifiersTrait {
enum MisspelledAsyncSpecifiers: TokenSpecSet {
enum MisspelledAsyncTokenKinds: TokenSpecSet {
case await
case reasync

Expand Down Expand Up @@ -339,7 +339,7 @@ extension RawTypeEffectSpecifiersSyntax: RawEffectSpecifiersTrait {
}

extension RawAccessorEffectSpecifiersSyntax: RawEffectSpecifiersTrait {
enum MisspelledAsyncSpecifiers: TokenSpecSet {
enum MisspelledAsyncTokenKinds: TokenSpecSet {
case await
case reasync

Expand Down Expand Up @@ -442,7 +442,7 @@ extension Parser {
var unexpectedBeforeThrows: [RawSyntax] = []
var throwsKeyword: RawTokenSyntax?
var unexpectedAfterThrows: [RawSyntax] = []
while let misspelledAsync = self.consume(ifAnyIn: S.MisspelledAsyncSpecifiers.self) {
while let misspelledAsync = self.consume(ifAnyIn: S.MisspelledAsyncTokenKinds.self) {
unexpectedBeforeAsync.append(RawSyntax(misspelledAsync))
if asyncKeyword == nil {
// Let's synthesize a missing 'async'. If we find a real async specifier
Expand All @@ -458,7 +458,7 @@ extension Parser {

var unexpectedBeforeThrowsLoopProgress = LoopProgressCondition()
while unexpectedBeforeThrowsLoopProgress.evaluate(self.currentToken) {
if let misspelledAsync = self.consume(ifAnyIn: S.MisspelledAsyncSpecifiers.self) {
if let misspelledAsync = self.consume(ifAnyIn: S.MisspelledAsyncTokenKinds.self) {
unexpectedBeforeThrows.append(RawSyntax(misspelledAsync))
} else if let misspelledThrows = self.consume(ifAnyIn: S.MisspelledThrowsTokenKinds.self) {
unexpectedBeforeThrows.append(RawSyntax(misspelledThrows))
Expand All @@ -480,7 +480,7 @@ extension Parser {

var unexpectedAfterThrowsLoopProgress = LoopProgressCondition()
while unexpectedAfterThrowsLoopProgress.evaluate(self.currentToken) {
if let (_, handle, _) = self.at(anyIn: S.MisspelledAsyncSpecifiers.self, or: S.CorrectAsyncTokenKinds.self) {
if let (_, handle, _) = self.at(anyIn: S.MisspelledAsyncTokenKinds.self, or: S.CorrectAsyncTokenKinds.self) {
let misspelledAsync = self.eat(handle)
unexpectedAfterThrows.append(RawSyntax(misspelledAsync))
if asyncKeyword == nil {
Expand Down Expand Up @@ -531,7 +531,7 @@ extension Parser {
var unexpected: [RawTokenSyntax] = []
var loopProgress = LoopProgressCondition()
while loopProgress.evaluate(self.currentToken) {
if let (spec, handle, matchedSubset) = self.at(anyIn: S.MisspelledAsyncSpecifiers.self, or: S.CorrectAsyncTokenKinds.self) {
if let (spec, handle, matchedSubset) = self.at(anyIn: S.MisspelledAsyncTokenKinds.self, or: S.CorrectAsyncTokenKinds.self) {
let misspelledAsync = self.eat(handle)
unexpected.append(misspelledAsync)
if effectSpecifiers?.asyncSpecifier == nil {
Expand Down