1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:50:22 -07:00
Commit Graph

1842 Commits

Author SHA1 Message Date
Russ Cox
5958dd6f94 Suggested tweaks up to package section.
Major ones:
* Be consistent: "numeric type" and "arithmetic operator".
* if/swtch take "simple statement" not "short variable declaration".
* There was a comment that implied for x,y := range z() might
  evaluate z() multiple times.  I deleted it.

R=r,gri
DELTA=124  (24 added, 4 deleted, 96 changed)
OCL=25706
CL=25715
2009-03-04 17:19:21 -08:00
Robert Griesemer
bd4f5af107 - missing makefile
R=r
OCL=25714
CL=25714
2009-03-04 17:16:58 -08:00
Robert Griesemer
b4802dd568 Created new directory lib/lang:
- move scanner to into lib/lang
- added test
- adjusted various make and build files

R=r
DELTA=1731  (973 added, 753 deleted, 5 changed)
OCL=25668
CL=25713
2009-03-04 17:13:12 -08:00
Russ Cox
955638e2fb disallow ordinary-type.(T), as in spec.
R=ken
OCL=25705
CL=25705
2009-03-04 14:50:25 -08:00
Russ Cox
461dd9126c change Go logo to link to home page
fix grammar for forward declaration of interface, struct.

move array down next to slice.

fix type equal example for structs.

R=r,gri
DELTA=247  (122 added, 114 deleted, 11 changed)
OCL=25694
CL=25704
2009-03-04 14:44:51 -08:00
Robert Griesemer
77567265a8 Preparation for moving scanner into a lib:
- separated out token definition from scanner
- cleaned up token and scanner implementation
- added comments to exported interfaces

R=r
OCL=25665
CL=25665
2009-03-03 18:25:07 -08:00
Rob Pike
337ce2220f rephrase redundancy.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25652
CL=25656
2009-03-03 16:10:15 -08:00
Rob Pike
e8e894bff3 enable pretty in run.bash
R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=25651
CL=25655
2009-03-03 16:09:40 -08:00
Rob Pike
5ef8e1d47e update missed test case to {}
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25648
CL=25654
2009-03-03 16:09:12 -08:00
Robert Griesemer
63b332eddd - allow ()'s and {}'s for now when parsing calls/composite literals
- require ()'s around composite literals at the if/for/switch control clause level
- fixed a nasty bug: passing a value instead of a pointer to a value to an interface
  variable - and not noticing that the value is copied

R=r
OCL=25649
CL=25649
2009-03-03 16:00:06 -08:00
Russ Cox
7a5e97ba91 The final piece of the alternative to my parens proposal
(i.e., the status quo with braces in composite literals).

DELTA=20  (16 added, 0 deleted, 4 changed)
OCL=25640
CL=25646
2009-03-03 15:40:30 -08:00
Russ Cox
49cc649e59 back to T{x}, stricter handling of T(x) vs x.(T)
R=ken
DELTA=131  (60 added, 41 deleted, 30 changed)
OCL=25617
CL=25633
2009-03-03 08:41:02 -08:00
Russ Cox
be2edb5761 Automated g4 rollback of changelist 25024,
plus significant hand editing.

Back to T{x} for composite literals.

R=r
OCL=25612
CL=25632
2009-03-03 08:39:12 -08:00
Russ Cox
e8b43190bb clarify conversions vs type guards.
allow conversions between equal types.

R=r
DELTA=15  (4 added, 4 deleted, 7 changed)
OCL=25618
CL=25630
2009-03-03 08:10:25 -08:00
Robert Griesemer
d169268a1a scanner cleanup - getting it ready to as a library
- removed unneeded code that accumulated over time
- change src from string to []byte (perhaps should be io.Read
but that has some other disadvantages)
- simplified interface

R=r
OCL=25615
CL=25615
2009-03-02 20:27:09 -08:00
Rob Pike
da34bea950 redo poor example of slices.
R=rsc
OCL=25614
CL=25614
2009-03-02 20:17:12 -08:00
Rob Pike
da38974c88 address most of the editorial comments through "types"
R=rsc
DELTA=41  (9 added, 4 deleted, 28 changed)
OCL=25611
CL=25611
2009-03-02 19:13:40 -08:00
Robert Griesemer
ea3d4540b3 - itob
- more test cases

R=rsc
DELTA=97  (52 added, 4 deleted, 41 changed)
OCL=25585
CL=25607
2009-03-02 17:52:58 -08:00
Rob Pike
426335f87b delete paragraph about unimplemented select-on-type feature.
change () to {} in all composite literals

DELTA=20  (0 added, 7 deleted, 13 changed)
OCL=25604
CL=25606
2009-03-02 17:52:52 -08:00
Rob Pike
4659685b8f Packages.
DELTA=170  (73 added, 21 deleted, 76 changed)
OCL=25556
CL=25594
2009-03-02 16:17:29 -08:00
Russ Cox
e9b40580ba fix names: s/fd/r/
R=r
DELTA=9  (0 added, 0 deleted, 9 changed)
OCL=25593
CL=25593
2009-03-02 16:12:04 -08:00
Rob Pike
96750f130c most of the rest.
only the package section is untouched.

R=gri
DELTA=542  (186 added, 70 deleted, 286 changed)
OCL=25485
CL=25532
2009-02-27 16:47:48 -08:00
Robert Griesemer
fadf159a81 fix a bug: do not print a ';' after a label if there wasn't one
R=r
OCL=25526
CL=25528
2009-02-27 16:28:36 -08:00
Robert Griesemer
3689e221e8 Steps towards a general scanner/parser library for Go:
- converted more of AST and parser to use interfaces and explicit
structs for individual Go constructs (can be replaced now with
interface calls such that the parser becomes AST structure
independent, as suggested by rsc)
- added more tests (find all .go files under GOROOT)
- (temporarily) lost html links for identifiers when generating
html output
- TODO: lots of cleanups

R=r
OCL=25518
CL=25518
2009-02-27 15:40:17 -08:00
Rob Pike
df3183f528 finish types.
expressions.  (they were in pretty good shape; mostly cosmetic and HTML edits)

R=gri
DELTA=655  (226 added, 97 deleted, 332 changed)
OCL=25459
CL=25481
2009-02-26 16:37:23 -08:00
Robert Griesemer
f88c6c136c fixed a typo
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25449
CL=25449
2009-02-25 16:58:57 -08:00
Rob Pike
88b1f8594a bug130 is fixed
R=ken
OCL=25448
CL=25448
2009-02-25 16:31:42 -08:00
Rob Pike
8f2330dd7a Continue editing types section.
Do a little work polishing the "zero value" discussion.

R=gri
DELTA=486  (129 added, 120 deleted, 237 changed)
OCL=25392
CL=25444
2009-02-25 16:20:44 -08:00
Rob Pike
cdbf619750 complete types
R=gri
DELTA=29  (0 added, 12 deleted, 17 changed)
OCL=25388
CL=25391
2009-02-24 17:47:45 -08:00
Rob Pike
a49305df1d text and formatting are now folded into go_spec; delete
OCL=25292
CL=25383
2009-02-24 15:18:21 -08:00
Rob Pike
5af7de3fe3 Updated the section on Types.
Moved assignment compatibility to its own small section. Although most rules are type-specific,
some are not and it reduces redundancy to combine them.
Also, more experimentally, wrote a section on comparison compatibility.

R=gri
DELTA=382  (125 added, 122 deleted, 135 changed)
OCL=25355
CL=25382
2009-02-24 15:17:59 -08:00
Ken Thompson
751d13cbce bug 130 (go/defer) interface.method()
R=r
OCL=25356
CL=25356
2009-02-23 22:43:04 -08:00
Rob Pike
a9ed30ff37 Move Types before Declarations and Scopes.
This is the only change in this CL: only rearrangement, no content change, so subsequent edits will be easier to understand.

R=gri
OCL=25353
CL=25353
2009-02-23 19:26:07 -08:00
Rob Pike
f27e9f072d Work on declarations, unsafe, alignment.
Change <tt> to <code>

R=gri
DELTA=664  (222 added, 189 deleted, 253 changed)
OCL=25294
CL=25352
2009-02-23 19:22:05 -08:00
Robert Griesemer
6ddc48b84a - fixed a bug with //-comment parsing
R=r
OCL=25343
CL=25343
2009-02-23 17:16:55 -08:00
Rob Pike
ce2bc3aabc add logo to documentation directory.
R=rsc
OCL=25293
CL=25293
2009-02-22 15:39:50 -08:00
Ken Thompson
a665e2924c bug with select :=
R=r
OCL=25278
CL=25278
2009-02-21 12:41:34 -08:00
Russ Cox
82c38cf8dd draft of memory model.
R=tgs
DELTA=545  (545 added, 0 deleted, 0 changed)
OCL=25212
CL=25268
2009-02-20 15:35:20 -08:00
Rob Pike
ff70f09d27 Rewrite lexical section.
Put grammar productions into a box with a separate background color.

R=gri
DELTA=397  (132 added, 49 deleted, 216 changed)
OCL=25235
CL=25258
2009-02-20 13:36:14 -08:00
Rob Pike
fd1f3830c1 autogenerate the table of contents
R=rsc
DELTA=149  (1 added, 145 deleted, 3 changed)
OCL=25231
CL=25234
2009-02-19 19:49:56 -08:00
Rob Pike
4501d348e8 Fix most HTML errors.
Cut introduction.
Start rewrite.

R=gri
DELTA=201  (20 added, 118 deleted, 63 changed)
OCL=25226
CL=25229
2009-02-19 17:31:36 -08:00
Robert Griesemer
c2d5586c76 go_spec.txt formatted in html.
No textual changes except for html formatting.
Seems like a fine intermediate step.

R=r
DELTA=7638  (4079 added, 3559 deleted, 0 changed)
OCL=25211
CL=25224
2009-02-19 16:49:10 -08:00
Robert Griesemer
4137f02bb7 - permit ()'s in types (TODO: update spec)
- accept embedded interfaces in interfaces
- missing: output incorrect, but at least all source code is accepted again

R=r
OCL=25223
CL=25223
2009-02-19 16:47:58 -08:00
Rob Pike
3d50b1e0e8 Finish the lexical section.
DELTA=176  (172 added, 0 deleted, 4 changed)
OCL=25182
CL=25222
2009-02-19 16:20:00 -08:00
Rob Pike
d1107adb52 First piece of Go reference manual.
R=ken,gri,rsc
DELTA=185  (185 added, 0 deleted, 0 changed)
OCL=25133
CL=25169
2009-02-18 15:39:51 -08:00
Russ Cox
ebc10db3e1 allow parens to disambiguate types.
examples:

	chan <- (chan int)
	chan (<- chan int)
	(map[string]func())("a": main)

R=ken
OCL=25151
CL=25151
2009-02-18 10:07:46 -08:00
Rob Pike
6950491b4f drop trailing slashes - missed comment from last review
TBR=rsc
OCL=25135
CL=25135
2009-02-17 19:59:23 -08:00
Rob Pike
03d6909ff7 more fun with triv.go: flags and arguments
R=rsc
DELTA=23  (23 added, 0 deleted, 0 changed)
OCL=25088
CL=25134
2009-02-17 19:35:01 -08:00
Russ Cox
d0424faf17 few more Sizeof.
R=r
DELTA=3  (0 added, 1 deleted, 2 changed)
OCL=25106
CL=25106
2009-02-17 13:40:28 -08:00
Ken Thompson
3c0fc400fb fix unsafe.Sizeof("abc")
R=rsc
OCL=25105
CL=25105
2009-02-17 13:10:57 -08:00