Russ Cox
360151d4e2
gobuild changes.
...
* handles multiple packages per directory
* scans directory for files if given no arguments
* infers package name
* includes test rule invoking gotest
R=r
DELTA=746 (444 added, 150 deleted, 152 changed)
OCL=19504
CL=19521
2008-11-18 17:11:56 -08:00
Russ Cox
c1efd7d6e5
roll tests into one binary
...
R=r
DELTA=145 (27 added, 27 deleted, 91 changed)
OCL=19423
CL=19502
2008-11-18 16:13:25 -08:00
Ian Lance Taylor
d12c1b99c7
Add ERROR comment for errmsg to look for.
...
R=gri
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=19460
CL=19500
2008-11-18 15:58:43 -08:00
Rob Pike
7969860126
testing support library
...
R=rsc
OCL=19496
CL=19496
2008-11-18 15:29:10 -08:00
Rob Pike
8b8630c6cf
allow files to be named on the command line
...
R=rsc
DELTA=3 (1 added, 1 deleted, 1 changed)
OCL=19485
CL=19485
2008-11-18 14:17:13 -08:00
Rob Pike
d495372509
new gotest shell script (will be a proper command some day, probably)
...
automates construction and execution of unit tests.
R=rsc
DELTA=60 (58 added, 0 deleted, 2 changed)
OCL=19482
CL=19484
2008-11-18 14:12:14 -08:00
Russ Cox
6b7dd4c020
add build step to install debuggers setgid procmod.
...
they have to go in /usr/local/bin
because the setgid bit is ignored in /Users.
R=r
DELTA=54 (49 added, 0 deleted, 5 changed)
OCL=19424
CL=19463
2008-11-18 10:08:46 -08:00
Robert Griesemer
6c5fc055c8
import syntax incorrect
...
R=r
OCL=19457
CL=19457
2008-11-18 09:39:34 -08:00
Russ Cox
c78005f648
update golden.out
...
R=r
OCL=19455
CL=19455
2008-11-18 09:35:42 -08:00
Russ Cox
4656686cf5
use correct lineno in nod even if yacc has looked ahead.
...
makes lineno correct for statements without semicolons.
R=ken
OCL=19454
CL=19454
2008-11-18 09:32:05 -08:00
Ian Lance Taylor
d8ecead73d
The compiler should reject calling a const as though it were a
...
function. Also update golden.out.
R=r
DELTA=18 (18 added, 0 deleted, 0 changed)
OCL=19433
CL=19448
2008-11-18 06:25:21 -08:00
Ian Lance Taylor
1945cc4c3c
The compiler should reject comparisons between ints and nil.
...
R=gri
DELTA=8 (8 added, 0 deleted, 0 changed)
OCL=19434
CL=19436
2008-11-17 21:44:05 -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
Robert Griesemer
337af31781
- allow for multiple method names per function type in an interface decl.
...
- added some initial language with respect to exports
R=r
DELTA=95 (47 added, 31 deleted, 17 changed)
OCL=19407
CL=19426
2008-11-17 18:11:36 -08:00
Russ Cox
ed628ca79b
* faster atof for common cases
...
(gets 3x speedup in go; got 40x in c)
* handle and test overflow
R=r
DELTA=217 (200 added, 0 deleted, 17 changed)
OCL=19399
CL=19422
2008-11-17 17:22:51 -08:00
Russ Cox
4d1d5e8a88
work around more commonly-unreachable 6g code sequences.
...
R=r
DELTA=23 (23 added, 0 deleted, 0 changed)
OCL=19405
CL=19420
2008-11-17 17:16:50 -08:00
Russ Cox
3f548cd2d9
add gobuild to build
...
R=r
DELTA=2 (0 added, 0 deleted, 2 changed)
OCL=19404
CL=19415
2008-11-17 16:59:04 -08:00
Robert Griesemer
7692a93173
- new() accepts too many arguments
...
R=r
OCL=19413
CL=19413
2008-11-17 16:46:56 -08:00
Robert Griesemer
d58cd7626e
- interface methods must have full function type
...
R=r
OCL=19410
CL=19410
2008-11-17 16:37:13 -08:00
Russ Cox
a1585b676b
fix the easy parts of bug120
...
R=r,ken
DELTA=66 (52 added, 3 deleted, 11 changed)
OCL=19386
CL=19389
2008-11-17 13:58:45 -08:00
Ken Thompson
b7f01f9f41
silence compiler warning
...
R=r
OCL=19382
CL=19382
2008-11-17 12:55:22 -08:00
Russ Cox
869c3f4cd0
update golden.out.
...
fix bug in run that was missing output.
make run warn about tests in bugs/ that succeed with no output
(should be moved to fixedbugs/).
R=r
DELTA=21 (18 added, 0 deleted, 3 changed)
OCL=19381
CL=19381
2008-11-17 12:44:22 -08:00
Russ Cox
079c00a475
correctly rounded floating-point conversions
...
in new package strconv.
move atoi etc to strconv too.
update fmt, etc to use strconv.
R=r
DELTA=2232 (1691 added, 424 deleted, 117 changed)
OCL=19286
CL=19380
2008-11-17 12:34:03 -08:00
Russ Cox
f333f4685c
floating point constant errors in 6g
...
R=r
OCL=19379
CL=19379
2008-11-17 12:33:49 -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
Ian Lance Taylor
b1e8b5f5b7
The scope rules have been clarified to indicate that a
...
variable may only be named after the complete declaration,
including the initialization statements.
R=gri
DELTA=61 (16 added, 45 deleted, 0 changed)
OCL=19343
CL=19376
2008-11-17 12:19:02 -08:00
Russ Cox
5aa7dc5daf
adopt suggestions from Bentley and McIlroy (SP&E Nov 1993)
...
to make qsort more robust:
* use "ninther" to choose pivot.
* use three-way partition to avoid quadratic
behavior on all-one-value arrays.
also add tests suggested in that paper.
the immediate cause of the slowness we observed was
in fact none of these: the recursive call was sorting
data[0:m] instead of data[a:m].
also rename package to "sort" to match convention.
R=r,gri
DELTA=358 (255 added, 21 deleted, 82 changed)
OCL=19341
CL=19373
2008-11-17 11:51:34 -08:00
Robert Griesemer
a1c85ed83e
Package-export proposal:
...
- syntax change
- missing: corresponding language
DELTA=5 (2 added, 0 deleted, 3 changed)
OCL=19221
CL=19352
2008-11-17 09:51:56 -08:00
Ken Thompson
2567c073ea
random permutation function
...
func perm(n int) *map[int]int
R=r
OCL=19340
CL=19340
2008-11-16 13:02:47 -08:00
Russ Cox
9c7b064043
fix bugs in package locals
...
R=ken
OCL=19299
CL=19299
2008-11-14 17:31:29 -08:00
Ian Lance Taylor
7dee51f491
The compilers should and do permit interface types to list
...
multiple method names with a single type.
R=r,gri
DELTA=10 (0 added, 10 deleted, 0 changed)
OCL=19292
CL=19298
2008-11-14 17:28:17 -08:00
Rob Pike
fd47cb9af5
conflicting scopes should cause error exit
...
TBR=rsc
OCL=19297
CL=19297
2008-11-14 17:28:11 -08:00
Russ Cox
d3f6093931
package-local declarations using keyword "package".
...
R=r
DELTA=129 (81 added, 0 deleted, 48 changed)
OCL=19283
CL=19291
2008-11-14 16:35:08 -08:00
Ken Thompson
e875055461
switch
...
R=r
OCL=19288
CL=19288
2008-11-14 16:24:27 -08:00
Robert Griesemer
23c8faaf85
buf fix: make FD.Read, FD.Write work for empty buffers
...
R=r
DELTA=8 (6 added, 0 deleted, 2 changed)
OCL=19273
CL=19275
2008-11-14 15:13:29 -08:00
Rob Pike
f3e354ec26
clean up make script
...
reorder pieces so io is earlier
R=rsc
DELTA=66 (27 added, 24 deleted, 15 changed)
OCL=19248
CL=19255
2008-11-14 12:53:44 -08:00
Robert Griesemer
0c4c842eb0
- added Init() function so that vectors can be used w/o New():
...
var v Vector.Vector;
v.Init();
...
- clear vector elements in Reset
- removed some comments that seem redundant
R=r
DELTA=16 (9 added, 5 deleted, 2 changed)
OCL=19247
CL=19247
2008-11-14 11:22:39 -08:00
Russ Cox
f8b20e4083
add cov, prof to default build; clean up compiler warnings
...
R=r
DELTA=8 (1 added, 0 deleted, 7 changed)
OCL=19245
CL=19245
2008-11-14 10:57:48 -08:00
Russ Cox
7832ab5ba0
code coverage tool
...
$ 6cov -g 235.go 6.out
235.go:62,62 main·main 0x27c9-0x2829 MOVL $main·.stringo(SB),AX
235.go:30,30 main·main 0x2856-0x285e ADDQ $6c0,SP
$
and assorted fixes.
R=r
DELTA=743 (732 added, 8 deleted, 3 changed)
OCL=19226
CL=19243
2008-11-14 10:45:23 -08:00
Rob Pike
2355395550
handle nils safely
...
R=rsc
DELTA=38 (14 added, 10 deleted, 14 changed)
OCL=19242
CL=19242
2008-11-14 10:42:45 -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
Rob Pike
e2621b8037
add a %v format to print an arbitrary value in its "println" form.
...
also add code to print (pointers to) arrays, through %v.
R=rsc
DELTA=108 (70 added, 33 deleted, 5 changed)
OCL=19184
CL=19192
2008-11-13 15:20:52 -08:00
Russ Cox
e4f4ab0b8d
more array methods
...
R=r
OCL=19172
CL=19172
2008-11-13 13:42:59 -08:00
Russ Cox
c5f21c0dc2
* 6l:
...
if an object in an archive tries to refer
to a file in its original source directory,
ignore it.
* 6ar:
fix bug if archive is empty.
* gobuild:
build archive in current directory.
* math:
use new gobuild Makefile.
* test/math.go:
rename to mathest.go, add // run line, make it run.
R=r
DELTA=494 (277 added, 203 deleted, 14 changed)
OCL=19090
CL=19171
2008-11-13 13:42:26 -08:00
Ken Thompson
9795c9e727
temp fix for map not multiple of 8
...
R=r
OCL=19166
CL=19166
2008-11-13 13:20:18 -08:00
Ken Thompson
bc0b4f0d2a
mike's map code
...
R=r
OCL=19146
CL=19146
2008-11-13 10:35:44 -08:00
Ian Lance Taylor
c4d8dc0b83
This bug has been fixed; moving it from bugs to fixedbugs.
...
R=gri
DELTA=36 (18 added, 18 deleted, 0 changed)
OCL=19059
CL=19133
2008-11-12 21:59:43 -08:00
Rob Pike
419e1e05a1
add some support for modifying what pointers point to
...
R=rsc
DELTA=27 (16 added, 11 deleted, 0 changed)
OCL=19130
CL=19132
2008-11-12 19:05:05 -08:00
Rob Pike
6e70c2c74f
fix bug in FullyReader
...
R=rsc
DELTA=1 (0 added, 0 deleted, 1 changed)
OCL=19131
CL=19131
2008-11-12 19:04:56 -08:00