Skip to content

Commit 418c2d4

Browse files
value.text instead of value.description
1 parent de5aa6b commit 418c2d4

File tree

22 files changed

+207
-206
lines changed

22 files changed

+207
-206
lines changed

Resources/branch_main/Sources/parser/TokenVisitor.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ final class TokenVisitor: SyntaxRewriter {
230230
private func replaceSymbols(text: String) -> String {
231231
text
232232
.replacingOccurrences(of: " ", with: "")
233-
.replacingOccurrences(of: "<br>", with: "")
233+
.replacingOccurrences(of: "<br>", with: "↲<br>")
234+
234235
}
235236
}
236237

Resources/branch_main/Tests/Tests/Fixtures/test-1-2.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@
653653
"text": "if",
654654
"token": {
655655
"kind": "keyword(SwiftSyntax.Keyword.if)",
656-
"leadingTrivia": "",
656+
"leadingTrivia": "<br>↲<br>",
657657
"trailingTrivia": ""
658658
},
659659
"type": "other"
@@ -1255,7 +1255,7 @@
12551255
"text": "print",
12561256
"token": {
12571257
"kind": "identifier(&quot;print&quot;)",
1258-
"leadingTrivia": "↲␣␣",
1258+
"leadingTrivia": "<br>␣␣",
12591259
"trailingTrivia": ""
12601260
},
12611261
"type": "other"
@@ -1600,7 +1600,7 @@
16001600
"text": "}",
16011601
"token": {
16021602
"kind": "rightBrace",
1603-
"leadingTrivia": "",
1603+
"leadingTrivia": "<br>",
16041604
"trailingTrivia": ""
16051605
},
16061606
"type": "other"
@@ -2323,7 +2323,7 @@
23232323
"text": "print",
23242324
"token": {
23252325
"kind": "identifier(&quot;print&quot;)",
2326-
"leadingTrivia": "↲␣␣",
2326+
"leadingTrivia": "<br>␣␣",
23272327
"trailingTrivia": ""
23282328
},
23292329
"type": "other"
@@ -2668,7 +2668,7 @@
26682668
"text": "}",
26692669
"token": {
26702670
"kind": "rightBrace",
2671-
"leadingTrivia": "",
2671+
"leadingTrivia": "<br>",
26722672
"trailingTrivia": ""
26732673
},
26742674
"type": "other"
@@ -2993,7 +2993,7 @@
29932993
"text": "print",
29942994
"token": {
29952995
"kind": "identifier(&quot;print&quot;)",
2996-
"leadingTrivia": "↲␣␣",
2996+
"leadingTrivia": "<br>␣␣",
29972997
"trailingTrivia": ""
29982998
},
29992999
"type": "other"
@@ -3338,7 +3338,7 @@
33383338
"text": "}",
33393339
"token": {
33403340
"kind": "rightBrace",
3341-
"leadingTrivia": "",
3341+
"leadingTrivia": "<br>",
33423342
"trailingTrivia": ""
33433343
},
33443344
"type": "other"
@@ -3356,7 +3356,7 @@
33563356
"text": "",
33573357
"token": {
33583358
"kind": "endOfFile",
3359-
"leadingTrivia": "<span class='lineComment' data-title='//␣Prints␣&quot;It&apos;s␣really␣warm.␣Don&apos;t␣forget␣to␣wear␣sunscreen.&quot;' data-content='lineComment' data-type='Trivia'>//␣Prints␣&quot;It&apos;s␣really␣warm.␣Don&apos;t␣forget␣to␣wear␣sunscreen.&quot;</span>",
3359+
"leadingTrivia": "<br>↲<br><span class='lineComment' data-title='//␣Prints␣&quot;It&apos;s␣really␣warm.␣Don&apos;t␣forget␣to␣wear␣sunscreen.&quot;' data-content='lineComment' data-type='Trivia'>//␣Prints␣&quot;It&apos;s␣really␣warm.␣Don&apos;t␣forget␣to␣wear␣sunscreen.&quot;</span>",
33603360
"trailingTrivia": ""
33613361
},
33623362
"type": "other"

0 commit comments

Comments
 (0)