platform_build_blueprint/parser
Colin Cross 85398a916a Simplify printer whitespace and newline handling
Trying to handle all the whitespace and newline printing inside
printToken got overly complicated, and resulted in a few bugs in
the layout around comments and indentation that were hard to fix.
Rewrite the whitespace and newline handling to be handled directly
by the object printers, using requestSpace() to ensure whitespace
is inserted and requestNewline() to ensure a newline is inserted.

Also fixes unnecessarily left aligning all comments that contain
indentation, and fixes accidentally unindenting comments that are
the last token in their indented block.

Change-Id: I18707802726107cf0b6ec7de9b542d0ec1d2c0dd
2015-03-20 16:55:32 -07:00
..
modify.go Add license headers and LICENSE file 2015-01-23 14:23:27 -08:00
parser.go Simplify printer whitespace and newline handling 2015-03-20 16:55:32 -07:00
parser_test.go Simplify printer whitespace and newline handling 2015-03-20 16:55:32 -07:00
printer.go Simplify printer whitespace and newline handling 2015-03-20 16:55:32 -07:00
printer_test.go Simplify printer whitespace and newline handling 2015-03-20 16:55:32 -07:00
sort.go Add license headers and LICENSE file 2015-01-23 14:23:27 -08:00