swiftlang / swiftlang/swift-syntax

Request for Documentation on Parsing Rules for Trivia in swift-syntax

Open
#2,582 2 comments 1 reaction 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.