1
0
mirror of https://github.com/golang/go synced 2024-10-04 00:21:20 -06:00
Commit Graph

1420 Commits

Author SHA1 Message Date
Rob Pike
2067b9fb92 string slicing is efficient so remove base and bounds arguments from RuneCountInString
R=rsc
DELTA=6  (1 added, 0 deleted, 5 changed)
OCL=28242
CL=28256
2009-05-04 22:12:13 -07:00
Ken Thompson
567a7bf664 more code optimization
1. dont clear external and heap objects
2. propagate constant assignment

R=r
OCL=28254
CL=28254
2009-05-04 21:48:46 -07:00
David Symonds
2f284948af Remake exvar package to be more Go-ish.
It now exports a Var interface (anyone can export their own custom var types now), so users need to create and manage their own vars and mark them as exportable via the Publish function. They are exposed via /debug/vars.

R=r,rsc
APPROVED=r
DELTA=605  (314 added, 186 deleted, 105 changed)
OCL=28143
CL=28239
2009-05-04 15:14:22 -07:00
Ken Thompson
5963f59067 more morestack fiddling
R=r
OCL=28204
CL=28204
2009-05-03 19:09:14 -07:00
Ken Thompson
a5a878986c more code fiddling
R=r
OCL=28201
CL=28201
2009-05-03 15:17:03 -07:00
David Symonds
fc51a98ffb Fix mismatched quote in a comment.
R=gri
APPROVED=gri
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=28184
CL=28192
2009-05-02 17:59:42 -07:00
Ken Thompson
49f7494894 code optmization
drip init function if it doesnt do anything

R=r
OCL=28180
CL=28180
2009-05-01 18:55:16 -07:00
Ken Thompson
1ed7f18165 code improvement
better calling of morestack

R=r
OCL=28179
CL=28179
2009-05-01 18:07:33 -07:00
Kai Backman
eac5db7f4c Copied 8g/6g into 5g. Used sharp tools to coax a .5 file out
of 5g. 5l balks at the output and running 5g with -S shows
the true extent of the disaster. Still, better than
yesterday. Maybe.

Tested on the canonical:

package main
func main() {
}

R=rsc
APPROVED=rsc
DELTA=4182  (4181 added, 0 deleted, 1 changed)
OCL=27601
CL=28175
2009-05-01 13:21:53 -07:00
Robert Griesemer
68523603e1 - incorporated feedback per rsc
- fixed a bug and added corresponding test case

R=rsc
DELTA=114  (18 added, 29 deleted, 67 changed)
OCL=28114
CL=28128
2009-04-30 14:43:06 -07:00
Russ Cox
83e976d53e bug146: array/slice conversion before I left missed conversions
R=ken
OCL=28120
CL=28124
2009-04-30 13:49:58 -07:00
Russ Cox
bd8e25ca57 auto-detect whether to use IPv6 or IPv4 kernel interface
R=r
DELTA=12  (9 added, 0 deleted, 3 changed)
OCL=28096
CL=28118
2009-04-30 13:41:36 -07:00
Russ Cox
10817ab9d2 better error messages, not that anyone ever sees them
R=r
DELTA=30  (9 added, 1 deleted, 20 changed)
OCL=28104
CL=28117
2009-04-30 13:40:55 -07:00
Russ Cox
48974f553d change 6l library directory flag to -L,
to match traditional c linkers.

R=r
DELTA=42  (8 added, 12 deleted, 22 changed)
OCL=28101
CL=28115
2009-04-30 13:32:39 -07:00
Rob Pike
5dc95206f2 don't print binary data. add TODO for better errors.
TBR=rsc
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=28066
CL=28070
2009-04-29 23:33:48 -07:00
Rob Pike
93831d25db rename variables for clarity.
add test for structure alignment/offset.

R=gri
DELTA=49  (35 added, 0 deleted, 14 changed)
OCL=28068
CL=28068
2009-04-29 22:16:53 -07:00
Russ Cox
89f8238a99 don't set CLONE_PTRACE -- it confuses strace
R=r
DELTA=4  (3 added, 1 deleted, 0 changed)
OCL=28063
CL=28065
2009-04-29 18:54:44 -07:00
Russ Cox
d2e42f3e48 if the process stops with SIGTRAP (breakpoint),
don't relay the signal when restarting it.

R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=28060
CL=28064
2009-04-29 18:53:01 -07:00
Rob Pike
c0b8b969ae Bug in reflect found by gri. Structs in 6g have a minimum alignment.
iant: will this be ok in gccgo?

R=rsc
DELTA=9  (8 added, 0 deleted, 1 changed)
OCL=28059
CL=28062
2009-04-29 18:51:12 -07:00
Rob Pike
49eb63cfd5 drop unused result name - trivial change.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=28056
CL=28058
2009-04-29 18:20:09 -07:00
Russ Cox
f7d3eb9db9 exit with error status EPIPE if
one fd gets too many EPIPEs in a row
during write.

R=r
DELTA=10  (9 added, 0 deleted, 1 changed)
OCL=28057
CL=28057
2009-04-29 18:18:42 -07:00
Brendan O'Dea
2cf5c809d0 Ignore SIGPIPE such that write returns EPIPE.
Currently a http server will be killed on receipt of SIGPIPE
if a client closes a socket which the server is trying to
write to.

R=rsc
APPROVED=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27959
CL=28055
2009-04-29 17:36:58 -07:00
Brendan O'Dea
7326a389fc Fix channels used by WaitWrite (http server hangs on writes
which hit EAGAIN).

R=rsc
APPROVED=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27955
CL=28054
2009-04-29 17:36:37 -07:00
Ken Thompson
7a98315c96 allow "defer close(chan)"
bug found by anton

R=r
OCL=28001
CL=28001
2009-04-28 17:20:18 -07:00
Ken Thompson
91ce0ef8f3 bug 139
R=r
OCL=27987
CL=27987
2009-04-28 13:52:56 -07:00
Ken Thompson
ad36c39211 bug 145
R=r
OCL=27979
CL=27979
2009-04-28 12:28:31 -07:00
Robert Griesemer
4fc82c2e1e fix for broken build
TBR=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=27969
CL=27969
2009-04-28 09:56:33 -07:00
David Symonds
a08fb0ff33 Add a HTTP handler to the exvar package.
R=r
APPROVED=r
DELTA=20  (11 added, 6 deleted, 3 changed)
OCL=27782
CL=27950
2009-04-28 04:26:07 -07:00
David Symonds
1304183efc Add more dependencies for lib/go.
This makes "make nuke install" work again.

R=r
APPROVED=r
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=27929
CL=27932
2009-04-27 21:52:30 -07:00
Rob Pike
bd3b2f843f implement .alternates
R=rsc
OCL=27928
CL=27928
2009-04-27 21:04:46 -07:00
Stephen Ma
eb5eea9a8f Fix the chunked encoding - terminate the chunk with CRLF.
R=rsc
APPROVED=r
DELTA=11  (10 added, 0 deleted, 1 changed)
OCL=27723
CL=27879
2009-04-27 00:38:04 -07:00
David Symonds
f4b92c8624 Add string-valued variables to exvar.
R=r
APPROVED=r
DELTA=62  (58 added, 1 deleted, 3 changed)
OCL=27756
CL=27877
2009-04-26 20:57:01 -07:00
Brendan O'Dea
68b881791f flags.Usage() calls fmt.Fprintf() with incorrect args
R=r
APPROVED=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27777
CL=27876
2009-04-26 18:36:17 -07:00
Robert Griesemer
bf53e16f6d - install doc in lib/go
- adjust dependent files

R=rsc
DELTA=1132  (567 added, 562 deleted, 3 changed)
OCL=27862
CL=27862
2009-04-25 17:01:41 -07:00
Ken Thompson
b03b541b7a recognize a defined constant
as a new name in a later declaration
(bug 144)

R=r
OCL=27850
CL=27850
2009-04-24 16:43:31 -07:00
Robert Griesemer
9c3a9b71c8 - fixed a couple of potential end-less loops
(no progress in presence of syntax errors)
- end parsing early if source doesn't start
  proper package clause

R=iant
DELTA=18  (7 added, 6 deleted, 5 changed)
OCL=27840
CL=27842
2009-04-24 12:59:09 -07:00
Ben Eitzen
155ec1d904 Clear upper bits of 64-bit indexing register when using types smaller than 64 bits.
APPROVED=ken
OCL=27811
CL=27823
2009-04-23 18:23:34 -07:00
Rob Pike
258a08ed8f add {.tab}
fix a couple of comments

TBR=rsc
OCL=27716
CL=27716
2009-04-22 00:53:35 -07:00
David Symonds
d724092407 Clean up some more code after bug143 was fixed.
R=r
APPROVED=r
DELTA=6  (0 added, 5 deleted, 1 changed)
OCL=27708
CL=27708
2009-04-21 20:24:28 -07:00
Ken Thompson
190a540892 2 minor bugs.
lv context for some [] operations
calling implicit(*map) before walk.

R=r
OCL=27706
CL=27706
2009-04-21 19:52:13 -07:00
Ken Thompson
c18db5aa18 bug in shift of longer operand
by a shorter operand. the bits
in the difference were not cheared.

R=r
OCL=27705
CL=27705
2009-04-21 19:38:58 -07:00
David Symonds
f8931c6ceb Bug 143 is fixed, so clean up some of exvar.
R=r
APPROVED=r
DELTA=8  (3 added, 1 deleted, 4 changed)
OCL=27699
CL=27701
2009-04-21 18:36:53 -07:00
Ken Thompson
b5e7562191 supply default indirection to
map indexing - bug 143

R=r
OCL=27695
CL=27695
2009-04-21 17:00:08 -07:00
David Symonds
5cb6843a4e Change exvar to use a goroutine channel worker instead of a mutex for synchronisation.
Also it should be more testable, as there's less global state.

R=r
APPROVED=r
DELTA=113  (38 added, 12 deleted, 63 changed)
OCL=27653
CL=27694
2009-04-21 16:50:09 -07:00
Robert Griesemer
9c456283f3 minor adjustment to comment formatting for better godoc output
R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=27687
CL=27689
2009-04-21 15:30:17 -07:00
Robert Griesemer
011bf2b6d3 minor adjustments to comments for better godoc output
R=r
DELTA=6  (0 added, 0 deleted, 6 changed)
OCL=27686
CL=27688
2009-04-21 15:14:34 -07:00
Robert Griesemer
3ae849d47d - documentation for bignum package
- removed some constants from public interface

R=r
DELTA=375  (238 added, 14 deleted, 123 changed)
OCL=27636
CL=27668
2009-04-21 10:52:00 -07:00
David Symonds
de489fb38c Refactor exvar to use interface types, and add mapVar.
R=r
APPROVED=r
DELTA=170  (136 added, 6 deleted, 28 changed)
OCL=27628
CL=27652
2009-04-20 22:38:14 -07:00
Rob Pike
a6bc344351 rewrite template library:
- separate parsing from execution
	- rearrange code for organizational clarity
	- provide execution errors and parse-time errors
	- implement .or for repeated

TBR=rsc
OCL=27650
CL=27650
2009-04-20 18:51:13 -07:00
David Symonds
8e4b65d041 Move iterable package to usr/dsymonds/.
R=r
APPROVED=r
DELTA=598  (330 added, 266 deleted, 2 changed)
OCL=27627
CL=27649
2009-04-20 18:13:14 -07:00
David Symonds
d88fb9f0f6 Oops, forgot to commit this change.
R=r
APPROVED=r
DELTA=3  (1 added, 0 deleted, 2 changed)
OCL=27624
CL=27626
2009-04-20 00:43:10 -07:00
David Symonds
dc5cffbeb7 Use the mutex in exvar.Set since map access is not atomic.
Imagine your var has a value of zero. If you have a goroutine calling Set(5),
and another calling Increment(+1), then you only want one of these outcomes:
  - Set completes first, and then Increment occurs => 6
  - Increment completes first, and then Set occurs => 5

However, you could get a sequence:
  - read (for Increment) 0
  - set (for Set) 5
  - write (for Increment) 1
This results in a value of 1, which is undesirable.

Kudos to dnadasi for catching this.

R=r
APPROVED=r
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=27625
CL=27625
2009-04-20 00:42:08 -07:00
David Symonds
a6156873d0 Add Inject function to iterable package.
Fix a couple of style mistakes.

R=r,rsc
APPROVED=r
DELTA=34  (30 added, 1 deleted, 3 changed)
OCL=27623
CL=27623
2009-04-19 23:52:29 -07:00
David Symonds
3cc702ba60 Initial cut at an "exported variables" (exvar) package.
This handles integer-valued vars in a singleton struct, and exports functions
for incrementing, setting and getting those vars, as well as rendering all the
vars in a standard format.

Demonstrate the use of the exvar package in the http/triv server.

R=dcross,r
APPROVED=r
DELTA=122  (122 added, 0 deleted, 0 changed)
OCL=27617
CL=27622
2009-04-19 21:17:27 -07:00
Rob Pike
7e1cfa7432 Readn is a silly name when there's no n. Change to FullRead.
R=gri
DELTA=15  (0 added, 0 deleted, 15 changed)
OCL=27619
CL=27619
2009-04-19 21:02:29 -07:00
Rob Pike
ae08a48719 the Big Error Shift applied to lib/time/zoneinfo.go.
R=gri
DELTA=22  (5 added, 0 deleted, 17 changed)
OCL=27608
CL=27614
2009-04-18 16:44:13 -07:00
Ken Thompson
34b6f642de mixed old/new declaration
exact spec:
a) must be a multi-assignment w :=
b) a proper subset of the lhs
   can be declared in same block
   with the same type with no
   "redeclaration" error

R=r
OCL=27610
CL=27610
2009-04-18 13:58:04 -07:00
Rob Pike
bfd5ede78d add -P pkgdir option to 6l to have it look first in pkgdir for a package.
this allows gotest to find the locally built package when doing
	make
	gotest
without this option, one would have to say
	make install
	gotest
which kinda defeats the purpose

based on discussions with rsc.

R=ken,rsc
DELTA=12  (10 added, 1 deleted, 1 changed)
OCL=27606
CL=27606
2009-04-17 19:39:45 -07:00
Rob Pike
45ed7297e8 Step 2 of the Big Error Shift.
Change the representation of errors in "os" to be cleaner.
(But they are not really representative of the power of the new scheme.)
Step 3 will be to remove all references to os.NewError.
Step 4 will be to delete the second half of lib/os/error.go.

R=rsc
OCL=27587
CL=27587
2009-04-17 00:36:15 -07:00
Rob Pike
aaf63f8d06 Step 1 of the Big Error Shift: make os.Error an interface and replace *os.Errors with os.Errors.
lib/template updated to use new setup; its clients also updated.

Step 2 will make os's error support internally much cleaner.

R=rsc
OCL=27586
CL=27586
2009-04-17 00:08:24 -07:00
Russ Cox
3ea8d854a3 make string(array) take []byte only (and thus *[10]byte but not [10]byte)
R=ken
OCL=27581
CL=27585
2009-04-16 23:07:30 -07:00
Russ Cox
ea12ed4fdd regenerate makefile with installed gobuild
R=r
DELTA=23  (8 added, 0 deleted, 15 changed)
OCL=27577
CL=27583
2009-04-16 23:07:00 -07:00
Rob Pike
3a8ff8237a fix linux build
R=rsc
OCL=27579
CL=27579
2009-04-16 22:43:34 -07:00
Russ Cox
1f6463f823 Convert go tree to hierarchical pkg directory:
import (
		"vector" -> "container/vector"
		"ast" -> "go/ast"
		"sha1" -> "hash/sha1"
		etc.
	)

and update Makefiles.  Because I did the conversion
semi-automatically, I sorted all the import blocks
as a post-processing.  Some files have therefore
changed that didn't strictly need to.

Rename local packages to lower case.
The upper/lower distinction doesn't work on OS X
and complicates the "single-package directories
with the same package name as directory name"
heuristic used by gobuild and godoc to create
the correlation between source and binary locations.
Now that we have a plan to avoid globally unique
names, the upper/lower is unnecessary.

The renamings will cause trouble for a few users,
but so will the change in import paths.
This way, the two maintenance fixes are rolled into
one inconvenience.

R=r
OCL=27573
CL=27575
2009-04-16 20:52:37 -07:00
Russ Cox
0f153ec6b4 build packages in obj/ subdirectory that mimics $GOROOT/pkg.
for example, if building in src/lib/container,
objects go in obj/container/, so that 6g -Iobj
will find "container/vector".

install packages in hierarchy in $GOROOT.

this change only updates gobuild.
another change will have to update all
the sources to refer to "container/vector" etc
and regenerate all the Makefiles.

there are some pretty lame functions here
(e.g., Mkdir, Remove, the Getenv("PWD"))
but i will implement better ones in another CL.

R=r
DELTA=117  (99 added, 2 deleted, 16 changed)
OCL=27550
CL=27574
2009-04-16 20:52:13 -07:00
Rob Pike
3761da2d01 document template
R=rsc
DELTA=92  (73 added, 0 deleted, 19 changed)
OCL=27566
CL=27572
2009-04-16 17:44:23 -07:00
Russ Cox
c8f9378889 regenerate Makefiles.
fix bug in RPC.go (import "RPC" not "rpc.pb")

R=r
DELTA=483  (261 added, 64 deleted, 158 changed)
OCL=27547
CL=27549
2009-04-16 00:18:37 -07:00
Russ Cox
7847056dfb rewrite gobuild in go.
R=r
DELTA=1305  (704 added, 590 deleted, 11 changed)
OCL=27546
CL=27548
2009-04-16 00:18:11 -07:00
Russ Cox
1cb3b7d124 panicln: emit just one newline
R=ken
OCL=27537
CL=27545
2009-04-15 22:38:09 -07:00
Rob Pike
57bff962d9 fix gotest by fixing nm -s to print in file order by storing a sequence number
as the .6 file is read.   now tests will be run in file order.

R=rsc
DELTA=9  (6 added, 1 deleted, 2 changed)
OCL=27542
CL=27544
2009-04-15 21:57:55 -07:00
Russ Cox
60ce95d7a1 code changes for array conversion.
as a reminder, the old conversion
was that you could write

	var arr [10]byte;
	var slice []byte;
	slice = arr;

but now you have to write

	slice = &arr;

the change eliminates an implicit &, so that
the only implicit &s left are in the . operator
and in string(arr).

also, removed utf8.EncodeRuneToString
in favor of string(rune).

R=r
DELTA=83  (1 added, 23 deleted, 59 changed)
OCL=27531
CL=27534
2009-04-15 20:27:45 -07:00
Russ Cox
65d397f747 compiler implementation of array slice change
R=ken
OCL=27533
CL=27533
2009-04-15 20:27:22 -07:00
Russ Cox
37a5374c81 document and partially fix a race
R=r
DELTA=24  (21 added, 0 deleted, 3 changed)
OCL=27527
CL=27527
2009-04-15 19:01:48 -07:00
Russ Cox
1605176e25 godoc: use data-driven templates for html, text generation
R=gri
DELTA=1341  (668 added, 282 deleted, 391 changed)
OCL=27485
CL=27526
2009-04-15 18:53:43 -07:00
Russ Cox
bafd1787fe fix traceback prints - %S was not advancing pointer enough
R=r
DELTA=6  (5 added, 1 deleted, 0 changed)
OCL=27500
CL=27525
2009-04-15 18:52:28 -07:00
Russ Cox
cff99ba167 make Location translate relative path to absolute
(HTTP requires absolute in protocol).

add URL tests

R=r
DELTA=243  (242 added, 0 deleted, 1 changed)
OCL=27472
CL=27523
2009-04-15 18:40:55 -07:00
Russ Cox
17c290ffb9 tweak flag comment
R=r
DELTA=36  (1 added, 0 deleted, 35 changed)
OCL=27484
CL=27522
2009-04-15 18:39:35 -07:00
Russ Cox
64627b04fb check for type equality in deepequal
R=r,dnadasi
DELTA=9  (8 added, 0 deleted, 1 changed)
OCL=27473
CL=27486
2009-04-15 00:55:58 -07:00
Russ Cox
19692beee8 treat "" as empty
R=r
DELTA=10  (10 added, 0 deleted, 0 changed)
OCL=27479
CL=27481
2009-04-15 00:26:49 -07:00
Russ Cox
816f5b3124 better html support.
turn on error reporting; not enough info otherwise.

R=r
DELTA=49  (43 added, 6 deleted, 0 changed)
OCL=27476
CL=27478
2009-04-15 00:05:47 -07:00
Rob Pike
1cb1251436 configurable delimiters.
R=rsc
DELTA=139  (90 added, 7 deleted, 42 changed)
OCL=27475
CL=27477
2009-04-14 22:35:18 -07:00
Russ Cox
cf8b9ce580 test & fix template used twice
R=r
DELTA=30  (30 added, 0 deleted, 0 changed)
OCL=27470
CL=27474
2009-04-14 21:25:33 -07:00
Russ Cox
fa60226073 http additions
file system server
	add NotFound, Redirect functions
	method on a string

R=r
DELTA=212  (199 added, 4 deleted, 9 changed)
OCL=27467
CL=27471
2009-04-14 20:31:31 -07:00
Russ Cox
935953a9f8 tweak interface warning heuristic.
some day i will fix this for real.

R=ken
OCL=27468
CL=27468
2009-04-14 19:57:27 -07:00
Russ Cox
4b8c13dc20 do not create interfaces containing interfaces
R=r
DELTA=16  (14 added, 0 deleted, 2 changed)
OCL=27464
CL=27466
2009-04-14 19:03:57 -07:00
Russ Cox
ff73221d6f fix infinite loop in Readdirnames: bufp > nbuf can happen
after EOF has been hit, because nbuf is now 0 or -1.

discard old comment.

R=r
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=27463
CL=27465
2009-04-14 18:52:39 -07:00
Ian Lance Taylor
ca9765d83a Make the reflection library match the reflection string which
6g generates for functions: expect the keyword "func".  The
older reflection syntax, without the "func", is still
recognized for simplicity in parsing interface reflection
strings.

R=r,rsc
DELTA=66  (31 added, 8 deleted, 27 changed)
OCL=27396
CL=27422
2009-04-14 06:46:01 -07:00
Russ Cox
e21d981a2f add type in not-found error messages.
delay indirection so that values passed to
formatters preserve pointer-ness.

R=r
OCL=27410
CL=27414
2009-04-14 01:12:20 -07:00
Rob Pike
ff12f2effd add (stub) parser to template code, enabling rewrite.
update pretty to use it.
change stdout to stderr in pretty.

R=rsc
DELTA=173  (52 added, 24 deleted, 97 changed)
OCL=27405
CL=27409
2009-04-14 00:06:49 -07:00
Rob Pike
c1ed7d7d25 enable test and fix bug in white space before {
R=rsc
DELTA=6  (0 added, 0 deleted, 6 changed)
OCL=27404
CL=27404
2009-04-13 20:37:24 -07:00
Russ Cox
fa7be65bc0 template bug
--- FAIL: template.TestAll
	for "{.section data}{.end} {header}\n": expected " 77\n" got " {header}\n"

R=r
DELTA=20  (14 added, 0 deleted, 6 changed)
OCL=27395
CL=27402
2009-04-13 19:29:38 -07:00
Russ Cox
6d617a881a change template function interface to
func(w io.Write, value interface{}, format string)

R=r
DELTA=16  (3 added, 3 deleted, 10 changed)
OCL=27399
CL=27401
2009-04-13 19:29:23 -07:00
Rob Pike
a20a50b0b2 \r is white space
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27397
CL=27400
2009-04-13 19:27:35 -07:00
Russ Cox
9b3f43774a fix error return in Remove
change canexec to canExec.

R=r
DELTA=7  (0 added, 0 deleted, 7 changed)
OCL=27393
CL=27398
2009-04-13 19:14:09 -07:00
Russ Cox
5eae3b2102 lib misc
* exec.LookPath
	* flag.Args
	* os.Remove
	* strings.HasPrefix
	* strings.HasSuffix
	* syscall.Rmdir

TBR=r
DELTA=100  (100 added, 0 deleted, 0 changed)
OCL=27373
CL=27392
2009-04-13 16:50:42 -07:00
Russ Cox
4011733d3c allow nil user map
R=r
DELTA=5  (3 added, 0 deleted, 2 changed)
OCL=27371
CL=27389
2009-04-13 15:23:57 -07:00
Russ Cox
a9996d0f89 runtime nits: variable name and comments
R=r
DELTA=10  (0 added, 0 deleted, 10 changed)
OCL=27374
CL=27388
2009-04-13 15:22:36 -07:00
Russ Cox
73aadff8eb add strconv.Unquote
R=r
DELTA=229  (227 added, 0 deleted, 2 changed)
OCL=27200
CL=27366
2009-04-13 13:27:39 -07:00
Russ Cox
a62467af93 fix stringrange test
R=ken
OCL=27353
CL=27353
2009-04-13 05:31:44 -07:00
Ken Thompson
907509de4a tweak
R=r
OCL=27344
CL=27344
2009-04-12 22:34:36 -07:00
Rob Pike
54ec719391 fix string range to have full unicode range (up to 10FFFF).
add test for string range.

test has minor failure: after loop the index == len(s); should be len(s)-1
in this case.  according to spec, vars are left at position at last
iteration.

R=ken,rsc
DELTA=259  (161 added, 96 deleted, 2 changed)
OCL=27343
CL=27343
2009-04-12 17:01:17 -07:00
Rob Pike
9ddeb2105f change replacement rune to its correct value, fffd
R=ken
OCL=27342
CL=27342
2009-04-12 16:13:34 -07:00
Ken Thompson
a91a8042b4 range over strings
R=r
OCL=27332
CL=27332
2009-04-10 19:49:31 -07:00
Kai Backman
35a775d045 Fixed optab to support SWI with long constant (the mode used
for linux system calls).

R=rsc
APPROVED=rsc
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=27325
CL=27328
2009-04-10 16:44:01 -07:00
Kai Backman
4e1896a1b5 Adding ARM elf support to the 5l linker.
R=rsc
APPROVED=rsc
DELTA=312  (312 added, 0 deleted, 0 changed)
OCL=27133
CL=27326
2009-04-10 16:35:36 -07:00
Ken Thompson
cb15bbe748 bug in stack size used in
extending segmented stack

R=r
OCL=27319
CL=27319
2009-04-10 15:23:19 -07:00
Rob Pike
870c91aec2 fix typo breaking linux build
R=rsc
OCL=27304
CL=27304
2009-04-10 02:50:22 -07:00
Ken Thompson
f9854978e2 bug 142
order of evaluation && and ||

R=r
OCL=27294
CL=27294
2009-04-09 19:11:24 -07:00
Ken Thompson
3657061550 change representation of strings
R=r
OCL=27293
CL=27293
2009-04-09 18:16:21 -07:00
Rob Pike
9192dd8e86 Start list of default formatters for template variables.
The HTML one here is just a stub - should use an HTML library to do the right thing.

R=rsc
DELTA=54  (47 added, 2 deleted, 5 changed)
OCL=27250
CL=27250
2009-04-09 00:10:46 -07:00
Rob Pike
4482801477 move template into its own directory so it can have more files
R=rsc
DELTA=1421  (736 added, 685 deleted, 0 changed)
OCL=27249
CL=27249
2009-04-08 23:43:02 -07:00
Rob Pike
3a7df4dde0 add support for variable formatters
R=rsc
DELTA=134  (75 added, 41 deleted, 18 changed)
OCL=27245
CL=27247
2009-04-08 23:33:31 -07:00
Russ Cox
f95da9a639 yet another attempt at auto-linking
store only the original import path string (+ .a)
if 6g resolves it to an archive file.
let 6l re-resolve the .a at link time.

this lets libraries build against an archive
in the current directory but get used
against an installed archive.

R=r
OCL=27244
CL=27244
2009-04-08 22:45:33 -07:00
Rob Pike
91a2ac1f1e undo workaround pending real fix
R=rsc
OCL=27243
CL=27243
2009-04-08 22:24:40 -07:00
Rob Pike
a029f1eb7e work around link bug
R=rsc
OCL=27242
CL=27242
2009-04-08 22:17:09 -07:00
Rob Pike
df0b471533 First cut at templating library for text generation
R=rsc
DELTA=663  (663 added, 0 deleted, 0 changed)
OCL=27239
CL=27241
2009-04-08 22:08:55 -07:00
David Symonds
03fbd72ddb Add new functions to the iterable package:
- Filter
- Find
- Partition

R=rsc
APPROVED=rsc
DELTA=117  (92 added, 17 deleted, 8 changed)
OCL=27135
CL=27240
2009-04-08 21:50:40 -07:00
Russ Cox
3067781ab9 func f() (int, int);
x := f();

used to give
	fatal error: dowidth fn struct struct { int; int }

now gives
	assignment count mismatch: 1 = 2

R=ken
OCL=27198
CL=27201
2009-04-07 22:20:37 -07:00
Russ Cox
7cbec417b1 fumbly fingers + non-working ^C
submitted CL without applying edits.

make changes from CL 27142 review

R=r
DELTA=26  (17 added, 3 deleted, 6 changed)
OCL=27155
CL=27199
2009-04-07 21:53:39 -07:00
Russ Cox
f13ce3ab34 throw away . and .. in directory listings
R=r
DELTA=13  (11 added, 0 deleted, 2 changed)
OCL=27147
CL=27154
2009-04-07 00:40:50 -07:00
Russ Cox
61ba160120 Chdir
R=r
DELTA=17  (17 added, 0 deleted, 0 changed)
OCL=27146
CL=27153
2009-04-07 00:40:36 -07:00
Russ Cox
16b38b554f add path.Clean and other utilities.
use path.Clean in web server to sanitize URLs.

http://triv/go/../../../etc/passwd

no longer serves the password file.
it redirects to

http://triv/etc/passwd

which then gets a 404.

R=r
DELTA=288  (286 added, 0 deleted, 2 changed)
OCL=27142
CL=27152
2009-04-07 00:40:07 -07:00
Rob Pike
640f3f25dc add error case in doc for Index. simplify code slightly.
R=rsc
DELTA=5  (1 added, 0 deleted, 4 changed)
OCL=27148
CL=27151
2009-04-07 00:32:16 -07:00
Russ Cox
d50c70d261 set line number for errors produced during walkstate.
R=ken
OCL=27145
CL=27145
2009-04-06 22:17:46 -07:00
Rob Pike
ee19695cfc make NewBufRead etc. idempotent
R=rsc
DELTA=63  (59 added, 0 deleted, 4 changed)
OCL=27143
CL=27143
2009-04-06 21:42:14 -07:00
Russ Cox
ac6ebfdea9 add method Value() Value to InterfaceValue.
use Value() in print to print underlying value
from interface.

before:
	package main
	import "fmt"
	func main() {
		x := []interface{} {1, "hello", 2.5};
		fmt.Println(x[0], x[1], x[2], x);
	}

	1 hello 2.5 [<non-nil interface> <non-nil interface> <non-nil interface>]

after:
	1 hello 2.5 [1 hello 2.5]

R=r
DELTA=44  (22 added, 16 deleted, 6 changed)
OCL=27139
CL=27141
2009-04-06 21:28:04 -07:00
Russ Cox
b80fdd1e3b an early 6g limitation forced the use of
string(b)[0:n]
instead of the more direct string(b[0:n]).
convert to the more direct form.

R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=27082
CL=27140
2009-04-06 21:14:38 -07:00
Peter McKenzie
0ea0919534 Extremely minor fix to ByteBuffer.
R=r
APPROVED=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=27123
CL=27130
2009-04-06 17:03:07 -07:00
David Symonds
7b77851275 Add an Iterable package with handy functions like All, Any and Map.
Add a Data method to vector.Vector.

R=r,rsc
APPROVED=rsc
DELTA=173  (170 added, 0 deleted, 3 changed)
OCL=26980
CL=27098
2009-04-05 22:40:40 -07:00
Russ Cox
907cb4f1e6 fix both of anton's bugs:
* make([100]int) was being compiled to
	make([]int), kind of.
* []this = [100]that was working for any this, that.

turned up a typo in pipe_test.go

R=ken
OCL=27081
CL=27081
2009-04-03 23:20:51 -07:00
Robert Griesemer
461fb39367 change in negation
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=27061
CL=27061
2009-04-02 23:26:55 -07:00
Robert Griesemer
27d1159ab4 require ";" separator after function literals
R=rsc
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=27057
CL=27059
2009-04-02 22:59:57 -07:00
Russ Cox
39436f2a74 special case check for this situation
; cat >http.go
	package main
	import "http"  // intended the library, not this file
	^D
	; 6g http.go
	; 6g http.go
	http.go:4: export/package mismatch: init
	;

new error:

	http.6:7 http.go:3: cannot import package main

R=ken
OCL=27053
CL=27053
2009-04-02 21:46:19 -07:00
Russ Cox
07687705a4 type n t;
was copying a bit too much about t into n,
like whether the signature was queued to be printed.
(bug reported by anton)

was also editing t, meaning you could do
	type T int;
	func (p int) Meth() { }

both fixed.

R=ken
OCL=27052
CL=27052
2009-04-02 21:38:11 -07:00
Russ Cox
416b27548e use _f007·filename for func literals.
this avoids problems people have run into with
multiple closures in the same package.

when preparing filename, only cut off .go, not .anything.
this fixes a bug tgs ran into with foo.pb.go and foo.go
in the same package.

also turn bad identifier chars from filename into
underscores: a-b.pb.go => a_b_pb

R=ken
OCL=27050
CL=27050
2009-04-02 18:32:57 -07:00
Ken Thompson
9efd6b8a3d compiler falut for forgetting
the assignment on a type switch

R=r
OCL=27048
CL=27048
2009-04-02 18:06:43 -07:00
Russ Cox
58f5f4f18d use separate lex buf for better errors:
package main
func main() { func(){}() + + }

x.go:2: syntax error near _f001

becomes

x.go:2: syntax error near func

R=ken
OCL=27047
CL=27047
2009-04-02 17:59:09 -07:00
Russ Cox
8d8225d529 turn gc of unused data/code back on in loaders.
turned it off while debugging 8 runtime problem,
checked in the change accidentally.

R=r
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=27040
CL=27046
2009-04-02 17:56:23 -07:00
Russ Cox
6b07021a2b implement some more 8g
package main
	func main() {
		println("hello,", 123);
	}

R=ken
OCL=27043
CL=27043
2009-04-02 16:48:06 -07:00
Russ Cox
d6c59ad7b8 clarification suggested by rob
R=r
DELTA=4  (4 added, 0 deleted, 0 changed)
OCL=26983
CL=27041
2009-04-02 16:41:53 -07:00
Robert Griesemer
e3fdcdfea7 - Ident node now takes a string Value instead of a []bytes
(this removes a lot of string() conversions down the road)
- a few minor adjustments

R=rsc
DELTA=11  (0 added, 0 deleted, 11 changed)
OCL=27029
CL=27038
2009-04-02 15:58:38 -07:00
Robert Griesemer
3ba69bf08b Some AST tuning:
- have explicit XSpec nodes for declarations
- have a general GenDecl node instead of DeclList

R=rsc
DELTA=164  (52 added, 52 deleted, 60 changed)
OCL=27005
CL=27027
2009-04-02 10:15:58 -07:00
Daniel Nadasi
c4ad4f9fcf Add a DeepEqual function to the reflect package
R=r,rsc
APPROVED=rsc
DELTA=167  (166 added, 0 deleted, 1 changed)
OCL=26982
CL=27017
2009-04-01 22:20:18 -07:00
Ken Thompson
2450c590e9 typeswitch - expression evaluated
twice instead of once.

R=r
OCL=27015
CL=27015
2009-04-01 21:28:59 -07:00
Rob Pike
62d11a3302 use range in vector iterator
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27003
CL=27003
2009-04-01 16:34:25 -07:00
Russ Cox
95100344d3 fix runtime stack overflow bug that gri ran into:
160 - 75 was just barely not enough for deferproc + morestack.

added enum names and bumped to 256 - 128.
added explanation.

changed a few mal() (garbage-collected) to
malloc()/free() (manually collected).

R=ken
OCL=26981
CL=26981
2009-04-01 00:26:00 -07:00
David Symonds
c025cf64dc Bail out of gotest immediately if compiling fails.
R=rsc
APPROVED=rsc
DELTA=4  (2 added, 2 deleted, 0 changed)
OCL=26978
CL=26978
2009-03-31 22:35:55 -07:00
Russ Cox
4b536c1e07 test for and fix bug involving reflect v.Interface() and ==.
R=r
DELTA=156  (149 added, 2 deleted, 5 changed)
OCL=26973
CL=26973
2009-03-31 17:33:04 -07:00
Robert Griesemer
07513c2599 1) Move parser.go into src/lib/go
- minor adjustments as suggested by rsc
2) Added parser_test fragment
3) Renamed some types in AST.go per rsc request

R=rsc
DELTA=2053  (2027 added, 0 deleted, 26 changed)
OCL=26963
CL=26971
2009-03-31 16:53:37 -07:00
Russ Cox
4702c0e5ef more 386 runtime:
remove use of _subv in vlrt.c
	darwin/386/signal.c
	darwin/386/*
	linux/386/* (forgotten before)

can run empty program on darwin/386 now.

R=r
DELTA=1140  (1021 added, 114 deleted, 5 changed)
OCL=26942
CL=26968
2009-03-31 15:45:12 -07:00