@@ -25,7 +25,7 @@ extension TokenConsumer {
2525 // misplaced attributes.
2626 _ = lookahead. consumeAttributeList ( )
2727 }
28- return lookahead. isStartOfStatement ( allowRecovery: allowRecovery)
28+ return lookahead. atStartOfStatement ( allowRecovery: allowRecovery)
2929 }
3030}
3131
@@ -808,7 +808,7 @@ extension Parser.Lookahead {
808808 ///
809809 /// - Note: This function must be kept in sync with `parseStatement()`.
810810 /// - Seealso: ``Parser/parseStatement()``
811- mutating func isStartOfStatement ( allowRecovery: Bool = false ) -> Bool {
811+ mutating func atStartOfStatement ( allowRecovery: Bool = false ) -> Bool {
812812 if ( self . at ( anyIn: SwitchCaseStart . self) != nil || self . at ( . atSign) ) && withLookahead ( { $0. atStartOfSwitchCaseItem ( ) } ) {
813813 // We consider SwitchCaseItems statements so we don't parse the start of a new case item as trailing parts of an expression.
814814 return true
@@ -884,7 +884,7 @@ extension Parser.Lookahead {
884884
885885 /// Returns whether the parser's current position is the start of a switch case,
886886 /// given that we're in the middle of a switch already.
887- mutating func isAtStartOfSwitchCase ( allowRecovery: Bool = false ) -> Bool {
887+ mutating func atStartOfSwitchCase ( allowRecovery: Bool = false ) -> Bool {
888888 // Check for and consume attributes. The only valid attribute is `@unknown`
889889 // but that's a semantic restriction.
890890 var lookahead = self . lookahead ( )
@@ -916,9 +916,9 @@ extension Parser.Lookahead {
916916 }
917917 }
918918
919- mutating func isStartOfConditionalSwitchCases ( ) -> Bool {
919+ mutating func atStartOfConditionalSwitchCases ( ) -> Bool {
920920 guard self . at ( . poundIf) else {
921- return self . isAtStartOfSwitchCase ( )
921+ return self . atStartOfSwitchCase ( )
922922 }
923923
924924 var lookahead = self . lookahead ( )
@@ -928,6 +928,6 @@ extension Parser.Lookahead {
928928 // just find the end of the line
929929 lookahead. skipUntilEndOfLine ( )
930930 } while lookahead. at ( . poundIf, . poundElseif, . poundElse) && lookahead. hasProgressed ( & loopProgress)
931- return lookahead. isAtStartOfSwitchCase ( )
931+ return lookahead. atStartOfSwitchCase ( )
932932 }
933933}
0 commit comments