Commit Graph

168 Commits

Author SHA1 Message Date
Robert Griesemer
130e6f42f1 - implemented arbitrary padding char for tabwriter
- 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-21 09:35:49 -08:00
Robert Griesemer
01b44bbfc8 - move tabwriter into library
- 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 17:39:41 -08:00
Robert Griesemer
0998eaf4a1 - correct error handling throughout
- documentation, cleanups
- more options

R=r
OCL=19736
CL=19736
2008-11-20 16:26:43 -08:00
Robert Griesemer
fcdcf33a71 - array-ify code, remove local implementation
R=r
OCL=19648
CL=19651
2008-11-19 16:49:50 -08:00
Robert Griesemer
34533f06eb - support for alignment via tabs instead of blanks
- exclude a test due to syntax errors

R=r
OCL=19563
CL=19565
2008-11-18 19:25:43 -08:00
Robert Griesemer
127c65b400 - untab app (snapshot - not quite complete)
R=r
OCL=19558
CL=19558
2008-11-18 18:44:17 -08:00
Robert Griesemer
654bc2badc - factored out tabwriter a separate writer filter
(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-17 19:58:52 -08:00
Russ Cox
75647d2024 First pieces of malloc.
R=r
DELTA=756  (754 added, 0 deleted, 2 changed)
OCL=19266
CL=19378
2008-11-17 12:32:35 -08:00
Robert Griesemer
22e0e1b049 - better comment classification
- related cleanups

R=r
OCL=19227
CL=19227
2008-11-13 19:06:57 -08:00
Robert Griesemer
3c2f0ae132 * pretty printing snapshot: towards printing comments nicely
- 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-13 17:50:46 -08:00
Robert Griesemer
2a58e7d7a0 more work on elastic tabs:
- 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-10 17:56:46 -08:00
Robert Griesemer
a3b4a3c29d - steps towards "flexible tab stops" simulation in pretty
printing output
- not yet enabled

R=r
OCL=18842
CL=18842
2008-11-07 18:30:58 -08:00
Robert Griesemer
b3c983f3a0 - fixed typo in parser.go
- re-enabled bug118.go for pretty

R=r
OCL=18604
CL=18604
2008-11-05 16:05:36 -08:00
Robert Griesemer
11a3f759fd - temporarily excluding bug118.go, causing pretty trouble
R=r
OCL=18602
CL=18602
2008-11-05 15:55:51 -08:00
Robert Griesemer
17596948e3 get rid of bignum leftovers
R=r
OCL=18475
CL=18475
2008-11-04 14:08:47 -08:00
Robert Griesemer
e2eccf3bd0 install bignum as library
R=r
DELTA=3501  (1752 added, 1749 deleted, 0 changed)
OCL=18460
CL=18471
2008-11-04 13:55:18 -08:00
Robert Griesemer
e2fe2f3f23 - better support for string conversions
- removed trailing tabs

R=r
OCL=18458
CL=18458
2008-11-04 11:37:19 -08:00
Robert Griesemer
7cd11c1c09 - completed integer support (some logical functions missing)
- completed rational support
- better documentation
- more tests
- cleanups

R=r
OCL=18438
CL=18438
2008-11-04 09:33:15 -08:00
Robert Griesemer
78b0013a07 - changed general div/mod implementation to a faster algorithm
(operates on 30bit values at a time instead of 20bit values)
- refactored and cleaned up lots of code
- more tests
- close to check-in as complete library

R=r
OCL=18326
CL=18326
2008-11-03 09:21:10 -08:00
Robert Griesemer
db27d309d1 - gcd, exponentiation, population count
- more rational numbers stuff
- more tests

R=r
OCL=18295
CL=18295
2008-10-31 16:58:56 -07:00
Robert Griesemer
42ae5270d8 - handle field tags in pretty printer
R=r
OCL=18264
CL=18264
2008-10-31 14:27:34 -07:00
Robert Griesemer
00dc6e9678 - fixed another test (arithmetic vs. logic shift bug)
R=r
OCL=18235
CL=18237
2008-10-31 10:52:59 -07:00
Robert Griesemer
afad827255 - div and mod (arbitrary precision)
- more tests
- some global renames

R=r
OCL=18219
CL=18219
2008-10-30 23:37:34 -07:00
Robert Griesemer
7112dc1db7 - implemented Shr
- removed shift work-arounds (6g code appears to work now)
- made similar routines more regular in structure
- more tests

R=r
OCL=18102
CL=18102
2008-10-29 22:05:42 -07:00
Robert Griesemer
276ffd297d - added shl operation, extra tests
- fixed code so it works with any base between 9 and 64
- work-around for 6g shift problems in various places

R=r
OCL=18080
CL=18080
2008-10-29 16:48:53 -07:00
Robert Griesemer
0ed4576c6a - update test.sh (caused an error since src/pkg dir is empty now)
R=r
OCL=17987
CL=17987
2008-10-28 20:20:55 -07:00
Robert Griesemer
379b5a3921 - steps towards implementation of div and mod
- string conversion in different bases
- tracked down a 6g bug, use work-around for now

R=r
OCL=17981
CL=17981
2008-10-28 18:42:26 -07:00
Robert Griesemer
1daad03545 - bug fixes, cleanups
- integer string conversion

R=r
OCL=17923
CL=17923
2008-10-27 17:57:31 -07:00
Robert Griesemer
2e777b44b8 - created staging area for getting bignum package up-to-speed again,
now using up-to-date language features
- moved old code away from pkg (defunct anyway because of language changes)

R=r
OCL=17916
CL=17916
2008-10-27 15:44:32 -07:00
Robert Griesemer
eba73552d2 - added simple facility to print Makefile dependency rules given a Go source 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-26 21:32:30 -07:00
Ken Thompson
b379d54dea another step toward interface subtypes
put explicit ./ on some runtime tests

R=r
OCL=17839
CL=17839
2008-10-24 20:14:28 -07:00
Robert Griesemer
63ed2b710b - missing file
R=r
OCL=17813
CL=17813
2008-10-24 14:08:01 -07:00
Robert Griesemer
cec64a2dd5 - some factoring of scan/parse phase so we can attach other functionality
easily (for instance import dependency extraction)
- support for new "..." syntax
- minor cleanup

R=r
OCL=17811
CL=17811
2008-10-24 14:04:54 -07:00
Robert Griesemer
816c1cefff - expanded parsing heuristics to deal with new(T, ...)
- 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-23 17:56:54 -07:00
Rob Pike
5d30161ca7 move reflection code into final place.
this is just a branch.
next cl will update and add to build

R=rsc
DELTA=4528  (2264 added, 2264 deleted, 0 changed)
OCL=17670
CL=17672
2008-10-22 17:12:07 -07:00
Rob Pike
34b8873722 Reflection values.
R=rsc
DELTA=206  (79 added, 25 deleted, 102 changed)
OCL=17652
CL=17669
2008-10-22 16:48:17 -07:00
Rob Pike
0061e56196 Add names to types to avoid recursive explosion and to get
the right answer when a type name redefines an existing type.

R=rsc
DELTA=133  (53 added, 8 deleted, 72 changed)
OCL=17637
CL=17639
2008-10-22 13:02:43 -07:00
Robert Griesemer
79985fa569 - exclude newfn.go from tests - cannot be parsed syntactically alone
in general

R=rsc
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=17624
CL=17624
2008-10-22 11:27:18 -07:00
Rob Pike
fac3dfe638 More reflection code.
Beginnings of values.
typestrings are grabbed from the environment.

R=rsc
APPROVED=rsc
DELTA=1046  (952 added, 3 deleted, 91 changed)
OCL=17593
CL=17621
2008-10-22 11:02:56 -07:00
Robert Griesemer
71d6cda6b2 - remove inconsistent directory from tests
R=rsc
DELTA=1  (0 added, 1 deleted, 0 changed)
OCL=17514
CL=17514
2008-10-20 17:37:48 -07:00
Robert Griesemer
baac04b518 enable tests that verify that pretty-printed code can be compiled with 6g again
R=r
OCL=17510
CL=17510
2008-10-20 17:13:02 -07:00
Robert Griesemer
9d20c85ae9 - fixed missing parens in some cases of unary expressions
- 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 16:44:03 -07:00
Robert Griesemer
5d0e5a7867 - use stringtorune library function for faster rune scanning
- converted 2 right-recursive parsing functions into iterative versions
- renamed node.go -> ast.go (clearer)

R=r
OCL=17496
CL=17498
2008-10-20 15:03:40 -07:00
Robert Griesemer
a11d5aecb8 - removed double-declaration of len()
R=r
OCL=17463
CL=17463
2008-10-20 12:51:18 -07:00
Robert Griesemer
6440c59e22 - removed need for lhs field in stat node
- as a result deleted some more code

R=r
OCL=17449
CL=17449
2008-10-20 10:01:34 -07:00
Robert Griesemer
52e9080d56 - simplified parsing of composite literals and slices by
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-18 20:20:30 -07:00
Robert Griesemer
e45eb60657 Added mechanism for very precise self-testing:
- 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-18 16:42:25 -07:00
Rob Pike
265e73ee14 beginnings of reflection values.
R=rsc
DELTA=421  (357 added, 17 deleted, 47 changed)
OCL=17388
CL=17401
2008-10-17 18:06:29 -07:00
Robert Griesemer
071e963e0e - fixed bug that wasn't caught by 6g (but by gccgo)
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=17380
CL=17380
2008-10-17 16:27:49 -07:00
Robert Griesemer
f39b518bcb - fixed a couple of corner cases (empty statements, empty composites)
- more robust printing in presence of errors
- fixed incorrect printing of function literals

R=r
OCL=17378
CL=17378
2008-10-17 16:19:31 -07:00