Print line-suffix in --debug-print-doc (#676)

I was trying to debug #620 and got confused that it didn't show `//comment1`. Turns out we just fail silently if we can't print a node type. I added support for `line-suffix` and throw if we encounter a node type that we can't print.
master
Christopher Chedeau 2017-02-13 06:46:44 -08:00 committed by James Long
parent c5bfdae5d8
commit 1fed39ae30
1 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,12 @@ function printDoc(doc) {
printDoc(doc.contents) +
")";
}
if (doc.type === "line-suffix") {
return "lineSuffix(" + printDoc(doc.contents) + ")";
}
throw new Error('Unknown doc type ' + doc.type);
}
module.exports = {