summaryrefslogtreecommitdiff
path: root/usr/gri/pretty
AgeCommit message (Collapse)AuthorFilesLines
2008-12-10Snapshot:Robert Griesemer4-97/+43
- fixed html tag generation - simplified html escaping machinery (not 100% correct for strings yet) - can now produce the first mostly correct formatted html pages from source with (fake) links: e.g. pretty -html srcfile.go > srcfile.html R=r OCL=20915 CL=20915
2008-12-09- snapshot if current stateRobert Griesemer3-27/+62
- fix pretty printer to work with new tabwriter interface R=r OCL=20854 CL=20854
2008-12-04- adjusted const decl grammar to reflect spec changesRobert Griesemer5-28/+107
- first cut at html writer (will do html escaping, html tag production) - first cut at generating basic html output via pretty - some cleanups R=r OCL=20550 CL=20550
2008-12-03- fixed a bug with import printing (missing separator between alias and string)Robert Griesemer2-37/+62
- rewrote declaration printing - was unreadable before - no semicolons after closing "}" for types R=r OCL=20379 CL=20379
2008-12-02- oversight: extra allow source-level line breaks inside statement listsRobert Griesemer3-2/+6
- fixed printing of empty structs/interfaces - enable two more tests R=r OCL=20296 CL=20296
2008-12-02- fine-tuning of white spaceRobert Griesemer2-51/+115
- 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
2008-12-02The flag and fmt libraries are now available from gccgo byIan Lance Taylor1-10/+2
default. Fix PRETTY_OBJS to include compilation.o rather than compilation.go. R=gri DELTA=10 (0 added, 8 deleted, 2 changed) OCL=20248 CL=20257
2008-12-01- enabled comment printing by defaultRobert Griesemer4-73/+133
- 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
2008-12-01- better comment formatting, starting to look goodRobert Griesemer2-77/+70
- 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
2008-11-26- collect addition source position information in parserRobert Griesemer4-151/+197
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
2008-11-26- snapshot of state before trying yet another, hopefully better workingRobert Griesemer6-150/+174
way to integrate comments into the generated output - various simplificatins and cleanups throughout R=r OCL=20062 CL=20062
2008-11-24- move error handling out of scannerRobert Griesemer2-164/+102
- use more of the existing library code R=r OCL=19957 CL=19959
2008-11-21- implemented arbitrary padding char for tabwriterRobert Griesemer2-2/+10
- implemented right-to-left alignment (numerical results) - better comments and error handling - added more tests - updated dependent files R=r DELTA=232 (175 added, 11 deleted, 46 changed) OCL=19761 CL=19780
2008-11-20- move tabwriter into libraryRobert Griesemer3-347/+2
- added preliminary tests (more to do) - renamed type from TabWriter -> Writer - adjusted my code where necessary R=r DELTA=825 (474 added, 346 deleted, 5 changed) OCL=19744 CL=19753
2008-11-20- correct error handling throughoutRobert Griesemer3-117/+150
- documentation, cleanups - more options R=r OCL=19736 CL=19736
2008-11-19- array-ify code, remove local implementationRobert Griesemer6-227/+159
R=r OCL=19648 CL=19651
2008-11-18- support for alignment via tabs instead of blanksRobert Griesemer4-14/+43
- exclude a test due to syntax errors R=r OCL=19563 CL=19565
2008-11-18- untab app (snapshot - not quite complete)Robert Griesemer3-9/+67
R=r OCL=19558 CL=19558
2008-11-17- factored out tabwriter a separate writer filterRobert Griesemer5-195/+326
(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
2008-11-13- better comment classificationRobert Griesemer4-58/+68
- related cleanups R=r OCL=19227 CL=19227
2008-11-13* pretty printing snapshot: towards printing comments nicelyRobert Griesemer7-128/+277
- 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
2008-11-10more work on elastic tabs:Robert Griesemer1-86/+110
- 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
2008-11-07- steps towards "flexible tab stops" simulation in prettyRobert Griesemer4-26/+179
printing output - not yet enabled R=r OCL=18842 CL=18842
2008-11-05- fixed typo in parser.goRobert Griesemer2-2/+2
- re-enabled bug118.go for pretty R=r OCL=18604 CL=18604
2008-11-05- temporarily excluding bug118.go, causing pretty troubleRobert Griesemer1-1/+1
R=r OCL=18602 CL=18602
2008-10-31- handle field tags in pretty printerRobert Griesemer5-19/+30
R=r OCL=18264 CL=18264
2008-10-28- update test.sh (caused an error since src/pkg dir is empty now)Robert Griesemer1-1/+0
R=r OCL=17987 CL=17987
2008-10-26- added simple facility to print Makefile dependency rules given a Go source ↵Robert Griesemer7-55/+142
file (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
2008-10-24another step toward interface subtypesKen Thompson2-6/+6
put explicit ./ on some runtime tests R=r OCL=17839 CL=17839
2008-10-24- missing fileRobert Griesemer1-0/+46
R=r OCL=17813 CL=17813
2008-10-24- some factoring of scan/parse phase so we can attach other functionalityRobert Griesemer5-50/+70
easily (for instance import dependency extraction) - support for new "..." syntax - minor cleanup R=r OCL=17811 CL=17811
2008-10-23- expanded parsing heuristics to deal with new(T, ...)Robert Griesemer5-51/+107
- 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
2008-10-22- exclude newfn.go from tests - cannot be parsed syntactically aloneRobert Griesemer1-1/+2
in general R=rsc DELTA=2 (1 added, 0 deleted, 1 changed) OCL=17624 CL=17624
2008-10-20- remove inconsistent directory from testsRobert Griesemer1-1/+0
R=rsc DELTA=1 (0 added, 1 deleted, 0 changed) OCL=17514 CL=17514
2008-10-20enable tests that verify that pretty-printed code can be compiled with 6g againRobert Griesemer1-12/+23
R=r OCL=17510 CL=17510
2008-10-20- fixed missing parens in some cases of unary expressionsRobert Griesemer3-22/+56
- 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
2008-10-20- use stringtorune library function for faster rune scanningRobert Griesemer6-216/+248
- converted 2 right-recursive parsing functions into iterative versions - renamed node.go -> ast.go (clearer) R=r OCL=17496 CL=17498
2008-10-20- removed need for lhs field in stat nodeRobert Griesemer4-24/+21
- as a result deleted some more code R=r OCL=17449 CL=17449
2008-10-18- simplified parsing of composite literals and slices byRobert Griesemer4-62/+56
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
2008-10-18Added mechanism for very precise self-testing:Robert Griesemer5-61/+187
- 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
2008-10-17- fixed bug that wasn't caught by 6g (but by gccgo)Robert Griesemer1-1/+1
R=r DELTA=1 (0 added, 0 deleted, 1 changed) OCL=17380 CL=17380
2008-10-17- fixed a couple of corner cases (empty statements, empty composites)Robert Griesemer5-113/+136
- more robust printing in presence of errors - fixed incorrect printing of function literals R=r OCL=17378 CL=17378
2008-10-16- stronger syntax checksRobert Griesemer5-66/+173
- 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
2008-10-16- added test scriptRobert Griesemer4-58/+114
- fixed a couple of printing bugs status: parses, reproduces, and idempotently reproduces all correct .go files R=r OCL=17332 CL=17332
2008-10-16- more robust TokenString implementationRobert Griesemer2-17/+14
R=r OCL=17319 CL=17319
2008-10-16snapshot:Robert Griesemer3-53/+54
- 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
2008-10-16- composites, receivers, various add. checksRobert Griesemer3-129/+138
R=r OCL=17295 CL=17295
2008-10-16snapshot:Robert Griesemer2-44/+64
- fallthrough stat, label decls - improved printing layout R=r OCL=17283 CL=17283
2008-10-15- updated makefile for gccgoRobert Griesemer1-2/+4
R=r OCL=17243 CL=17245
2008-10-15snapshot of pretty printer:Robert Griesemer4-135/+233
- 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