File tree Expand file tree Collapse file tree 27 files changed +193
-9
lines changed
CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax
SwiftSyntaxMacroExpansion
SwiftSyntaxMacros/MacroProtocols
SwiftSyntax/generated/raw
SwiftParserTest/translated Expand file tree Collapse file tree 27 files changed +193
-9
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ fileprivate extension Node {
39
39
}
40
40
41
41
func rawSyntaxNodesFile( nodesStartingWith: [ Character ] ) -> SourceFileSyntax {
42
- return SourceFileSyntax {
42
+ return SourceFileSyntax ( leadingTrivia : copyrightHeader ) {
43
43
for node in SYNTAX_NODES where node. kind. isBase && nodesStartingWith. contains ( node. kind. syntaxType. description. first!) {
44
44
DeclSyntax (
45
45
"""
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+
1
13
import SwiftSyntax
2
14
3
15
public extension SyntaxProtocol {
Original file line number Diff line number Diff line change 1
- //===-------------------------- Nominals.swift -----------------------------===//
1
+ //===----------------------------------------- -----------------------------===//
2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
Original file line number Diff line number Diff line change 1
- //===--- LexerDiagnosticMessages.swift ------------------------------------===//
1
+ //===---------------------------------- ------------------------------------===//
2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public struct RawAccessorBlockSyntax : RawSyntaxNodeProtocol {
3
17
public enum Accessors : RawSyntaxNodeProtocol {
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public struct RawCanImportExprSyntax : RawExprSyntaxNodeProtocol {
3
17
@_spi ( RawSyntax)
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public protocol RawDeclSyntaxNodeProtocol : RawSyntaxNodeProtocol { }
3
17
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public protocol RawExprSyntaxNodeProtocol : RawSyntaxNodeProtocol { }
3
17
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public struct RawGenericArgumentClauseSyntax : RawSyntaxNodeProtocol {
3
17
@_spi ( RawSyntax)
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public struct RawKeyPathComponentListSyntax : RawSyntaxNodeProtocol {
3
17
@_spi ( RawSyntax)
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public protocol RawPatternSyntaxNodeProtocol : RawSyntaxNodeProtocol { }
3
17
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public protocol RawStmtSyntaxNodeProtocol : RawSyntaxNodeProtocol { }
3
17
Original file line number Diff line number Diff line change
1
+ //// Automatically generated by generate-swift-syntax
2
+ //// Do not edit directly!
3
+ //===----------------------------------------------------------------------===//
4
+ //
5
+ // This source file is part of the Swift.org open source project
6
+ //
7
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
8
+ // Licensed under Apache License v2.0 with Runtime Library Exception
9
+ //
10
+ // See https://swift.org/LICENSE.txt for license information
11
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
1
15
@_spi ( RawSyntax)
2
16
public protocol RawTypeSyntaxNodeProtocol : RawSyntaxNodeProtocol { }
3
17
Original file line number Diff line number Diff line change 1
- //===--- ResultBuilderExtensions.swift ------------------------------------===//
1
+ //===---------------------------------- ------------------------------------===//
2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+
1
13
import SwiftSyntax
2
14
3
15
extension FunctionParameterSyntax {
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+
1
13
import SwiftDiagnostics
2
14
import SwiftSyntax
3
15
import SwiftSyntaxBuilder
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
1
2
//
2
3
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
3
4
// Licensed under Apache License v2.0 with Runtime Library Exception
Original file line number Diff line number Diff line change 1
- @_spi ( Testing) import SwiftOperators
2
- import SwiftParser
3
- import SwiftSyntax
4
1
//===----------------------------------------------------------------------===//
5
2
//
6
3
// This source file is part of the Swift.org open source project
@@ -12,6 +9,10 @@ import SwiftSyntax
12
9
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
13
10
//
14
11
//===----------------------------------------------------------------------===//
12
+
13
+ @_spi ( Testing) import SwiftOperators
14
+ import SwiftParser
15
+ import SwiftSyntax
15
16
import XCTest
16
17
import _SwiftSyntaxTestSupport
17
18
Original file line number Diff line number Diff line change 1
- import SwiftOperators
2
- import SwiftSyntax
3
1
//===----------------------------------------------------------------------===//
4
2
//
5
3
// This source file is part of the Swift.org open source project
@@ -11,6 +9,9 @@ import SwiftSyntax
11
9
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
12
10
//
13
11
//===----------------------------------------------------------------------===//
12
+
13
+ import SwiftOperators
14
+ import SwiftSyntax
14
15
import XCTest
15
16
16
17
public class SyntaxSynthesisTests : XCTestCase {
Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2023 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+
1
13
// This test file has been translated from swift/test/Parse/recovery.swift
2
14
3
15
import XCTest
You can’t perform that action at this time.
0 commit comments