swiftlang / swiftlang/swift-syntax
Request for Documentation on Parsing Rules for Trivia in swift-syntax
- Dominant language
- Swift
- Stars
- 3.7k
- Forks
- 553
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 16
Description
### Description
I'd like to request documentation on the rules for parsing Trivia.
There used to be documentation explaining the rules for parsing Trivia back when we were using `libSyntax`,
but it seems to have disappeared since the transition to `swift-syntax`.
The URL at the time was as follows.
https://github.com/apple/swift/blob/980d40951ff557047dce833d1d092b400bbc20db/lib/Syntax/README.md
Just to be sure, I searched both the repository and the documentation site, but I couldn't find it.
Understanding what constitutes the trailing trivia of a preceding token and
what becomes the leading trivia of a following token
is essential for implementing tools that process code.
It's challenging to deduce this behavior from the actual behavior alone,
so I believe it's necessary to have a document that explains this.
Contributor guide
Assessment
This issue has not been assessed yet.