Skip to content

Remove a few lingering grammar doc comments #2495

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
Feb 13, 2024
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
2 changes: 0 additions & 2 deletions Sources/SwiftParser/Declarations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1407,8 +1407,6 @@ extension Parser {
) -> RawAccessorDeclSyntax {
// 'set' and 'willSet' can have an optional name. This isn't valid in a
// protocol, but we parse and then reject it for better QoI.
//
// set-name ::= '(' identifier ')'
let parameters: RawAccessorParametersSyntax?
if [AccessorDeclSyntax.AccessorSpecifierOptions.set, .willSet, .didSet, .`init`].contains(introducer.kind), let lparen = self.consume(if: .leftParen) {
let (unexpectedBeforeName, name) = self.expectIdentifier()
Expand Down
10 changes: 0 additions & 10 deletions Sources/SwiftParser/Lexer/Cursor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1226,16 +1226,6 @@ extension Lexer.Cursor {
// MARK: - Literals

extension Lexer.Cursor {
/// lexNumber:
/// integer_literal ::= [0-9][0-9_]*
/// integer_literal ::= 0x[0-9a-fA-F][0-9a-fA-F_]*
/// integer_literal ::= 0o[0-7][0-7_]*
/// integer_literal ::= 0b[01][01_]*
/// floating_literal ::= [0-9][0-9]_*\.[0-9][0-9_]*
/// floating_literal ::= [0-9][0-9]*\.[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*
/// floating_literal ::= [0-9][0-9_]*[eE][+-]?[0-9][0-9_]*
/// floating_literal ::= 0x[0-9A-Fa-f][0-9A-Fa-f_]*
/// (\.[0-9A-Fa-f][0-9A-Fa-f_]*)?[pP][+-]?[0-9][0-9_]*
mutating func lexNumber() -> Lexer.Result {
precondition(self.peek().map(Unicode.Scalar.init)?.isDigit == true, "Unexpected start")

Expand Down
7 changes: 0 additions & 7 deletions Sources/SwiftParser/Patterns.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ extension Parser {
break
}

// matching-pattern ::= expr
// Fall back to expression parsing for ambiguous forms. Name lookup will
// disambiguate.
let patternSyntax = self.parseSequenceExpression(flavor: .stmtCondition, pattern: context)
Expand Down Expand Up @@ -271,12 +270,6 @@ extension Parser.Lookahead {
}
}

/// pattern ::= identifier
/// pattern ::= '_'
/// pattern ::= pattern-tuple
/// pattern ::= 'var' pattern
/// pattern ::= 'let' pattern
/// pattern ::= 'inout' pattern
mutating func canParsePattern() -> Bool {
enum PurePatternStartTokens: TokenSpecSet {
case identifier
Expand Down