Skip to content

Commit a7be716

Browse files
authored
Merge branch 'main' into swift-lexical-lookup-rfc
2 parents 4c6181c + b66e024 commit a7be716

File tree

207 files changed

+7844
-4237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+7844
-4237
lines changed

Diff for: .bazelrc

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
##===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the Swift.org open source project
4+
##
5+
## Copyright (c) 2014 - 2025 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+
113
common --enable_bzlmod
214
common --incompatible_disallow_empty_glob
315
common --incompatible_use_host_features

Diff for: .editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
##===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the Swift.org open source project
4+
##
5+
## Copyright (c) 2014 - 2025 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+
113
# editorconfig.org
214

315
root = true

Diff for: .flake8

-28
This file was deleted.

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/generated/** linguist-generated=true

Diff for: .github/ISSUE_TEMPLATE/BASICFORMAT_BUG.yml

+34-34
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@ name: BasicFormat Bug
22
description: A bug in the BasicFormat module
33
labels: [bug, BasicFormat]
44
body:
5-
- type: markdown
6-
attributes:
7-
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing BasicFormat Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftbasicformat/filingbugreports).
8-
- type: textarea
9-
id: source
10-
attributes:
11-
label: Source Code
12-
description: The source code that, when formatted, produces incorrectly formatted code.
13-
value: |
14-
```swift
15-
```
16-
- type: textarea
17-
id: source
18-
attributes:
19-
label: Actual Formatted Code
20-
description: The way that `BasicFormat` formats the above code
21-
value: |
22-
```swift
23-
```
5+
- type: markdown
6+
attributes:
7+
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing BasicFormat Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftbasicformat/filingbugreports).
248
- type: textarea
25-
id: source
26-
attributes:
27-
label: Expected Formatted Code
28-
description: The way that you think `BasicFormat` should format the code
29-
value: |
30-
```swift
31-
```
32-
- type: textarea
33-
id: description
34-
attributes:
35-
label: Description
36-
description: |
37-
Any additional information you can provide for this issue, like
38-
- Has this issue started occurring recently?
39-
- Is the issue only happening under certain circumstances?
9+
id: source
10+
attributes:
11+
label: Source Code
12+
description: The source code that, when formatted, produces incorrectly formatted code.
13+
value: |
14+
```swift
15+
```
16+
- type: textarea
17+
id: source
18+
attributes:
19+
label: Actual Formatted Code
20+
description: The way that `BasicFormat` formats the above code
21+
value: |
22+
```swift
23+
```
24+
- type: textarea
25+
id: source
26+
attributes:
27+
label: Expected Formatted Code
28+
description: The way that you think `BasicFormat` should format the code
29+
value: |
30+
```swift
31+
```
32+
- type: textarea
33+
id: description
34+
attributes:
35+
label: Description
36+
description: |
37+
Any additional information you can provide for this issue, like
38+
- Has this issue started occurring recently?
39+
- Is the issue only happening under certain circumstances?

Diff for: .github/ISSUE_TEMPLATE/BUG_REPORT.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ name: Bug Report
22
description: Something isn't working as expected
33
labels: [bug]
44
body:
5-
- type: textarea
6-
id: description
7-
attributes:
8-
label: Description
9-
description: |
10-
A short description of the incorrect behavior.
11-
If you think this issue has been recently introduced and did not occur in an
12-
earlier version, please note that. If possible, include the last version that
13-
the behavior was correct in addition to your current version.
14-
- type: textarea
15-
id: steps-to-reproduce
16-
attributes:
17-
label: Steps to Reproduce
18-
description: Replace this paragraph with an explanation of how to reproduce the incorrect behavior.
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: |
10+
A short description of the incorrect behavior.
11+
If you think this issue has been recently introduced and did not occur in an
12+
earlier version, please note that. If possible, include the last version that
13+
the behavior was correct in addition to your current version.
14+
- type: textarea
15+
id: steps-to-reproduce
16+
attributes:
17+
label: Steps to Reproduce
18+
description: Replace this paragraph with an explanation of how to reproduce the incorrect behavior.

Diff for: .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Feature Request
22
description: A suggestion for a new feature
33
labels: [enhancement]
44
body:
5-
- type: textarea
6-
id: description
7-
attributes:
8-
label: Description
9-
description: |
10-
A description of your proposed feature.
11-
Examples that show what's missing, or what new capabilities will be possible, are very helpful!
12-
If this feature unlocks new use-cases please describe them.
13-
Provide links to existing issues or external references/discussions, if appropriate.
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: |
10+
A description of your proposed feature.
11+
Examples that show what's missing, or what new capabilities will be possible, are very helpful!
12+
If this feature unlocks new use-cases please describe them.
13+
Provide links to existing issues or external references/discussions, if appropriate.

Diff for: .github/ISSUE_TEMPLATE/PARSER_BUG.yml

+33-33
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@ name: SwiftParser Bug
22
description: A bug in the new Swift parser
33
labels: [bug, SwiftParser]
44
body:
5-
- type: markdown
6-
attributes:
7-
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports).
8-
- type: dropdown
9-
id: issue-type
10-
attributes:
11-
label: Issue Kind
12-
description: What kind of issue is this? See [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details.
13-
options:
14-
- Round-Trip Failure
15-
- Parser Crash
16-
- Parse of Valid Source Failed
17-
- Parse of Valid Source Produced Invalid Syntax Tree
18-
- Bad Diagnostic Produced
19-
- Other
20-
- I Don’t Know
21-
- type: textarea
22-
id: source
23-
attributes:
24-
label: Source Code
25-
description: The source code that, when fed into the parser, produces the bug.
26-
value: |
27-
```swift
28-
```
29-
- type: textarea
30-
id: description
31-
attributes:
32-
label: Description
33-
description: |
34-
Any additional information you can provide for this issue, like
35-
- What did you expect to happen?
36-
- Has this issue started occurring recently?
37-
- If it’s a crash, the stack trace.
5+
- type: markdown
6+
attributes:
7+
value: Thanks for taking the time to fill out this bug report! We would really appreciate if you could take the time to reduce the issue as described in [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports).
8+
- type: dropdown
9+
id: issue-type
10+
attributes:
11+
label: Issue Kind
12+
description: What kind of issue is this? See [Filing Parser Bug Reports](https://swiftpackageindex.com/swiftlang/swift-syntax/main/documentation/swiftparser/filingbugreports) for more details.
13+
options:
14+
- Round-Trip Failure
15+
- Parser Crash
16+
- Parse of Valid Source Failed
17+
- Parse of Valid Source Produced Invalid Syntax Tree
18+
- Bad Diagnostic Produced
19+
- Other
20+
- I Don’t Know
21+
- type: textarea
22+
id: source
23+
attributes:
24+
label: Source Code
25+
description: The source code that, when fed into the parser, produces the bug.
26+
value: |
27+
```swift
28+
```
29+
- type: textarea
30+
id: description
31+
attributes:
32+
label: Description
33+
description: |
34+
Any additional information you can provide for this issue, like
35+
- What did you expect to happen?
36+
- Has this issue started occurring recently?
37+
- If it’s a crash, the stack trace.

Diff for: .github/ISSUE_TEMPLATE/config.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# This source file is part of the Swift.org open source project
2-
#
3-
# Copyright (c) 2022 Apple Inc. and the Swift project authors
4-
# Licensed under Apache License v2.0 with Runtime Library Exception
5-
#
6-
# See https://swift.org/LICENSE.txt for license information
7-
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
2+
#
3+
# Copyright (c) 2022 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See https://swift.org/LICENSE.txt for license information
7+
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
88

9-
contact_links:
10-
- name: Discussion Forum
11-
url: https://forums.swift.org/tags/c/development/tooling/39/swift-syntax
12-
about: Ask and answer questions about SwiftSyntax
13-
- name: SwiftSyntax Documentation
14-
url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax
15-
about: Learn about how to use the SwiftSyntax in your projects
9+
contact_links:
10+
- name: Discussion Forum
11+
url: https://forums.swift.org/tags/c/development/tooling/39/swift-syntax
12+
about: Ask and answer questions about SwiftSyntax
13+
- name: SwiftSyntax Documentation
14+
url: https://swiftpackageindex.com/swiftlang/swift-syntax/documentation/swiftsyntax
15+
about: Learn about how to use the SwiftSyntax in your projects

Diff for: .github/workflows/publish_release.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Publish Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
prerelease:
7+
type: boolean
8+
description: "Prerelease"
9+
# Whether to create a prerelease or proper release
10+
default: true
11+
required: true
12+
swift_syntax_version:
13+
type: string
14+
default: 601.0.0
15+
description: "swift-syntax version"
16+
# The version of swift-syntax to tag. If this is a prerelease, `-prerelease-<date>` is added to this version.
17+
required: true
18+
19+
jobs:
20+
check_triggering_actor:
21+
name: Check user is allowed to create release
22+
# Only a single user should be allowed to create releases to avoid two people triggering the creation of a release
23+
# at the same time. If the release manager changes between users, update this condition.
24+
runs-on: ubuntu-latest
25+
steps:
26+
- run: |
27+
if [[ "${{ github.triggering_actor }}" != "ahoppen" ]]; then
28+
echo "${{ github.triggering_actor }} is not allowed to create a release"
29+
exit 1
30+
fi
31+
test:
32+
name: Test in ${{ matrix.release && 'Release' || 'Debug' }} configuration
33+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
release: [true, false]
38+
with:
39+
# We require that releases of swift-syntax build without warnings
40+
linux_build_command: swift test -Xswiftc -warnings-as-errors ${{ matrix.release && '-c release' || '' }}
41+
windows_build_command: swift test -Xswiftc -warnings-as-errors ${{ matrix.release && '-c release' || '' }}
42+
create_tag:
43+
name: Create Tag
44+
runs-on: ubuntu-latest
45+
needs: [check_triggering_actor, test]
46+
permissions:
47+
contents: write
48+
outputs:
49+
swift_syntax_version: ${{ steps.swift_syntax_version.outputs.swift_syntax_version }}
50+
steps:
51+
- name: Determine tag name
52+
id: swift_syntax_version
53+
run: |
54+
if [[ "${{ github.event.inputs.prerelease }}" == "false" ]]; then
55+
SWIFT_SYNTAX_VERSION="${{ github.event.inputs.swift_syntax_version }}"
56+
else
57+
SWIFT_SYNTAX_VERSION="${{ github.event.inputs.swift_syntax_version }}-prerelease-$(date +'%Y-%m-%d')"
58+
fi
59+
echo "Using swift-syntax version: $SWIFT_SYNTAX_VERSION"
60+
echo "swift_syntax_version=$SWIFT_SYNTAX_VERSION" >> "$GITHUB_OUTPUT"
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
- name: Tag release
64+
run: |
65+
git tag "${{ steps.swift_syntax_version.outputs.swift_syntax_version }}"
66+
git push origin "${{ steps.swift_syntax_version.outputs.swift_syntax_version }}"
67+
create_release:
68+
name: Create prerelease on GitHub
69+
runs-on: ubuntu-latest
70+
needs: [create_tag]
71+
# Only create a release automatically for prereleases. For real releases, release notes should be crafted by hand.
72+
if: ${{ github.event.inputs.prerelease }}
73+
permissions:
74+
contents: write
75+
steps:
76+
- name: Checkout repository
77+
uses: actions/checkout@v4
78+
- name: Create release
79+
env:
80+
GH_TOKEN: ${{ github.token }}
81+
run: |
82+
gh release create "${{ needs.create_tag.outputs.swift_syntax_version }}" \
83+
--title "${{ needs.create_tag.outputs.swift_syntax_version }}" \
84+
--prerelease

0 commit comments

Comments
 (0)