-
Notifications
You must be signed in to change notification settings - Fork 470
Document that Trivia cannot represent invalid UTF-8
#1490
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
Conversation
|
@swift-ci Please test |
| /// Note: `Trivia` is not able to represent invalid UTF-8 sequences. To get | ||
| /// the leading trivia text including all invalid UTF-8 sequences, use | ||
| /// ``` | ||
| /// node.syntaxTextBytes[(node.byteSize - node.trailingTriviaLength.utf8Length)...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
node.syntaxTextBytes.suffix(node.trailingTriviaLength.utf8Length)looks easier. But it doesn't really matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there is no suffix on Array. But I took the suggestion for prefix.
8a82241 to
fe6ab43
Compare
|
@swift-ci Please test |
|
@swift-ci Please test macOS |
|
@swift-ci Please test Windows |
…-utf8 Document that `Trivia` cannot represent invalid UTF-8
…-utf8 Document that `Trivia` cannot represent invalid UTF-8
No description provided.