Skip to content

Commit 48d7953

Browse files
author
Harlan Haskins
authored
Merge pull request swiftlang#22741 from matklad/patch-1
Clarify the rule for leading trivia
2 parents 310a6ff + 8c77e08 commit 48d7953

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Syntax/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ new `Syntax` nodes:
280280
the next newline character.
281281

282282
2. Looking backward in the text, a token owns all of the leading trivia
283-
up to and including the first contiguous sequence of newlines characters.
283+
up to and including the first newline character.
284+
285+
In other words, a contiguous stretch of trivia between two tokens is split on the
286+
leftmost newline.
284287

285288
Let's take a look at how this shows up in practice with a small snippet of Swift
286289
code.

0 commit comments

Comments
 (0)