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

1135 Commits

Author SHA1 Message Date
Robert Griesemer
f9057c7b59 break tabwriter columns when starting a new block of indented statements
R=r
DELTA=16  (15 added, 0 deleted, 1 changed)
OCL=32475
CL=32481
2009-07-29 16:23:17 -07:00
Rob Pike
43c7fc04b8 fix typo
R=rsc
OCL=32472
CL=32472
2009-07-29 15:33:12 -07:00
Rob Pike
1fc0960fb4 clean up EOF
R=rsc
DELTA=5  (0 added, 1 deleted, 4 changed)
OCL=32465
CL=32467
2009-07-29 15:24:42 -07:00
Rob Pike
1f6e18fdce handle some error conditions involving bad data.
R=rsc
DELTA=32  (24 added, 1 deleted, 7 changed)
OCL=32461
CL=32463
2009-07-29 15:10:29 -07:00
Rob Pike
75e0569b99 statistics HTML page for rpc
R=rsc
DELTA=121  (115 added, 0 deleted, 6 changed)
OCL=32427
CL=32429
2009-07-29 13:26:49 -07:00
Russ Cox
9346c6d901 make every func literal expression allocate,
so that == on func means that the
functions originated in the same
execution of a func literal or definition.

before, there was an inconsistency:

	func() {x++} != func() {x++}

but

	func() {} == func() {}

this CL makes the second case != too,
just like

	make(map[int]int) != make(map[int]int)

R=r
DELTA=202  (71 added, 62 deleted, 69 changed)
OCL=32393
CL=32398
2009-07-28 20:01:00 -07:00
David Symonds
83940d7c4a Add a unique list ID to list elements, and verify it as necessary.
This makes the list closed under its provided operations.

R=rsc,gri
APPROVED=rsc
DELTA=18  (14 added, 0 deleted, 4 changed)
OCL=32388
CL=32395
2009-07-28 18:19:16 -07:00
Robert Griesemer
40a66ef59e missed changes to Makefiles for container/ring
R=rsc
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=32389
CL=32392
2009-07-28 17:52:30 -07:00
Rob Pike
b85147cd70 change the encoding of uints to simplify overflow checking and to make them
easier and faster to read.  they are now either a one-byte value or a n-byte value
preceded by a byte holding -n.

R=rsc
DELTA=150  (45 added, 7 deleted, 98 changed)
OCL=32381
CL=32387
2009-07-28 17:20:19 -07:00
Russ Cox
123ff2ebb8 bug177: anonymous struct fields in reflect
(reported by iant)

R=r
DELTA=50  (32 added, 12 deleted, 6 changed)
OCL=32263
CL=32385
2009-07-28 17:01:46 -07:00
Robert Griesemer
2210a643b7 Intersperse comments nicely when printing an AST.
gofmt formatted source code looks pretty good already;
with a bit more fine-tuning it should be great.

printer.go:
- Implemented comment intersperse algorithm.
  The approach is a result of many trial-and-error
  experiments but at this point reasonably simple
  and open to arbitrary fine-tuning.

parser.go:
- Simplified handling of lead and line comments
  (formerly called leading and trailing comments).
- Use a comments list instead of an array (I may
  change this back - this is not obviously better
  and uses more space).

doc.go:
- Remove comments from AST nodes that have been
  'consumed' in the documentation to avoid duplicate
  printing of them. Allows for better control of
  what is printed w/o use of printing control flags
  (which are hard to use and not fine-grained enough).

Corresponding adjustments to various clients of these
files.

R=rsc
DELTA=478  (275 added, 108 deleted, 95 changed)
OCL=32185
CL=32380
2009-07-28 16:38:59 -07:00
Robert Griesemer
d27bae5033 Fixed typos in comments.
TBR=rsc
OCL=32330
CL=32330
2009-07-28 15:03:05 -07:00
Robert Griesemer
6d3d25de21 Ring ADT.
- Provides analogous functionality to a doubly-linked list
  implementation.
- Completely symmetric set of operations.
- Operations on the ADT do not lead to results that are
  outside the domain of the ADT (closed interface).
- Alternative to container/list.

R=rsc
DELTA=489  (489 added, 0 deleted, 0 changed)
OCL=32284
CL=32323
2009-07-28 14:54:49 -07:00
Russ Cox
e50d3ba7e4 floating-point limits and equations
R=r
DELTA=13  (8 added, 2 deleted, 3 changed)
OCL=32291
CL=32322
2009-07-28 14:50:50 -07:00
Rob Pike
483e4fc409 - clean up code creating keys for type maps
- derive int, uint, float, uintptr decoders based on their size
- add overflow checks in decode

R=rsc
DELTA=407  (281 added, 44 deleted, 82 changed)
OCL=32286
CL=32290
2009-07-28 12:59:39 -07:00
Rob Pike
08b5b4843b constants for integer limits
R=rsc
DELTA=16  (16 added, 0 deleted, 0 changed)
OCL=32288
CL=32288
2009-07-28 12:57:33 -07:00
Rob Pike
326de9ca97 constants for floating point limits
R=rsc
DELTA=5  (5 added, 0 deleted, 0 changed)
OCL=32283
CL=32287
2009-07-28 11:53:16 -07:00
Rob Pike
5b1d52e81d document rpc.
R=rsc
DELTA=160  (124 added, 0 deleted, 36 changed)
OCL=32233
CL=32256
2009-07-27 17:25:41 -07:00
Ivan Krasin
b388d84013 Fixed a small bug with compress/flate/Inflater. It incorrectly checked
the size of chunk with uncompressed data (00 is terms of DEFLATE).

APPROVED=rsc
DELTA=15  (14 added, 0 deleted, 1 changed)
OCL=32105
CL=32238
2009-07-27 14:33:21 -07:00
Russ Cox
7729c3f955 fix gc bug causing make smoketest to die in cmd/gofmt.
saving of sp was too far away from use in scanstack;
the stack had changed since the sp was saved.

R=r
DELTA=9  (4 added, 2 deleted, 3 changed)
OCL=32232
CL=32237
2009-07-27 14:16:28 -07:00
Russ Cox
ca01716934 fix build - broke with uint32 -> int change in reflect SliceHeader
TBR=r
OCL=32225
CL=32225
2009-07-27 11:23:49 -07:00
Rob Pike
5aa174557a clean up for public use: make some stuff private, add doc comments.
R=rsc
DELTA=298  (202 added, 0 deleted, 96 changed)
OCL=32006
CL=32224
2009-07-27 11:02:06 -07:00
Russ Cox
3ff5e727e2 fix bug in CL 30057: missed if+continue in one place.
R=gri
DELTA=2  (2 added, 0 deleted, 0 changed)
OCL=32214
CL=32223
2009-07-27 10:59:59 -07:00
Russ Cox
22ea3f9e49 fix SliceHeader: len and cap are int, not uint32
R=r,iant
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=32215
CL=32222
2009-07-27 10:59:37 -07:00
David Symonds
a225706e5f container/list: Add Len() method to List.
R=r
APPROVED=gri
DELTA=23  (23 added, 0 deleted, 0 changed)
OCL=32106
CL=32189
2009-07-25 17:18:05 -07:00
Ian Lance Taylor
b64b75daa7 If we can't parse the package, call Fatalf so that the test
fails without crashing.

R=gri
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=32164
CL=32171
2009-07-24 13:07:12 -07:00
Russ Cox
052a66babd runtime: fix init scheduling bug.
if there is a goroutine waiting to run
and the init goroutine enters a system call,
entersyscall was trying to kick off a new
scheduler for the other goroutine, causing
a panic (new goroutines can't run until main.main).

R=r
DELTA=32  (32 added, 0 deleted, 0 changed)
OCL=31982
CL=31982
2009-07-21 19:43:27 -07:00
Robert Griesemer
ff790f4704 adjust comment for better godoc output
R=rsc
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=31944
CL=31950
2009-07-21 15:09:59 -07:00
Robert Griesemer
e62dd7bce9 - split bignum package into 3 files
- use array for common small values
- integer.go, rational.go don't contain changes besides the added file header

R=rsc
DELTA=1475  (748 added, 713 deleted, 14 changed)
OCL=31939
CL=31942
2009-07-21 14:28:59 -07:00
Ian Lance Taylor
f0c00f7eee Don't cast nil to a fixed array type.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31916
CL=31937
2009-07-21 14:06:14 -07:00
Robert Griesemer
2b1ec70d0f implemented outstanding bit ops on negative integerts
R=rsc
DELTA=195  (146 added, 1 deleted, 48 changed)
OCL=31895
CL=31931
2009-07-21 13:35:51 -07:00
Ian Lance Taylor
39808db15a Make struct field names unique.
R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=31900
CL=31900
2009-07-20 23:26:03 -07:00
Austin Clements
fb65906367 Fix typo. MUL_ASSIGN is "*=", not "+=".
R=gri
APPROVED=gri
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31879
CL=31886
2009-07-20 16:14:48 -07:00
Robert Griesemer
9e2fa390da - bignum.AndNot
- corresponding test cases
- some cleanups

R=rsc
DELTA=173  (68 added, 3 deleted, 102 changed)
OCL=31866
CL=31869
2009-07-20 13:37:28 -07:00
Robert Griesemer
821897bc96 - better documentation
- code cleanup

R=rsc,austin
DELTA=28  (12 added, 2 deleted, 14 changed)
OCL=31808
CL=31810
2009-07-17 16:22:55 -07:00
Austin Clements
25b4be5a55 Support exponential notation in RatFromString.
R=gri
APPROVED=gri
DELTA=30  (25 added, 0 deleted, 5 changed)
OCL=31796
CL=31799
2009-07-17 15:09:43 -07:00
Austin Clements
f95a42e6ba Produce friendlier errors messages for malformed character
literals and when the parser hits an unexpected EOF.  Also,
disallow newlines in character literals.

R=gri
APPROVED=gri
DELTA=23  (15 added, 1 deleted, 7 changed)
OCL=31790
CL=31797
2009-07-17 14:58:02 -07:00
Rob Pike
ba0cf083a2 change reflect.Type.Name() into two functions: Name() and PkgPath() for ease of use.
R=rsc
DELTA=31  (8 added, 2 deleted, 21 changed)
OCL=31778
CL=31792
2009-07-17 14:20:33 -07:00
Rob Pike
cb0a02f028 ignore missing structs
R=rsc
DELTA=113  (74 added, 14 deleted, 25 changed)
OCL=31776
CL=31776
2009-07-17 11:38:31 -07:00
Russ Cox
e52e9ca82e another step toward eliminating forward declarations.
introduce NodeList* type in compiler to replace OLIST.
this clarifies where lists can and cannot occur.
list append and concatenation are now cheap.
the _r rules are gone from yacc.
rev and unrev are gone.
no more lists of lists.

the representation of assignments is a bit clunkier.
split into OAS (1=1) and OAS2 (2 or more on one side).

delete dead chanrecv3 code.

delay construction of func types.

R=ken
OCL=31745
CL=31762
2009-07-17 01:00:44 -07:00
Rob Pike
9b475bd2a4 fix up prints in flag.go
R=rsc
DELTA=11  (0 added, 0 deleted, 11 changed)
OCL=31760
CL=31760
2009-07-16 23:14:33 -07:00
Rob Pike
be2cf952a8 clean up the code, flow errors out to decoder.
R=rsc
DELTA=99  (32 added, 22 deleted, 45 changed)
OCL=31759
CL=31759
2009-07-16 23:01:10 -07:00
Rob Pike
1737157189 use FieldByName where possible.
R=rsc
DELTA=20  (0 added, 12 deleted, 8 changed)
OCL=31758
CL=31758
2009-07-16 21:24:30 -07:00
Rob Pike
a93c5c8550 add FieldByName to the interface of reflect.StructType
R=rsc
DELTA=34  (33 added, 0 deleted, 1 changed)
OCL=31752
CL=31754
2009-07-16 18:21:14 -07:00
Rob Pike
1399badb02 - allow wire type and receive type to differ.
- still TODO: ignoring struct fields.

R=rsc
DELTA=309  (240 added, 2 deleted, 67 changed)
OCL=31750
CL=31750
2009-07-16 17:55:16 -07:00
Robert Griesemer
f3ffd93a61 ast:
- renamed Program -> SourceFile
- added Package node representing the AST for an entire package
- added filter function to create a source file mimicking the
  interface of an entire package

parser:
- parser entry to parse entire packages
- unified naming of parser entry points
- factored out entry points into new file (interface.go)

gofmt:
- extended to accept single .go files, and package paths:
  gofmt file.go	     	    // formatting of a single file
  gofmt -x file.go	    // interface of a single file
  gofmt -x ./MyPackage	    // interface of a local package
  gofmt -x math		    // interface of a $GOROOT relative package

Various adjustments in dependent files, documentation.

R=rsc
DELTA=634  (369 added, 153 deleted, 112 changed)
OCL=31743
CL=31748
2009-07-16 17:11:18 -07:00
Rob Pike
b75df2f695 fix some bad testing prints
R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=31740
CL=31742
2009-07-16 15:01:21 -07:00
Rob Pike
04ae91cf71 clean up the decode loop and fix a couple of bad prints
R=rsc
DELTA=15  (8 added, 2 deleted, 5 changed)
OCL=31738
CL=31738
2009-07-16 13:05:46 -07:00
David Symonds
13960ae8ae exvar: new Timer var type.
R=rsc
APPROVED=r
DELTA=146  (142 added, 0 deleted, 4 changed)
OCL=31654
CL=31716
2009-07-15 23:24:27 -07:00
Rob Pike
a9be3f46c6 add rpc to the build
R=rsc
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=31693
CL=31714
2009-07-15 21:28:45 -07:00
Rob Pike
7d94cfdfb9 /usr/local/bin might not exist so use /usr/bin in the chdir test.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31708
CL=31713
2009-07-15 21:28:08 -07:00
Rob Pike
3fc7cfd55f improve server handling of errors now that Decoder grabs full message.
R=rsc
DELTA=23  (4 added, 7 deleted, 12 changed)
OCL=31701
CL=31703
2009-07-15 16:11:14 -07:00
Rob Pike
e76a335ada make the low-level encoder and decoder private and have them access byte.Buffers rather
than io.Readers and io.Writers.
change the Encoder/Decoder protocol so that each message is preceded by its length in bytes.

R=rsc
DELTA=468  (119 added, 23 deleted, 326 changed)
OCL=31700
CL=31702
2009-07-15 16:10:17 -07:00
Rob Pike
dc8c447689 post-submit tweaks to previous cl
R=rsc
DELTA=5  (4 added, 1 deleted, 0 changed)
OCL=31690
CL=31692
2009-07-15 12:38:50 -07:00
Rob Pike
8071cdf724 handle errors better:
1) terminate outstanding calls on the client when we see EOF from server
	2) allow data to drain on server before closing the connection

R=rsc
DELTA=41  (23 added, 4 deleted, 14 changed)
OCL=31687
CL=31689
2009-07-15 11:47:29 -07:00
Russ Cox
aa1e8064b2 change HTTP access for RPC.
1. use CONNECT instead of GET.
   CONNECT has exactly the meaning
   we want; most of the time people
   connect to ip:port; we're connecting
   to /_goRPC_

2. wait for a successful HTTP response
   before assuming we are connected to
   the RPC protocol.  this allows better
   error reporting and also keeps the
   protocol alternating between speakers,
   so that the buffering in the HTTP request
   reader cannot accidentally eat some
   RPC bytes too.

gotest sometimes hangs, but not in HTTP.

gotest -match=Unknown hangs every few runs
even in a clean client.

R=r
DELTA=117  (57 added, 44 deleted, 16 changed)
OCL=31656
CL=31685
2009-07-15 10:49:47 -07:00
Robert Griesemer
3d486d0d26 - do not collect BUG comments w/o bug description
R=rsc
DELTA=17  (8 added, 0 deleted, 9 changed)
OCL=31670
CL=31674
2009-07-15 10:12:57 -07:00
Austin Clements
8d8245623f Add a dummy WaitStatus.TrapCause for Darwin to unbreak the build.
R=gri
APPROVED=gri
DELTA=5  (5 added, 0 deleted, 0 changed)
OCL=31673
CL=31673
2009-07-15 10:12:06 -07:00
Austin Clements
d0e29f2852 Pretty printer for os.Waitmsg
R=rsc
APPROVED=rsc
DELTA=49  (49 added, 0 deleted, 0 changed)
OCL=31568
CL=31671
2009-07-15 09:58:42 -07:00
Rob Pike
964b6cf352 add HTTP support
R=rsc
DELTA=159  (110 added, 29 deleted, 20 changed)
OCL=31646
CL=31652
2009-07-14 20:47:39 -07:00
Austin Clements
b6e6663946 Return ptrace event message when there's no error instead of
only when there's an error.

R=rsc
APPROVED=rsc
DELTA=3  (0 added, 2 deleted, 1 changed)
OCL=31650
CL=31650
2009-07-14 18:05:29 -07:00
Rob Pike
ba9d697336 allow user to override the Usage function
R=gri
DELTA=15  (6 added, 5 deleted, 4 changed)
OCL=31649
CL=31649
2009-07-14 17:44:20 -07:00
Robert Griesemer
eb815c0fa2 fixed typo
TBR=r
OCL=31647
CL=31647
2009-07-14 17:08:09 -07:00
Robert Griesemer
4fb8f44ea7 - interface and comments cleanup
R=rsc
DELTA=33  (1 added, 3 deleted, 29 changed)
OCL=31620
CL=31642
2009-07-14 16:30:20 -07:00
Russ Cox
f752e909dc darwin ptrace constants
R=austin
DELTA=42  (37 added, 5 deleted, 0 changed)
OCL=31618
CL=31633
2009-07-14 15:29:29 -07:00
Austin Clements
14bb806cb4 Support ptracing of fork'd children.
R=rsc
APPROVED=rsc
DELTA=26  (22 added, 1 deleted, 3 changed)
OCL=31613
CL=31629
2009-07-14 15:09:39 -07:00
Austin Clements
40f406afc4 Zero unused syscall arguments.
R=rsc
APPROVED=rsc
DELTA=12  (12 added, 0 deleted, 0 changed)
OCL=31619
CL=31621
2009-07-14 13:59:54 -07:00
Rob Pike
b07af158a4 improve rpc code. more robust. more tests.
R=rsc
DELTA=186  (133 added, 20 deleted, 33 changed)
OCL=31611
CL=31616
2009-07-14 13:23:14 -07:00
Austin Clements
bc2fda9c89 Regenerate Linux 386 syscall bindings to add ptrace.
R=rsc
APPROVED=rsc
DELTA=82  (80 added, 2 deleted, 0 changed)
OCL=31610
CL=31612
2009-07-14 11:59:19 -07:00
Austin Clements
9df528740a Syscall wrappers for ptrace and supporting wait-related flags.
R=rsc
APPROVED=rsc
DELTA=311  (308 added, 3 deleted, 0 changed)
OCL=31569
CL=31606
2009-07-14 10:53:04 -07:00
Robert Griesemer
e48d8fe091 update remaining files to match new scanner/parser interface
and use shared error handling infrastructure

R=rsc
DELTA=109  (3 added, 86 deleted, 20 changed)
OCL=31600
CL=31605
2009-07-14 10:46:18 -07:00
Robert Griesemer
5945b25158 - adjust to new token.Position definition
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31574
CL=31604
2009-07-14 10:45:57 -07:00
Robert Griesemer
2d58fa6f18 - use new scanner error handling code
R=rsc
DELTA=109  (0 added, 87 deleted, 22 changed)
OCL=31573
CL=31603
2009-07-14 10:45:43 -07:00
Robert Griesemer
a010d45caa - adjust to new scanner interface (pass filename to Init)
- delete error handling code which is not needed anymore

R=rsc
DELTA=83  (0 added, 65 deleted, 18 changed)
OCL=31572
CL=31602
2009-07-14 10:45:22 -07:00
Robert Griesemer
14228f3898 - added Filename field to token.Position
- handle //line filename:line comments in scanner
- moved error handling code used by various scanner clients
  to errors.go
- added extra tests

R=rsc
DELTA=385  (343 added, 18 deleted, 24 changed)
OCL=31551
CL=31601
2009-07-14 10:44:57 -07:00
Austin Clements
ffb4b0d7b7 Avoid clash between os.WRUSAGE and Linux's WALL flag.
R=rsc
APPROVED=rsc
DELTA=5  (4 added, 0 deleted, 1 changed)
OCL=31564
CL=31567
2009-07-13 19:28:00 -07:00
Austin Clements
da1da8d07e Add accessor for SIGTRAP cause in wait status
R=rsc
APPROVED=rsc
DELTA=7  (7 added, 0 deleted, 0 changed)
OCL=31563
CL=31565
2009-07-13 19:20:38 -07:00
Russ Cox
218c393029 add LockOSThread and UnlockOSThread to
runtime package for use by debugger,
which needs to make sure that all ptrace calls
about a given pid come from the same thread.

R=r
DELTA=175  (90 added, 63 deleted, 22 changed)
OCL=31546
CL=31558
2009-07-13 17:28:39 -07:00
Rob Pike
9126b75e35 rpc.
client library.
muxes on both ends.

R=rsc
DELTA=178  (132 added, 26 deleted, 20 changed)
OCL=31541
CL=31556
2009-07-13 16:52:57 -07:00
Russ Cox
8afc6008a8 add note about once and closures
R=r
DELTA=13  (13 added, 0 deleted, 0 changed)
OCL=31535
CL=31549
2009-07-13 15:54:41 -07:00
Robert Griesemer
32cd887574 - handle type forward declarations correctly
R=r
DELTA=8  (6 added, 0 deleted, 2 changed)
OCL=31537
CL=31537
2009-07-13 13:55:39 -07:00
Rob Pike
efb918b7db the beginnings of an rpc service.
server side only; no client help yet (but it's easy).
no http yet.
service is synchronous.
all this will improve.

R=rsc
DELTA=403  (403 added, 0 deleted, 0 changed)
OCL=31522
CL=31536
2009-07-13 12:58:14 -07:00
Rob Pike
b2a66adc59 the name of the type was being sent twice. drop the outer instance.
R=rsc
DELTA=10  (5 added, 1 deleted, 4 changed)
OCL=31523
CL=31526
2009-07-13 11:41:02 -07:00
Robert Griesemer
ef4347f19e Basic EBNF package:
- parsing of EBNF grammars
- basic consistency checks

R=rsc
DELTA=695  (695 added, 0 deleted, 0 changed)
OCL=31479
CL=31516
2009-07-13 10:10:56 -07:00
Kai Backman
7842b03f70 Fixed minor typo in asm file.
R=rsc
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31487
CL=31500
2009-07-12 22:12:19 -07:00
Rob Pike
62011cfcdf first cut at gob decoder.
R=rsc
DELTA=184  (181 added, 1 deleted, 2 changed)
OCL=31474
CL=31486
2009-07-11 15:45:54 -07:00
Russ Cox
92e925778e reflection for interface set
rename map access methods to Elem, SetElem.

R=r
DELTA=95  (66 added, 7 deleted, 22 changed)
OCL=31456
CL=31469
2009-07-10 16:32:26 -07:00
Rob Pike
8a9e395f5f one more piece of testing: 2nd send should not send type info.
R=rsc
DELTA=25  (25 added, 0 deleted, 0 changed)
OCL=31460
CL=31460
2009-07-10 13:50:44 -07:00
Rob Pike
f0a9840d04 a better encoder test, with a couple of fixes for bugs it uncovered.
R=rsc
DELTA=84  (65 added, 9 deleted, 10 changed)
OCL=31458
CL=31458
2009-07-10 13:44:37 -07:00
Rob Pike
1880b90aff DeepEqual for maps
R=rsc
DELTA=47  (30 added, 16 deleted, 1 changed)
OCL=31455
CL=31455
2009-07-10 11:20:10 -07:00
Robert Griesemer
a47404bc1c fix error messages
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=31449
CL=31451
2009-07-10 10:00:25 -07:00
Rob Pike
3928a4e11b printing maps
R=rsc
DELTA=57  (39 added, 3 deleted, 15 changed)
OCL=31424
CL=31430
2009-07-09 17:30:07 -07:00
Russ Cox
12ebbe7463 reflection for methods
R=r
DELTA=156  (135 added, 8 deleted, 13 changed)
OCL=31407
CL=31428
2009-07-09 17:27:49 -07:00
Robert Griesemer
f7b92bb45d fix to scanner_test after change to //-style comment token
R=rsc
OCL=31421
CL=31421
2009-07-09 16:54:08 -07:00
Robert Griesemer
38e7fddc21 Show BUG comments in godoc:
ast.go:
- rename Comments -> CommentGroup (less confusion)
- change all comments/docs to be *CommentGroup

filter.go:
- do not remove unassociated comments from program as part
  of export filtering (they are needed by doc.go for BUG comments)

scanner.go:
- exclude '\n' from //-style comments

parser.go:
- rewrote collection of comments: now all collected comments
  are *ast.CommentGroups
- clarified distinction between leading and trailing comments
- fixed a bug in comment collection (parseGenDecl);
  corresponding test case is in printer/testdata
- extra documentation

doc.go:
- collect BUG comments
- corresponding fix for parser bug in comment collection

comment.go:
- simplified regex

printer.go:
- adjust comment printing to new representation

printer_test.go, testdata/*:
- enable printing of doc comments
- extended tests

package.html, package.txt:
- added Bugs section

gofmt:
- enable printing of doc comments

R=rsc
DELTA=339  (126 added, 38 deleted, 175 changed)
OCL=31403
CL=31416
2009-07-09 16:38:17 -07:00
Rob Pike
ec23467e65 store ids rather than Types in the structs so they can be encoded.
change Type to gobType.
fix some bugs around recursive structures.
lots of cleanup.
add the first cut at a type encoder.

R=rsc
DELTA=400  (287 added, 11 deleted, 102 changed)
OCL=31401
CL=31406
2009-07-09 14:33:43 -07:00
David Symonds
600d7828a7 archive/tar cleanups:
- rename untar{,_test}.go to reader{,_test}.go.
  - fix up some comments.
  - improve test output if it fails.

R=rsc
APPROVED=rsc
DELTA=821  (400 added, 392 deleted, 29 changed)
OCL=31376
CL=31378
2009-07-08 18:31:14 -07:00
Russ Cox
bba278a43b reflection for functions
add channel send type check (thanks austin).
fix type mismatch message.

R=r
DELTA=241  (225 added, 5 deleted, 11 changed)
OCL=31370
CL=31375
2009-07-08 18:16:09 -07:00
David Symonds
d6d0a39050 Basic POSIX-compatible tar writer.
R=rsc
APPROVED=rsc
DELTA=456  (382 added, 66 deleted, 8 changed)
OCL=31246
CL=31372
2009-07-08 17:15:18 -07:00
Russ Cox
5ddaf9a098 reflection for channels
R=r
DELTA=188  (171 added, 6 deleted, 11 changed)
OCL=31352
CL=31361
2009-07-08 15:00:54 -07:00
Robert Griesemer
2ad7958b7e - update functionality for printer test
- moved test files from data to testdata
- use tabs instead of spaces for layout

R=rsc
DELTA=129  (67 added, 60 deleted, 2 changed)
OCL=31353
CL=31360
2009-07-08 14:57:51 -07:00
Robert Griesemer
e7af3b8e05 comment change
R=r
OCL=31359
CL=31359
2009-07-08 14:56:20 -07:00
Robert Griesemer
ff9e657fb3 WriteFile util function
R=rsc
DELTA=41  (41 added, 0 deleted, 0 changed)
OCL=31349
CL=31358
2009-07-08 14:48:09 -07:00
Russ Cox
764b6ec1aa reflection for maps
R=r
DELTA=304  (248 added, 34 deleted, 22 changed)
OCL=31345
CL=31347
2009-07-08 13:55:57 -07:00
Rob Pike
0ae7882b5c bug fix: encOpFor etc. need to indirect
R=rsc
DELTA=28  (7 added, 7 deleted, 14 changed)
OCL=31312
CL=31322
2009-07-07 21:05:24 -07:00
Robert Griesemer
d7f1f53e86 printer_test: first cut
R=rsc
DELTA=169  (168 added, 0 deleted, 1 changed)
OCL=31319
CL=31321
2009-07-07 18:09:26 -07:00
Robert Griesemer
9809d73868 - print comments associated with declarations
- fix a bug w/ optional semicolons

R=rsc
DELTA=46  (24 added, 0 deleted, 22 changed)
OCL=31306
CL=31311
2009-07-07 16:07:34 -07:00
Austin Clements
17bc836127 Add entry points for parsing statements and expressions.
R=gri
APPROVED=gri
DELTA=73  (48 added, 0 deleted, 25 changed)
OCL=31302
CL=31308
2009-07-07 15:47:01 -07:00
Ian Lance Taylor
668fa7f677 Update the unsafe docs for the new type implementation.
Please correct as needed.

R=rsc,r
DELTA=10  (4 added, 1 deleted, 5 changed)
OCL=31305
CL=31305
2009-07-07 15:06:29 -07:00
Ian Lance Taylor
dbc6d91d70 typestring.c is no longer needed.
R=rsc
DELTA=35  (0 added, 34 deleted, 1 changed)
OCL=31301
CL=31303
2009-07-07 14:50:39 -07:00
Robert Griesemer
61824ff3a4 - ast.FilterExports: filter non-exported anonymous fields
- fixed typo in parser.go
- removed test w/ syntax errors from gofmt test script

R=rsc
DELTA=25  (21 added, 0 deleted, 4 changed)
OCL=31296
CL=31298
2009-07-07 12:02:54 -07:00
Russ Cox
877839333e gob: use new reflect
R=r
DELTA=242  (68 added, 69 deleted, 105 changed)
OCL=31239
CL=31289
2009-07-07 11:04:42 -07:00
Russ Cox
e37f81b49c template: use new reflect interface (CL 31107)
R=r
DELTA=16  (3 added, 1 deleted, 12 changed)
OCL=31121
CL=31288
2009-07-07 11:04:34 -07:00
Russ Cox
f1bc712035 net: use new reflect interface (CL 31107)
R=r
DELTA=186  (55 added, 8 deleted, 123 changed)
OCL=31117
CL=31287
2009-07-07 11:04:26 -07:00
Russ Cox
1b35969871 json: use new reflect interface (CL 31107)
R=r
DELTA=192  (52 added, 43 deleted, 97 changed)
OCL=31116
CL=31286
2009-07-07 11:04:18 -07:00
Russ Cox
65dbe76532 go/printer: use new reflect interface (CL 31107)
R=gri
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=31115
CL=31285
2009-07-07 11:04:10 -07:00
Russ Cox
b9b32cab58 datafmt: use new reflect interface (CL 31107)
R=gri
DELTA=70  (7 added, 17 deleted, 46 changed)
OCL=31113
CL=31283
2009-07-07 11:03:50 -07:00
Russ Cox
f3ec39d1ea base64_test: use new reflect interface (CL 31107)
R=austin
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=31112
CL=31282
2009-07-07 11:03:40 -07:00
Russ Cox
0d400a7dea fmt: use new reflect interface (CL 31107)
R=r
DELTA=208  (37 added, 63 deleted, 108 changed)
OCL=31111
CL=31281
2009-07-07 11:03:31 -07:00
Russ Cox
64f4e0b197 update reflect supporting functions,
tests to use new reflect interface.

also make tests a real gotest.

depends on CL 31107

R=r
DELTA=582  (56 added, 194 deleted, 332 changed)
OCL=31108
CL=31279
2009-07-07 11:03:12 -07:00
Russ Cox
c7513eac88 runtime: use new reflect data structures (CL 31107)
in place of sigi, sigt.

R=ken
OCL=31118
CL=31277
2009-07-07 11:02:54 -07:00
Russ Cox
ce2e450c6b install new reflect:
rename ntype.go and nvalue.go to type.go and value.go

R=r
DELTA=4295  (761 added, 2819 deleted, 715 changed)
OCL=31238
CL=31276
2009-07-07 11:02:44 -07:00
Ian Lance Taylor
5abf395be7 Avoid race condition. Following the left to right rule,
s.output.Data() was being retrieved before the synchronization
point, which meant that it could be retrieved before the
goroutine wrote it.  Using gccgo this caused random errors.

R=gri
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=31046
CL=31267
2009-07-07 10:15:01 -07:00
Robert Griesemer
8afeb52cac - removed implementation restrictions for creation of small
Natural, Integer, and Rational numbers
- added Value() methods to access small Natural and Integers
  as uint64 or int64 respectively, and to get the components
  of Rational numbers
- fixed a bug with Integer creation
- removed some _'s from names
- added more comments in places
- added test cases

R=rsc
DELTA=184  (127 added, 11 deleted, 46 changed)
OCL=31210
CL=31265
2009-07-07 10:03:42 -07:00
David Symonds
52ccdf3510 Add support for v7 tar.
R=rsc
APPROVED=rsc
DELTA=32  (26 added, 4 deleted, 2 changed)
OCL=31172
CL=31242
2009-07-06 22:59:31 -07:00
Russ Cox
58c4142e74 new reflect Value implementations.
for now, canSet stays.
i will look into getting rid of it in
a future CL.

R=r
DELTA=420  (419 added, 0 deleted, 1 changed)
OCL=31231
CL=31235
2009-07-06 22:10:40 -07:00
Russ Cox
d436a70193 allow conversion to interface type
when implicit assignment would have been okay.

R=ken
OCL=31225
CL=31227
2009-07-06 17:20:48 -07:00
Russ Cox
a7b4e9f03e new reflect type.go implementation
R=r
DELTA=179  (172 added, 6 deleted, 1 changed)
OCL=31215
CL=31220
2009-07-06 16:06:31 -07:00
Russ Cox
4793400bd1 new reflect library data structures and code declarations
* use structs instead of interfaces
  * compiler lays out data structures ahead of time,
    so no more parsing of strings.
  * unified reflect data structures with interface
    runtime data structures.
  * richer data structures should enable reflection
    on chans and maps, but not implemented here.

R=r,iant
DELTA=1179  (1179 added, 0 deleted, 0 changed)
OCL=31107
CL=31213
2009-07-06 15:34:04 -07:00
Robert Griesemer
4f40f5eaab - bug fix: do not strip lower-case parameter and result names in signatures
- display: show '...' if a struct/interface has fields/methods removed; show
  struct/interface w/o {}'s if all fields/methods were removed; and show the
  {}'s if the struct/interface was empty to begin with

R=rsc
DELTA=41  (36 added, 0 deleted, 5 changed)
OCL=31201
CL=31204
2009-07-06 11:39:48 -07:00
Rob Pike
d3a2925bb2 catch corruption - avoid crash
R=rsc
DELTA=4  (4 added, 0 deleted, 0 changed)
OCL=31192
CL=31198
2009-07-06 10:58:55 -07:00
Robert Griesemer
deb954772d - ast.FilterExports: strips all non-exported nodes from an AST
- use FilterExports instead of the various predicates in printer.go and doc.go
  which simplifies a lot of code and makes it easier to deal with complex cases

R=rsc
DELTA=445  (197 added, 190 deleted, 58 changed)
OCL=31110
CL=31196
2009-07-06 10:37:33 -07:00
David Symonds
c1edbe9a10 Remove assumption about google.com being the default search domain.
R=rsc
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31151
CL=31168
2009-07-05 15:00:11 -07:00
Rob Pike
3dab3e65d8 put gob into the standard build
R=rsc
DELTA=77  (76 added, 0 deleted, 1 changed)
OCL=31147
CL=31147
2009-07-03 12:54:59 -07:00
Kai Backman
84ded32817 sys.cas for mutex
R=rsc
APPROVED=rsc
DELTA=28  (28 added, 0 deleted, 0 changed)
OCL=31128
CL=31130
2009-07-02 22:05:06 -07:00
Russ Cox
29aa3ffbf6 move Structrnd to runtime.h
R=ken
OCL=31125
CL=31125
2009-07-02 21:25:46 -07:00
Rob Pike
265674fa57 slices
R=rsc
DELTA=59  (44 added, 13 deleted, 2 changed)
OCL=31105
CL=31105
2009-07-02 18:02:42 -07:00
Rob Pike
c1fc4c8f37 indirection on array elements.
R=rsc
DELTA=57  (34 added, 10 deleted, 13 changed)
OCL=31098
CL=31101
2009-07-02 17:21:48 -07:00
Russ Cox
b5666a123a add Uitoa etc.
R=r
DELTA=113  (89 added, 9 deleted, 15 changed)
OCL=31087
CL=31096
2009-07-02 16:57:46 -07:00
Rob Pike
0c33d4353e arrays, not slices, and only with non-pointer elements.
(actually slices encode but do not decode yet)

R=rsc
DELTA=221  (82 added, 65 deleted, 74 changed)
OCL=31095
CL=31095
2009-07-02 16:43:46 -07:00
Rob Pike
29e6eb21ec make a description of the slice header public
R=rsc
DELTA=18  (3 added, 0 deleted, 15 changed)
OCL=31086
CL=31094
2009-07-02 16:28:04 -07:00
Russ Cox
c7a9d9818a fix atoi test
R=r
DELTA=28  (5 added, 0 deleted, 23 changed)
OCL=31093
CL=31093
2009-07-02 16:24:44 -07:00
Robert Griesemer
b70563aa0a - store trailing comments after top-level declarations in ast
- remove a test case w/ syntax errors from test suite

R=rsc
DELTA=104  (44 added, 5 deleted, 55 changed)
OCL=31078
CL=31085
2009-07-02 15:38:36 -07:00
Rob Pike
77baac11e1 encode and decode for nested structures.
fix a bug in delta encoding: only update the delta-base if something is marshaled.

R=rsc
DELTA=154  (94 added, 56 deleted, 4 changed)
OCL=31069
CL=31071
2009-07-02 13:43:47 -07:00
Rob Pike
1ca1e1befa encoders and decoders for string, []uint8
R=rsc
DELTA=165  (145 added, 6 deleted, 14 changed)
OCL=31051
CL=31056
2009-07-02 11:21:01 -07:00
Rob Pike
22b93dfb5c now that we have a separate indirection test, simplify the scalar tests.
R=rsc
DELTA=562  (8 added, 424 deleted, 130 changed)
OCL=31039
CL=31045
2009-07-02 09:22:38 -07:00
Rob Pike
671f807e2e simplify decoders. error checking is done higher up.
if there is an error, we will write one more value into the struct but in return
we do fewer tests in the decode.

R=rsc
DELTA=56  (0 added, 42 deleted, 14 changed)
OCL=31041
CL=31044
2009-07-02 09:22:30 -07:00
Rob Pike
c0271c4bc2 fix bug in decoders: got indirection wrong when allocation not required.
write indirection test.

next step: cut down scalar tests since indirection is centralized.

R=rsc
DELTA=114  (83 added, 3 deleted, 28 changed)
OCL=31020
CL=31037
2009-07-02 08:21:42 -07:00
Rob Pike
b1e64585b6 move dereference code out of the ops and into the interpreter loops.
R=rsc
DELTA=574  (40 added, 149 deleted, 385 changed)
OCL=31017
CL=31019
2009-07-01 23:04:27 -07:00
Rob Pike
c701af8c80 Encode and decode engines for gobs.
R=rsc
DELTA=468  (292 added, 18 deleted, 158 changed)
OCL=31008
CL=31012
2009-07-01 18:25:13 -07:00
Russ Cox
a439f66228 add test, fix bug: structs that differ in their
first field were not being handled correctly
because the visited map did not include the type.

R=r
OCL=31006
CL=31006
2009-07-01 16:45:09 -07:00
Russ Cox
55e790a160 clean up some BUG/TODO in go code
R=r
DELTA=23  (1 added, 12 deleted, 10 changed)
OCL=30957
CL=30980
2009-07-01 07:32:04 -07:00
Russ Cox
20cfa4a568 change alignment rules: roll receiver into
input parameters, move output parameters
into their own struct.

R=ken
OCL=30954
CL=30966
2009-06-30 20:02:07 -07:00
Russ Cox
150a64572b remove declarations for functions that cannot be called from c
(because they return values in the input parameters).

R=iant
DELTA=12  (0 added, 11 deleted, 1 changed)
OCL=30952
CL=30965
2009-06-30 20:01:59 -07:00
Russ Cox
fa40c856ac convert string runtime to use cgo.
now that cgo2c can handle it,
merge x.c and x_go.cgo into
a single x.cgo, for x=float,malloc,sema.

R=r
DELTA=1950  (954 added, 996 deleted, 0 changed)
OCL=30951
CL=30964
2009-06-30 20:01:50 -07:00
Russ Cox
88e7fd5410 in preparation for changing 6g's behavior to
align the output args separately from the input args,
change cgo2c to insert the necessary padding
when the two arg lists are concatenated in the c
translation.

for example, there is a runtime

	func indexstring(s string, i int32) (b byte)

right now in 6g those arguments are aligned in one
struct with s at offset 0, i at 16, and b at 20.
soon the b byte will be in its own struct and structs
are 8 aligned, so it will be b at 24.

right now cgo2c generates:

	void indexstring(string s, int32 i, byte b)

this CL makes it generate, in --6g mode:

	void indexstring(string s, int32 i, uint32, byte b)

this is valid 6c input, although not valid gcc input.
(the code is being generated for 6c only anyway.)

also, allow C code to be mixed in among the Go funcs.
every instance of the token `func' is expected to start
a new go func.

R=iant
DELTA=145  (118 added, 0 deleted, 27 changed)
OCL=30949
CL=30963
2009-06-30 20:01:41 -07:00
Rob Pike
b968943332 scalar decoders
R=rsc
DELTA=897  (728 added, 14 deleted, 155 changed)
OCL=30955
CL=30955
2009-06-30 17:59:41 -07:00
Rob Pike
79b2cf92d9 pass the state to the encoders and decoders so error handling can be centralized.
R=rsc
DELTA=172  (40 added, 6 deleted, 126 changed)
OCL=30941
CL=30944
2009-06-30 16:20:31 -07:00
Rob Pike
f6f825141a encoders for booleans and numbers.
R=rsc
DELTA=610  (597 added, 5 deleted, 8 changed)
OCL=30934
CL=30939
2009-06-30 15:37:46 -07:00
Russ Cox
832e72beff delete io.ByteBuffer
R=r
DELTA=25  (0 added, 15 deleted, 10 changed)
OCL=30892
CL=30892
2009-06-29 20:53:05 -07:00
Russ Cox
5d5904bb4d bug163 bug164 bug166
R=ken
OCL=30889
CL=30889
2009-06-29 17:46:22 -07:00
Russ Cox
d3a412a5ab io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer

left io.ByteBuffer stub around for now,
for protocol compiler.

R=r
OCL=30861
CL=30872
2009-06-29 15:24:23 -07:00
Rob Pike
b948c437a1 integer encode/decode
R=rsc
DELTA=185  (175 added, 10 deleted, 0 changed)
OCL=30863
CL=30871
2009-06-29 15:15:07 -07:00
Russ Cox
8f9a953760 make use of forward method declaration
R=r
DELTA=11  (0 added, 6 deleted, 5 changed)
OCL=30862
CL=30870
2009-06-29 15:13:56 -07:00
Russ Cox
b32769b1a3 add os.Hostname
R=r
DELTA=188  (182 added, 3 deleted, 3 changed)
OCL=30856
CL=30860
2009-06-29 13:44:46 -07:00
Rob Pike
2b08372710 add []byte as a special case: it will have a special, efficient encoding.
R=rsc
DELTA=16  (9 added, 1 deleted, 6 changed)
OCL=30846
CL=30846
2009-06-29 11:29:47 -07:00
Rob Pike
d330c712c1 Getenv: almost no one wants the error, so make it return a string that may be empty.
Getenverror is the new name for the old routine that returns an error too.

R=rsc
DELTA=35  (7 added, 7 deleted, 21 changed)
OCL=30818
CL=30821
2009-06-26 20:28:41 -07:00
Rob Pike
ac7f2152eb the first time a structure type appears when printing, identify it by name:
type Foo struct { a int; next *Foo }
produces
	"Foo = struct { a int; next Foo }"

R=rsc
OCL=30797
CL=30820
2009-06-26 20:28:06 -07:00
Rob Pike
7986de6e51 gobs part 1: types.
not ready to be part of the standard build yet; this is just a checkpoint.

R=rsc
DELTA=361  (361 added, 0 deleted, 0 changed)
OCL=30782
CL=30785
2009-06-25 22:08:51 -07:00
David Symonds
a2a827542a http Request parsing, plus a convenient accessor.
R=rsc
APPROVED=rsc
DELTA=95  (40 added, 14 deleted, 41 changed)
OCL=30727
CL=30784
2009-06-25 21:05:44 -07:00
Russ Cox
a0bcaf4c00 Change os.Error convention:
echo back context of call in error if likely to be useful.

For example, if os.Open("/etc/passwd", os.O_RDONLY)
fails with syscall.EPERM, it returns as the os.Error

	&PathError{
		Op: "open",
		Path: "/etc/passwd"
		Error: os.EPERM
	}

which formats as

	open /etc/passwd: permission denied

Not converted:

	datafmt
	go/...
	google/...
	regexp
	tabwriter
	template

R=r
DELTA=1153  (561 added, 156 deleted, 436 changed)
OCL=30738
CL=30781
2009-06-25 20:24:55 -07:00
Russ Cox
ae11e9eb88 fix build
TBR=r
OCL=30757
CL=30757
2009-06-25 15:15:44 -07:00
Russ Cox
4866223c2e add reflect.Typeof; test for and fix nil interface bug in DeepEqual
R=r
DELTA=40  (30 added, 2 deleted, 8 changed)
OCL=30742
CL=30753
2009-06-25 14:25:38 -07:00
Russ Cox
6af5775d74 dreg
R=r
DELTA=19  (0 added, 19 deleted, 0 changed)
OCL=30739
CL=30751
2009-06-25 14:25:11 -07:00
Kai Backman
111005d32b Add Gobuf.r0 that stores arg0 or return value of
goroutine. arm only.

R=rsc
APPROVED=rsc
DELTA=5  (3 added, 2 deleted, 0 changed)
OCL=30644
CL=30746
2009-06-25 11:26:10 -07:00
Russ Cox
a50cbf6c73 style police: parens in if, for, switch, range
R=r
DELTA=32  (0 added, 3 deleted, 29 changed)
OCL=30718
CL=30725
2009-06-24 20:12:50 -07:00
David Symonds
30533d607a Change strings.Split, bytes.Split to take a maximum substring count argument.
R=rsc
APPROVED=r
DELTA=131  (39 added, 10 deleted, 82 changed)
OCL=30669
CL=30723
2009-06-24 19:02:29 -07:00
Russ Cox
2ce8b444b9 base64: cut out some middle layers
R=austin
DELTA=352  (67 added, 196 deleted, 89 changed)
OCL=30694
CL=30713
2009-06-24 15:52:31 -07:00
Russ Cox
a1646fd50e make bytes.Copy both src- and dst- limited
and return the number of bytes copied.

R=r
DELTA=18  (6 added, 0 deleted, 12 changed)
OCL=30693
CL=30712
2009-06-24 15:35:35 -07:00
Austin Clements
c3a087a088 Base64 encoder/decoder package.
R=rsc
APPROVED=rsc
DELTA=722  (722 added, 0 deleted, 0 changed)
OCL=30660
CL=30691
2009-06-24 11:09:43 -07:00
David Symonds
e6ff6c8e56 Fix http client handling of status messages with spaces (e.g. "HTTP/1.1 400 Bad
Request".
Use chunked Transfer-Encoding for all POSTs.
Implement chunked reading.
Change http.Request.write to be HTTP/1.1 only.

R=rsc
APPROVED=rsc
DELTA=178  (123 added, 26 deleted, 29 changed)
OCL=30563
CL=30673
2009-06-23 18:49:47 -07:00
Russ Cox
0d77947a3e publish strconv.UnquoteChar
R=r
DELTA=69  (37 added, 3 deleted, 29 changed)
OCL=30661
CL=30667
2009-06-23 16:44:01 -07:00
Rob Pike
5766553380 fix io.Bytebuffer.Read for new EOF semantics
R=rsc
DELTA=7  (5 added, 0 deleted, 2 changed)
OCL=30657
CL=30659
2009-06-23 15:20:40 -07:00
Rob Pike
28ba9777e6 rename Formatter to State and Format to Formatter, for nomenclatural consistency
R=rsc
DELTA=9  (0 added, 0 deleted, 9 changed)
OCL=30658
CL=30658
2009-06-23 15:20:30 -07:00
Kai Backman
be639b9a51 Runtime is now starting up with a dummy c program as target:
- morestack and gosave/gogo/gocall support
- memclr and memset from inferno
- bugfixes in _rt0_arm

R=rsc
APPROVED=rsc
DELTA=304  (174 added, 36 deleted, 94 changed)
OCL=30636
CL=30642
2009-06-23 11:54:23 -07:00
Rob Pike
b6ce2a72e1 document the verbs for Printf
R=rsc
DELTA=61  (48 added, 0 deleted, 13 changed)
OCL=30616
CL=30619
2009-06-22 18:09:40 -07:00
David Symonds
343bfcfca7 Don't prefix Url.Path with a slash in Request.write,
because Url.Path already starts with one.
Avoid crashing in Request.ParseForm if there is no body.

R=rsc
APPROVED=rsc
DELTA=5  (4 added, 0 deleted, 1 changed)
OCL=30552
CL=30607
2009-06-22 14:50:12 -07:00
Russ Cox
71f19d66d4 document requirements on Write method
R=r
DELTA=7  (6 added, 0 deleted, 1 changed)
OCL=30596
CL=30605
2009-06-22 14:44:07 -07:00
Rob Pike
8d343e2d49 a couple of cosmetic tweaks.
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=30599
CL=30602
2009-06-22 14:26:07 -07:00
Kai Backman
d281748a6d add arm support to mkasmh
R=rsc
APPROVED=rsc
DELTA=5  (5 added, 0 deleted, 0 changed)
OCL=30587
CL=30595
2009-06-22 14:08:00 -07:00
Russ Cox
da5abb9fb3 changes required if we disallow the implicit *
in cap, len, [], and range on maps, strings, and slices.

R=r
DELTA=57  (2 added, 12 deleted, 43 changed)
OCL=30549
CL=30590
2009-06-22 13:34:21 -07:00
Russ Cox
64684cc2a2 introduce os.EOF and io.ErrUnexpectedEOF.
remove io.ErrEOF.
rename io.FullRead to io.ReadFull, to match
   ReadAtLeast and ReadAll.
remove io.FullReader, because it is now unused.

R=r
DELTA=295  (88 added, 105 deleted, 102 changed)
OCL=30544
CL=30588
2009-06-22 13:26:13 -07:00
David Symonds
022ee0c26f Add form body parsing to http.Request.
better error handling throughout.

R=r,rsc
APPROVED=r
DELTA=254  (201 added, 3 deleted, 50 changed)
OCL=30515
CL=30545
2009-06-19 18:02:15 -07:00
Rob Pike
2805eb9a5e fix build
R=rsc
OCL=30542
CL=30542
2009-06-19 16:45:04 -07:00
Scott Schwartz
08aab44e48 Add ReadByte to bytebuffer
R=rsc
APPROVED=rsc
DELTA=24  (24 added, 0 deleted, 0 changed)
OCL=30459
CL=30540
2009-06-19 16:29:30 -07:00
Rob Pike
efc4088ccd make IP address available
R=rsc
DELTA=30  (30 added, 0 deleted, 0 changed)
OCL=30536
CL=30536
2009-06-19 16:03:59 -07:00
Steve Newman
a6c7a80b5b Add a ReplaceAll method to Regexp.
APPROVED=r,rsc
DELTA=189  (187 added, 0 deleted, 2 changed)
OCL=30205
CL=30517
2009-06-18 17:55:47 -07:00
Robert Griesemer
1b9734b995 1) Fix a problem with tabwriter.Flush: any pending text not yet
in a cell makes a final cell in that line
   (this showed up as occasionally missing single spaces in
   godoc-formatted declarations that fit on a single line)

2) Cleaned up tabwriter implementation a bit:
   - replaced local unicodeLen() with utf8.RuneCount()
   - instead of having 2 parallel arrays for line widths and sizes,
     have a single array of cells containing a width and size
   - factored code a bit better
   - added more comments
   - added testnames to tabwriter tests
   - added more test cases and fixed a broken test case that
     now works correctly

R=r
DELTA=279  (133 added, 62 deleted, 84 changed)
OCL=30509
CL=30514
2009-06-18 17:06:08 -07:00
Robert Griesemer
5eb5d4d3c0 `` strings may span multiple lines
R=rsc
DELTA=3  (2 added, 0 deleted, 1 changed)
OCL=30511
CL=30513
2009-06-18 17:04:39 -07:00
Russ Cox
ab7a8d43a4 make pkg/runtime/Makefile behave like the others:
make builds; make install installs.

R=r
DELTA=2  (2 added, 0 deleted, 0 changed)
OCL=30489
CL=30491
2009-06-18 13:33:28 -07:00
Russ Cox
5d2ee9d90a add Addr() string to net.Listener interface.
use it to avoid use of fixed ports in tests.
convert google/net/rpc to gotest

R=r
DELTA=523  (275 added, 229 deleted, 19 changed)
OCL=30458
CL=30460
2009-06-17 21:44:26 -07:00
Russ Cox
f39fcd7e42 fix 386 build.
some day...

TBR=r
OCL=30453
CL=30453
2009-06-17 16:34:13 -07:00
Russ Cox
380200953a Forgot to check in 386/asm.h.
Rather than do that, fix build by
generating asm.h automatically.

R=r
DELTA=97  (48 added, 36 deleted, 13 changed)
OCL=30449
CL=30452
2009-06-17 16:31:02 -07:00
Russ Cox
da5e962e49 shuffle some Linux system calls around for 386
R=r
DELTA=37  (17 added, 15 deleted, 5 changed)
OCL=30428
CL=30444
2009-06-17 15:16:06 -07:00
Russ Cox
8522a478bb update 386 to new runtime (CL 30381)
R=r
DELTA=298  (119 added, 81 deleted, 98 changed)
OCL=30427
CL=30443
2009-06-17 15:15:55 -07:00
Russ Cox
7343e03c43 runtime: stack growth adjustments, cleanup
* keep coherent SP/PC in gobuf
	  (i.e., SP that would be in use at that PC)
	* gogocall replaces setspgoto,
	  should work better in presence of link registers
	* delete unused system calls

only amd64; 386 is now broken

R=r
DELTA=548  (183 added, 183 deleted, 182 changed)
OCL=30381
CL=30442
2009-06-17 15:12:16 -07:00
Russ Cox
76c87d58cd 386 system call fixes:
* use 64-bit file system calls (Linux, Darwin)
  * use 32-bit [sic] uid/gid calls (Linux)
  * fix sockets on Linux

Darwin/386 works again.

Linux/386 is better but must never have worked;
there are still bugs surrounding the creation of new
threads in the runtime package.

R=austin
DELTA=1332  (673 added, 614 deleted, 45 changed)
OCL=30327
CL=30380
2009-06-16 17:17:02 -07:00
Robert Griesemer
cb897436eb fix nesting level for parameters
R=rsc
DELTA=8  (4 added, 2 deleted, 2 changed)
OCL=30365
CL=30368
2009-06-16 14:39:19 -07:00
Robert Griesemer
4c8fe766af - some fine-tuning of godoc templates per r's suggestion
- removed gratuitous newline in go/printer

R=r
DELTA=15  (2 added, 13 deleted, 0 changed)
OCL=30358
CL=30358
2009-06-16 13:44:15 -07:00
Jacob Baskin
536c2aa6ae URL should have an empty Scheme if there is an invalid character (i.e.
not [a-zA-Z0-9+-.]) before there is a ":".

This is particularly helpful in the erroneous-but-relatively-common
case of relative URLs containing an unescaped colon in the query
string--see the added test for an example.

R=rsc
APPROVED=rsc
DELTA=15  (15 added, 0 deleted, 0 changed)
OCL=30354
CL=30356
2009-06-16 13:23:42 -07:00
Kai Backman
1ac2cfc720 grab bag of changes aimed at getting stack splitting to work:
- morestack support for 5l and arm runtime
- argsize support in 5c, 5l, ar and nm. assembly code from 5a
  will break in interesting ways unless NOSPLIT is specified
- explicit cond execution constants
- fix 5l output to use %d instead of %ld so that negative
  values show.
- added a lot of code to arm/asm.s. runtime entry code almost
  working currently aborts at gogo not implemented

R=rsc
APPROVED=rsc
DELTA=305  (125 added, 29 deleted, 151 changed)
OCL=30246
CL=30347
2009-06-16 11:25:58 -07:00
Russ Cox
8c357ce269 fix another gc bug, one that i have only imagined,
not observed: do not use malloc to allocate stacks
during garbage collection, because it would make the
malloc data structures change underfoot.

R=r
DELTA=6  (3 added, 0 deleted, 3 changed)
OCL=30323
CL=30326
2009-06-15 21:31:56 -07:00
Russ Cox
36835c7a47 fix garbage collection race: save stack trace
when changing process state to Gsyscall, not after.

R=r
DELTA=8  (4 added, 3 deleted, 1 changed)
OCL=30320
CL=30325
2009-06-15 21:30:53 -07:00
David Symonds
d4e57ff248 Fix a proto encoding crasher whereby a nil in a repeated group field would crash the server.
Also fix the reflect bug that was exposed by this bug.

R=r
APPROVED=rsc
DELTA=162  (103 added, 32 deleted, 27 changed)
OCL=30125
CL=30319
2009-06-15 18:35:04 -07:00
Robert Griesemer
a893db8767 gofmt (final resting place TBD):
- replacement for pretty; app to format a single .go file

printer.go (pkg/go/printer):
- replacement for astprinter.go; implements AST printing
- also replaces pkg/go/ast/format.go for now

cleanups:
- removed/saved away old code

R=r,rsc,iant
DELTA=2833  (1183 added, 1628 deleted, 22 changed)
OCL=30226
CL=30306
2009-06-15 16:23:16 -07:00
Robert Griesemer
c2faeac8c4 fixed typo (slipped in with previous submit)
TBR=rsc
OCL=30300
CL=30300
2009-06-15 15:47:15 -07:00
Robert Griesemer
4a50434a36 Support for line comments trailing a field or declaration:
- ast: added extra fields
- parser: extended comment parsing to capture potential trailing comments

Cleanups:
- parser: more documentation, changed various identifiers from _-style to camelCase

R=r,rsc
DELTA=214  (84 added, 13 deleted, 117 changed)
OCL=30259
CL=30299
2009-06-15 15:43:11 -07:00
Robert Griesemer
be87e33b1f removed bogus if-statement
R=iant
DELTA=3  (0 added, 3 deleted, 0 changed)
OCL=30251
CL=30251
2009-06-12 15:17:39 -07:00
David Symonds
cbd0092173 Switch http client_test to use google.com/robots.txt to avoid redirect loop.
www.google.com seems to be redirecting requests in an infinite loop. I haven't tracked down whether it's their code or this code that is causing it. This is just a quick fix so that this test passes.

APPROVED=r
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=30178
CL=30210
2009-06-11 15:55:03 -07:00
David Symonds
61d6ad3178 Add support for the basic extension done by Schilling's star.
Compute checksums in both ways (unsigned and signed).

R=rsc
APPROVED=rsc
DELTA=188  (145 added, 21 deleted, 22 changed)
OCL=30126
CL=30179
2009-06-10 21:32:36 -07:00
Robert Griesemer
7fd9cfd0cc - parser bug: return keyword may be followed by case or default keyword as well
- fixed unrelated typo

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=30175
CL=30175
2009-06-10 15:40:19 -07:00
Kai Backman
528919520d Adding a batch of missing system calls.
R=rsc
APPROVED=rsc
DELTA=1329  (1264 added, 1 deleted, 64 changed)
OCL=30040
CL=30158
2009-06-10 11:53:07 -07:00
Steve Newman
f315fb3d56 Basic HTTP client.
R=rsc
APPROVED=rsc
DELTA=392  (386 added, 2 deleted, 4 changed)
OCL=29963
CL=30107
2009-06-09 10:58:58 -07:00
Russ Cox
c4aa021733 bring over deps.bash
TBR=r
OCL=30106
CL=30106
2009-06-09 10:47:13 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -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
Russ Cox
76036192b9 make Makefiles safe for parallel make
use -j4 (4-way parallel) in make.bash.

halves time for make.bash on r45

also add libregexp, acid to default build

R=r
DELTA=90  (39 added, 37 deleted, 14 changed)
OCL=15485
CL=15487
2008-09-18 15:06:43 -07:00
Robert Griesemer
0ba1db7475 - fixed missing return issues
R=r
OCL=15168
CL=15168
2008-09-11 15:38:22 -07:00
Robert Griesemer
683ded80c9 - changed go-in-go parser to require ()'s for panic and print
- adjusted much of the existing go code
- missing: tests

R=r
DELTA=229  (1 added, 17 deleted, 211 changed)
OCL=14103
CL=14103
2008-08-11 21:20:42 -07:00
Robert Griesemer
2f4352a26d - switched most of existing Go code to new export syntax
- adjusted lang doc

R=r
DELTA=192  (26 added, 65 deleted, 101 changed)
OCL=13844
CL=13848
2008-08-04 17:17:59 -07:00
Robert Griesemer
553771314c - moved integer code into src/pkg
SVN=125003
2008-06-26 16:52:15 -07:00
Brian Kernighan
d82b11e4a4 last-minute fix: convert to ANSI C
R=dmr
DELTA=3  (2 added, 0 deleted, 1 changed)
1988-04-01 02:03:04 -05:00
Brian Kernighan
0744ac9691 convert to Draft-Proposed ANSI C
R=dmr
DELTA=5  (2 added, 0 deleted, 3 changed)
1988-04-01 02:02:04 -05:00
Brian Kernighan
0bb0b61d6a convert to C
R=dmr
DELTA=6  (0 added, 3 deleted, 3 changed)
1974-01-20 01:02:03 -04:00
Brian Kernighan
7d7c6a97f8 hello, world
R=ken
DELTA=7  (7 added, 0 deleted, 0 changed)
1972-07-18 19:05:45 -05:00