You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
Generally (if you don’t consider multi-line string literals, which have their own rules), all trivia up to a newline is trailing trivia and all trivia after a newline is leading trivia.
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.
The text was updated successfully, but these errors were encountered: