Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/swift-parser-cli/swift-parser-cli.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ class PrintTree: ParsableCommand {
@Flag(name: .long, help: "Perform sequence folding with the standard operators")
var foldSequences: Bool = false

@Flag(name: .long, help: "Include trivia in the output")
var includeTrivia: Bool = false

func run() throws {
let source = try getContentsOfSourceFile(at: sourceFile)

Expand All @@ -195,7 +198,7 @@ class PrintTree: ParsableCommand {
resultTree = Syntax(tree)
}

print(resultTree.recursiveDescription)
print(resultTree.debugDescription(includeChildren: true, includeTrivia: includeTrivia))
}
}
}
Expand Down