- by default consider extra newlines in src for better formatting
- additional flags for control (-newlines, -maxnewlines, -optsemicolons)
- don't print ()'s around single anonymous result types
Status: Comparing the output of pretty with the input for larger files
shows mostly whitespace/formatting differences, which is what is desired.
TODO:
- Handling of overlong lines
- some esoteric cases which look funny
R=r
OCL=20293
CL=20293
- changed tab width to 8 chars by default to make test run properly
- excluded 4 files that are not idempotently printed
- fixed a couple of incorrect file position recordings in parser
- fine-tuned layout engine
- white-space formatting reasonable, but not perfect
- no handling of overlong lines
R=r
To use with smaller tabs: pretty -tabwidth=4 file.go
To use with blanks instead of tabs: pretty -usetabs=0 file.go
OCL=20184
CL=20184
- comment printing still disabled by default because idempotency test fails
- whitespace control better but not perfect yet
- snapshot before making some heuristics changes
R=r
OCL=20151
CL=20151
for end of declarations, blocks, parameter lists, etc.
- use extra src positions to more accurately print comments
- fine-tuned low-level printing routine for comments
- added better debugging support
Status:
- comments now appear at the right place (inbetween the right tokens)
- newline control needs improvement (not very hard)
- comment printing disabled for now because pretty is not idempotent
with it; to enable: -comments
R=r
OCL=20079
CL=20079
(to be moved into std lib eventually)
- rewrote tabwriter to use byte buffers instead of strings
(byte buffers to be moved into stdlib eventually)
- support for recent syntax changes
- no space printed after function name and before function parameters
- comments still disabled due to a known bug
R=r
OCL=19430
CL=19430
- implemented elastic tabstops algorithm, now correct and documented
- first cut at printing comments (use -comments flag, disabled for now)
- struct field types are now aligned (using elastic tab stops)
- needs more fine-tuning
* fixed a bug in test script
* added quick smoke test to makefile and invoke it in run.bash
instead of the full test
R=r
OCL=19220
CL=19220
- new code enabled, but no comments printed yet (so the effect
of the elastic tabs is not seen yet)
TBR=r
DELTA=200 (93 added, 69 deleted, 38 changed)
OCL=18951
CL=18951
(e.g.: pretty -d pretty.go will print the Makefile dep. rules of the involved
Go files that are not part of the installed library)
- minor fix in pretty printer (tested against ken's test files)
R=r
OCL=17872
CL=17872
- fixed an issue with select
- added all bugs and fixedbugs tests that are syntactically correct to the test suite
- minor cosmetic changes
R=r
OCL=17759
CL=17759
- added validation test verifying that pretty output compiles with 6g again (disabled at the moment)
- replaced another recursive function with an interative solution
R=r
OCL=17505
CL=17505
treating ":" as lowest-level binary operator
- more precise error message for composites
- added flag -columns (false) - when set, prints precise error column
- a few more tests
R=r
OCL=17428
CL=17428
- in selftest mode (-t) interpret comments of the form /* ERROR */ and /* SYNC */
and validate reported errors with the error markings in a file
- added initial selftest.go file
Also:
- fixed an issue with empty blocks
- generally report better error messages
- added many more tests to the test script (essentially all .go programs which
have no syntax errors)
R=r
OCL=17426
CL=17426
- fixed a bug with non-eof terminated //-style comments
- collecting comments
- first experiments with reproducing comments
(works but not very pretty, disabled for now)
- idempotent for all correct .go files we have checked in
R=r
OCL=17333
CL=17333
- typeguards, var decls, several printing bug fixed
- now fully idempotent on many files (which are accepted by 6g afterwards)
- still some detail issues
R=r
OCL=17310
CL=17310
- almost there, receivers, labels, composites, comments are not yet printed
- runs through 18KLOC of Go code and prints it again
R=r
OCL=17237
CL=17237
- accepts all Go code (use -s flag)
- complete rewrite of AST, AST building, and printing
(as a result much more compact)
- printing severely screwed up at the moment, but should be
fully working in 1 more day
R=r
DELTA=2118 (514 added, 980 deleted, 624 changed)
OCL=17161
CL=17161
if in a if, for, or switch header, must be parenthesized
- implemented string concatenation
- simplified a lot of code
- added many more tests: can now parse all *.go files I got my hands on
- printing output currently broken in some cases, use with -s (silent) option
R=r
OCL=16932
CL=16934