Skip to content

Update swift syntax #1235

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
Jan 16, 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
2 changes: 1 addition & 1 deletion CodeGeneration/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
.executable(name: "generate-swiftsyntax", targets: ["generate-swiftsyntax"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", revision: "dc89ef5759b58298f04c5edee48aed5e678e80f0"),
.package(url: "https://github.com/apple/swift-syntax.git", revision: "486a86c2c41785026cdc4813af1d4a508d644759"),
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.1.4")),
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: .docLineComment(generat
}
""")

for baseKind in SYNTAX_BASE_KINDS.filter { !["Syntax", "SyntaxCollection"].contains($0) } {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a warning warning: trailing closure in this context is confusable with the body of the statement; pass as a parenthesized argument to silence this warning

for baseKind in SYNTAX_BASE_KINDS.filter({ !["Syntax", "SyntaxCollection"].contains($0) }) {
FunctionDeclSyntax("""
/// Visit any \(raw: baseKind)Syntax node.
/// - Parameter node: the node that is being visited
Expand Down
5 changes: 5 additions & 0 deletions Sources/SwiftSyntax/generated/SyntaxBaseNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
//
//===----------------------------------------------------------------------===//

// MARK: - DeclSyntax

/// Protocol to which all `DeclSyntax` nodes conform. Extension point to add
/// common methods to all `DeclSyntax` nodes.
/// DO NOT CONFORM TO THIS PROTOCOL YOURSELF!
public protocol DeclSyntaxProtocol: SyntaxProtocol {
}

Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftSyntax/generated/SyntaxEnum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
//===----------------------------------------------------------------------===//

/// Enum to exhaustively switch over all different syntax nodes.
@frozen // FIXME: Not actually stable, works around a miscompile
public enum SyntaxEnum {
case token(TokenSyntax)
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftSyntax/generated/SyntaxKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
//===----------------------------------------------------------------------===//

/// Enumerates the known kinds of Syntax represented in the Syntax tree.
@frozen // FIXME: Not actually stable, works around a miscompile
public enum SyntaxKind {
case token
Expand Down
9 changes: 9 additions & 0 deletions Sources/SwiftSyntax/generated/SyntaxRewriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
//
//===----------------------------------------------------------------------===//

//
// This file defines the SyntaxRewriter, a class that performs a standard walk
// and tree-rebuilding pattern.
//
// Subclassers of this class can override the walking behavior for any syntax
// node and transform nodes however they like.
//
//===----------------------------------------------------------------------===//

open class SyntaxRewriter {
public init() {
}
Expand Down