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

285 Commits

Author SHA1 Message Date
Nigel Tao
b5a480f035 image: add image.Tiled type, the Go equivalent of Plan9's repl bit.
Make ColorImage methods' receiver type be a pointer.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2345043
2010-10-12 13:44:11 +11:00
Russ Cox
e6ecf9765a exp/iterable: delete
Package iterable has outlived its utility.

It is an interesting demonstration, but it encourages
people to use iteration over channels where simple
iteration over array indices or a linked list would be
cheaper, simpler, and have fewer races.

R=dsymonds, r
CC=golang-dev
https://golang.org/cl/2436041
2010-10-11 22:38:42 -04:00
Nigel Tao
fd311cb144 exp/draw/x11: support X11 vendors other than "The X.Org Foundation".
R=adg, ehog.hedge
CC=golang-dev
https://golang.org/cl/2385041
2010-10-09 11:22:14 +11:00
Russ Cox
2ee420fa5e ... changes
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04:00
Nigel Tao
099d7b4d1d exp/draw: remove "this isn't ready yet" comments.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2248046
2010-09-24 12:15:49 +10:00
Russ Cox
052cd29dd6 nacl: update instructions for new SDK
R=nigeltao_gnome, nigeltao
CC=golang-dev
https://golang.org/cl/2253042
2010-09-23 22:05:20 -04:00
Nigel Tao
d181625b9c exp/spacewar: fix build.
R=rsc
CC=golang-dev
https://golang.org/cl/2265042
2010-09-24 11:07:52 +10:00
Nigel Tao
58795ea31a exp/4s, exp/nacl/av: sync to recent exp/draw changes.
R=rsc
CC=golang-dev
https://golang.org/cl/2257042
2010-09-22 12:20:56 +10:00
Nigel Tao
bd77a889e6 exp/nacl/av: update color to max out at 1<<16-1 instead of 1<<32-1.
Fix missing return in Set(x, y, color).

R=r
CC=golang-dev
https://golang.org/cl/2256042
2010-09-21 16:13:19 +10:00
Nigel Tao
afbee9d87d exp/draw/x11: mouse location is a signed integer.
R=r
CC=golang-dev
https://golang.org/cl/2192043
2010-09-20 10:18:09 +10:00
Sebastien Binet
caf3b4a749 Preliminary support for 'copy' builtin function in exp/eval
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2157042
2010-09-14 17:25:34 +10:00
Nigel Tao
5801928817 exp/draw: fast path for drawing overlapping image.RGBAs.
R=r, nigeltao
CC=golang-dev
https://golang.org/cl/2145045
2010-09-10 20:09:56 +10:00
Nigel Tao
d660d4a6d0 exp/draw: fix double-counting of pt.Min for the src and mask points.
The min is typically zero, which is why this hasn't bitten us yet.

R=r
CC=golang-dev
https://golang.org/cl/2119048
2010-09-10 19:48:27 +10:00
Nigel Tao
2deee2936c exp/draw: clip destination rectangle to the image bounds.
image: introduce Intersect and Union rectangle methods.

R=r, rog, nigeltao
CC=golang-dev
https://golang.org/cl/2115043
2010-09-09 19:12:54 +10:00
Nigel Tao
6c8b85273c exp/draw: rename Context to Window, and add a Close method.
exp/draw/x11: allow clean shutdown when the user closes the window.

R=r
CC=golang-dev
https://golang.org/cl/2134045
2010-09-09 18:06:59 +10:00
Nigel Tao
fa92b113b1 exp/draw: reintroduce the MouseEvent.Nsec timestamp.
R=rsc
CC=golang-dev
https://golang.org/cl/2166042
2010-09-07 23:42:01 +10:00
Nigel Tao
c849b23ce9 exp/draw: unify a draw.Context's keyboard, mouse, etc. channels into a
single event channel.

A quit event is now represented by closing that channel.

R=r, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/2114042
2010-09-06 19:22:49 +10:00
Robert Griesemer
a37e3697da exp/iterables: fix typo
Fixes #1069.

R=rsc
CC=golang-dev
https://golang.org/cl/2143041
2010-09-02 11:31:00 -07:00
Ian Lance Taylor
7a2daa7d3a proc, eval: Don't assign address of an array to a slice.
R=rsc
CC=golang-dev
https://golang.org/cl/2084041
2010-08-30 13:47:40 -07:00
Christian Himpel
5c603dbb75 build: remove unnecessary references to GOBIN and GOROOT
All scripts and makefiles assume that GOBIN is correctly set
in PATH.

R=rsc
CC=golang-dev
https://golang.org/cl/2043041
2010-08-30 15:40:56 -04:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Robert Griesemer
1f9dfa294f go AST: First step towards augmenting AST with full type information.
- change ast.Ident back to contain the name and adjust all dependent code
- identifier object information will be added again through an optional
  typechecker phase (in the works).
- remove tracking of scopes in parser - it's easier to do this in a separate
  phase (in the works)
- in godoc, generate popup info table directly instead of through a formatter
  for simpler data flow (at the expense of a little bit more code)

Runs all tests.

As a result of this change, the currently shown popup information
(const, var, type, func, followed by identifier name) will not be
shown anymore temporarily.

R=rsc
CC=golang-dev
https://golang.org/cl/1994041
2010-08-13 10:42:18 -07:00
Russ Cox
1d77ff5b6b 6g, 8g: handle slice by sub-word-sized index (uint8, int8, uint16, int16)
R=ken2
CC=golang-dev
https://golang.org/cl/1960042
2010-08-11 22:27:47 -07:00
Nigel Tao
753c9b5710 exp/draw: fix drawRGBA when x0 > x1 and we have to draw right-to-left.
R=r
CC=golang-dev
https://golang.org/cl/1940042
2010-08-11 10:10:17 +10:00
Robert Griesemer
b0d0de59a1 fix build: update exp/draw/draw_test.go
R=nigeltao
CC=golang-dev
https://golang.org/cl/1962041
2010-08-10 10:11:28 -07:00
Nigel Tao
7d3173fc1d exp/draw: remove the Color, Point and Rectangle types.
image: introduce Transparent and Opaque.

R=r
CC=golang-dev
https://golang.org/cl/1947042
2010-08-10 22:05:11 +10:00
Nigel Tao
b50a3d95e1 image: change image representation from slice-of-slices to linear buffer,
stride and rect.

R=r
CC=golang-dev, rog
https://golang.org/cl/1849041
2010-08-10 16:34:57 +10:00
Nigel Tao
96d7c8d4a8 exp/draw/x11: temporarily workaround compiler bug 1011.
R=r
CC=golang-dev
https://golang.org/cl/1951041
2010-08-10 15:53:19 +10:00
Nigel Tao
5eb35e4247 image: replace Width and Height by Bounds, and introduce the Point and
Rect types.

The actual image representation is unchanged. A future change will
replace the {[][]color} with {[]color, stride int, r Rectangle} and
possibly a clip region.

The draw.Color, draw.Point and draw.Rect types will be removed in a
future change. Trying to do it in this one polluted the diff with
trivia.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1918047
2010-08-10 12:08:52 +10:00
Anschel Schaffer-Cohen
8055f47029 exp/iterable: add UintArray
all other basic types seem to be represented.

R=rsc
CC=golang-dev
https://golang.org/cl/1919042
2010-08-06 16:39:18 -07:00
Robert Griesemer
496a935376 bignum: delete package - functionality subsumed by package big
R=rsc
CC=golang-dev
https://golang.org/cl/1742045
2010-07-15 16:08:53 -07:00
Robert Griesemer
a3855235cd fix build: reverting exp/eval Makefile to old form
(gofmt doesn't exist when this is built)

R=rsc
CC=golang-dev
https://golang.org/cl/1838041
2010-07-14 10:11:12 -07:00
Evan Shaw
b97292791b exp/eval: Converted from bignum to big
Also in this CL:
* Removed util.go, as its functionality is in big
* Removed some semicolons from the code generated by gen.go
* Added a generate target to Makefile
* Removed an outdated TODO from value.go

R=gri
CC=golang-dev
https://golang.org/cl/1780042
2010-07-14 09:39:59 -07:00
Robert Griesemer
d9c47cd8c8 container/vector: rename Data() -> Copy()
R=rsc
CC=golang-dev
https://golang.org/cl/1814043
2010-07-12 17:22:21 -07:00
Rob Pike
38f1231f3e strings and bytes.Split: make count of 0 mean 0, not infinite.
Use a count of -1 for infinity.  Ditto for Replace.

R=rsc
CC=golang-dev
https://golang.org/cl/1704044
2010-07-01 14:08:14 -07:00
Nigel Tao
715425bf6f exp/draw/x11: implement the mapping from keycodes to keysyms.
R=rsc
CC=golang-dev, rog
https://golang.org/cl/1739042
2010-06-29 10:54:41 +10:00
Russ Cox
45bdf0367e reflect: add Kind, remove Int8Type, Int8Value, etc.
update other code to match.

R=r
CC=golang-dev
https://golang.org/cl/1680044
2010-06-20 12:16:25 -07:00
Russ Cox
a674c024c7 nacl: fix build
TBR=r
CC=golang-dev
https://golang.org/cl/1706044
2010-06-18 22:45:42 -07:00
Russ Cox
6672b40c09 remove uses of ... from tree, add one test
R=r
CC=golang-dev
https://golang.org/cl/1662041
2010-06-14 11:23:11 -07:00
Nigel Tao
44a17e9df7 exp/draw: small draw.drawGlyphOver optimization.
Make dpix variable names consistent.

R=rsc
CC=golang-dev
https://golang.org/cl/1563041
2010-06-14 16:49:43 +10:00
Robert Griesemer
e0e5c150b0 exp/eval test: fix build
R=r
CC=golang-dev
https://golang.org/cl/1599043
2010-06-09 15:52:42 -07:00
Nigel Tao
37fba90bc7 Fixes #836.
R=gri
CC=golang-dev
https://golang.org/cl/1548042
2010-06-04 17:30:39 -07:00
Nigel Tao
2006667931 draw.Draw fast paths for the Over operator.
Time (us) to draw a 200x200 src onto an image.RGBA dst with the Over
operator. Each case was measured three separate times, and the sorted
times are reported.

Fill case (where src is an image.ColorImage):
Before:
7438, 7511, 7526
After:
3073, 3087, 3102

Copy case (where src is an image.RGBA):
Before:
9506, 9510, 9563
After:
5262, 5300, 5344

R=rsc
CC=golang-dev
https://golang.org/cl/1532041
2010-06-03 17:19:00 -07:00
Nigel Tao
2bb59fd71a Make image.Color.RGBA return 16 bit color instead of 32 bit color.
R=rsc
CC=golang-dev
https://golang.org/cl/1388041
2010-05-28 12:59:21 -07:00
Roger Peppe
1fda1323d4 Add Rectangle.Eq and Point.In.
Fix Rectangle.Clip.
It could return a non-canonical rectangle if its arguments
did not overlap.
e.g. Rect(0, 0, 10, 10).Clip(Rect(0, 20, 10, 30)) -> Rect(0, 20, 10, 10)

R=rsc, r
CC=golang-dev, golang-dev
https://golang.org/cl/1290041
2010-05-27 17:19:47 -07:00
Nigel Tao
0c662f60a5 Optimize exp/draw/x11 flusher inner loop.
On my laptop, time to prepare and write 800x600 pixels over the
socket falls from 125-ish ms to 80-ish ms.

Thanks to Roger Peppe for the suggestion.

R=r
CC=golang-dev
https://golang.org/cl/1228044
2010-05-24 19:32:42 -07:00
Nigel Tao
c95e11db56 Fix typo in exp/draw/x11.
R=rsc
CC=golang-dev
https://golang.org/cl/1282041
2010-05-24 15:07:47 -07:00
Nigel Tao
2d8aee45b8 Make draw/x11 treat $DISPLAY the same way x-go-bindings does.
This ought to make draw/x11 work on a Mac.

R=rsc
CC=golang-dev
https://golang.org/cl/1265042
2010-05-24 11:44:09 -07:00
Robert Griesemer
72fd5c80f8 go/printer, gofmt: fix printing of labels,
apply gofmt to src, misc

Fixes #752.

R=rsc
CC=golang-dev
https://golang.org/cl/1240044
2010-05-21 20:25:08 -07:00
Robert Griesemer
638ef0794f bignum: deprecate by moving into exp directory
R=rsc
CC=golang-dev
https://golang.org/cl/1211047
2010-05-21 14:14:22 -07:00
Roger Peppe
798140693e Fix Rectangle.Canon()
R=rsc, r, gri
CC=golang-dev
https://golang.org/cl/1239043
2010-05-20 14:33:50 -07:00
Nigel Tao
efda3aba10 Fast-ish path for drawing onto an image.RGBA destination.
Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to
5.6ms (and 0 mallocs). It's still relatively slow since it assumes
nothing about the src or mask images, but it does remove the malloc.
There are existing faster, more specialized paths for copies, fills
and image glyph masks.

Also added a "compare to a slow but obviously correct implementation"
check to draw_test.go.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1223044
2010-05-20 13:57:18 -07:00
Nigel Tao
916426ea76 drawGlyphOver optimization.
Timings (as for change 1122043) go from 49ms to 48ms ish. It's
mostly lost in the noise, but it probably doesn't hurt.

R=r
CC=golang-dev
https://golang.org/cl/1179041
2010-05-11 13:35:16 +10:00
Nigel Tao
d7a6d22852 exp/draw fast path for glyph images.
To draw.Draw a 32x32 image.Alpha 10000 times,
Before: 633ms with 10000 mallocs
After: 49ms with 0 mallocs

These times are just blitting an image.Alpha, and do not include
rasterizing a glyph's vector contours to an image.Alpha.

The "generic" test case in draw_test.go tests this fast path.

R=rsc
CC=golang-dev
https://golang.org/cl/1122043
2010-05-10 10:32:08 +10:00
Nigel Tao
20ba090978 Make exp/draw/x11 respect $XAUTHORITY.
R=rsc, cw, nigeltao_golang
CC=golang-dev
https://golang.org/cl/1134041
2010-05-06 18:41:42 +10:00
Russ Cox
01fc062496 iterable: expose iterFunc as iterable.Func
Fixes #483.

R=dsymonds, dsymonds1
CC=golang-dev
https://golang.org/cl/965044
2010-04-27 18:48:29 -07:00
Evan Shaw
9ca10b0a5c exp/eval: Always read float literals as base 10
We were letting bignum decide, which caused problems with float literals with a leading 0.

R=gri
CC=golang-dev
https://golang.org/cl/816047
2010-04-15 19:53:35 -07:00
Evan Shaw
39a2e82ee6 exp/eval: Implement x[lo:]
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/908044
2010-04-15 18:04:24 -07:00
Christopher Wedgwood
74d0302eb9 Remove exp/exception as it's no longer relevant
R=gri, adg
CC=golang-dev, r, rsc
https://golang.org/cl/857048
2010-04-13 10:51:35 +10:00
Evan Shaw
fa860653ae exp/eval: Fix example and add target to Makefile
R=rsc
CC=golang-dev
https://golang.org/cl/901042
2010-04-11 12:42:19 -07:00
Christopher Wedgwood
98a5a20c5e nacl: update documentation to match current coding style
R=rsc, r
CC=golang-dev
https://golang.org/cl/822047
2010-04-11 10:19:32 -07:00
Russ Cox
c7122a3c58 simplify various code using new map index rule
R=r
CC=golang-dev
https://golang.org/cl/833044
2010-03-30 10:51:11 -07:00
Russ Cox
00f9f0c056 single argument panic
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.

stop on error in doc/progs/run

R=r
CC=golang-dev
https://golang.org/cl/850041
2010-03-30 10:34:57 -07:00
Rob Pike
325cf8ef21 delete all uses of panicln by rewriting them using panic or,
in the tests, println+panic.
gofmt some tests too.

R=rsc
CC=golang-dev
https://golang.org/cl/741041
2010-03-24 16:46:53 -07:00
Robert Griesemer
e8a049b440 gofmt: modified algorithm for alignment of multi-line composite/list entries
- only manual changes are in src/pkg/go/printer/nodes.go
- use a heuristic to determine "outliers" such that not entire composites are
  forced to align with them
- improves several places that were not unligned before due too simple heuristic
- unalignes some cases that contain "outliers"
- gofmt -w src misc

Fixes #644.

R=rsc, r
CC=golang-dev
https://golang.org/cl/241041
2010-03-04 17:37:15 -08:00
Robert Griesemer
305f5433f3 gofmt: fix alignment of multi-line var declarations
- gofmt -w src misc

R=rsc, r
CC=golang-dev
https://golang.org/cl/223101
2010-03-02 17:23:07 -08:00
Robert Griesemer
f44fa9b4c7 gofmt: experiment: align values in map composites where possible
- gofmt -w src misc
- looking for feedback

R=rsc, r
CC=golang-dev
https://golang.org/cl/223076
2010-03-02 13:46:51 -08:00
Robert Griesemer
d177539877 go/printer, gofmt: align comments in multi-line expression lists
- gofmt -w src misc
- improves several lists and fixes minor degradation introduced
  with the fix for issue 628
- removed some dead code (stringList)

R=rsc
CC=golang-dev
https://golang.org/cl/223058
2010-02-25 16:07:55 -08:00
Russ Cox
9750adbbad strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports

R=r
CC=golang-dev
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Robert Griesemer
dbe0b57012 go/printer, gofmt: correct indentation after certain /*-style comments
- applied gofmt to src and misc

Note: This fix improved formatting of src/pkg/math/all_test.go but leads
to a degradation in src/pkg/exp/4s/xs.go. The latter happened to "work"
before accidentally. Fixing the alignment in that case in general will
be a separate CL.

Fixes #628.

R=rsc
CC=golang-dev
https://golang.org/cl/223054
2010-02-25 13:47:16 -08:00
Robert Griesemer
ef0be41e20 go/ast: streamline representation of field lists
- always include position information about opening/closing parens/braces
- replace uses of []*ast.Field with *ast.FieldList

Fixes #473.

R=rsc
CC=golang-dev
https://golang.org/cl/223043
2010-02-24 16:17:11 -08:00
Robert Griesemer
1be05bbe1e gofmt: don't print ()'s around function-typed results (not needed anymore)
- add extra test cases to go/printer tests
- apply gofmt to src and misc

R=rsc
CC=golang-dev
https://golang.org/cl/223041
2010-02-24 13:24:37 -08:00
Robert Griesemer
8e714aab2b - removed exp/parser (support for old semicolon syntax)
- go/ast: removed StringList (not needed anymore)
- go/ast: changed import path and field list tag to a single string
- updated all dependencies

R=rsc
CC=golang-dev
https://golang.org/cl/217056
2010-02-19 16:01:31 -08:00
Nigel Tao
3dc04f4a22 Add Src and Over draw operators.
R=r, rsc
CC=golang-dev
https://golang.org/cl/207096
2010-02-17 14:34:51 +11:00
Robert Griesemer
85498cbcdd remove assumption that all files belonging to a package are in the same directory:
- adjust ast.Package node and doc.PackageDoc correspondingly
- introduce parser.ParseFiles

R=rsc
CC=golang-dev
https://golang.org/cl/207087
2010-02-16 11:20:25 -08:00
Nigel Tao
fc8e3d4004 exp/draw test.
R=rsc
CC=golang-dev
https://golang.org/cl/203062
2010-02-11 13:38:16 +11:00
Nigel Tao
48cdb63baa draw.Draw fast paths for a nil mask (and RGBA dst).
Averaged times (in microseconds) for drawing an 800x600 rectangle
are listed below. The summary is: around a 100x improvement.

draw.Draw call times were typically linear in the number of pixels
touched (i.e. drawing an 800x600 rectangle took 100x as much time as
drawing an 80x60 rectangle).

Before this change, there was only the general-but-slow code path.
When drawing any src with a 50%-opaque mask: 237300 us
When drawing any src with a nil mask: 50100 us

After this change, the 50%-opaque mask case is unchanged.
For an *image.RGBA dst and nil mask and...
...a uniform color (i.e. an image.ColorImage) src: 282 us
...another *image.RGBA src: 615 us.

For the curious, an intermediate implementation detected the special
cases but used simple nested for loops instead of the built-in copy
function. The respective times (compared to 282 and 615 for the
final implementation, or 50100 for the original) were 3110 and 3573.

Times were measured with 8g/8l on my laptop. I haven't tried gccgo
or other architectures.

R=r, rsc
CC=golang-dev
https://golang.org/cl/201048
2010-02-06 15:57:19 +11:00
Nigel Tao
4e2035bdc2 In draw.Draw, separate the source-point and mask-point.
This lets you draw text (i.e. with mask = a font image) with
sources that aren't uniform colors.

R=r, rsc
CC=golang-dev
https://golang.org/cl/193067
2010-02-04 21:21:32 +11:00
Russ Cox
8b8c103b2b fix build - misc ... vs ...T fixes
TBR=r
CC=golang-dev
https://golang.org/cl/198081
2010-02-02 18:19:27 -08:00
Rob Pike
d2fc5d68da Change type of Printf's args to ... interface{}
R=rsc
CC=golang-dev
https://golang.org/cl/197043
2010-02-02 10:53:37 +11:00
Russ Cox
68796b0270 gc: add ... T, rework plain ...
No longer a distinct type; now a property of func types.

R=ken2
CC=golang-dev
https://golang.org/cl/197042
2010-02-01 00:25:59 -08:00
Robert Griesemer
8fedbb8c3d support for ...T parameters (go/* packages)
R=rsc
CC=golang-dev
https://golang.org/cl/194126
2010-01-28 13:24:48 -08:00
Robert Griesemer
f39dc9fff2 More steps towards tracking of identifier scopes.
- provide scope to parse functions; if non-nil, parser uses the scope
  to declare and lookup identifiers
- resolve forward references where possible

R=rsc
CC=golang-dev
https://golang.org/cl/194098
2010-01-27 09:44:28 -08:00
Robert Griesemer
01b4f2dd23 Steps towards tracking scopes for identifiers.
- Identifiers refer now to the language entity (Object)
	  that they denote. At the moment this is at best an
	  approximation.

	- Initial data structures for language entities (Objects)
          and expression types (Type) independent of the actual
	  type notations.

	- Initial support for declaring and looking up identifiers.

	- Updated various dependent files and added support functions.

	- Extensively tested to avoid breakage. This is an AST change.

R=rsc
CC=golang-dev, rog
https://golang.org/cl/189080
2010-01-15 13:27:45 -08:00
Nigel Tao
8cf627ad57 Fix s/Width/Height/ typo in draw.go.
Fixes #531.

R=r
CC=golang-dev
https://golang.org/cl/189078
2010-01-15 11:58:24 +11:00
Robert Griesemer
8c7d001602 Replace container/vector with exp/vector (faster).
Manual changes to the following files:
src/pkg/Makefile
src/pkg/exp/vector/Makefile (now: src/pkg/container/vector/Makefile)

R=rsc, r
CC=golang-dev
https://golang.org/cl/181041
2009-12-22 18:25:27 -08:00
Robert Griesemer
36d645f5fa add comment (warning about generated files)
R=r
CC=golang-dev
https://golang.org/cl/180108
2009-12-22 15:14:10 -08:00
Jan Mercl
b15fefd7d7 Experimental alternative implementation of the vector package
R=gri
CC=rsc
https://golang.org/cl/178048
2009-12-21 14:34:54 -08:00
Robert Griesemer
057e7d9fae fix build, enable an exp/eval's assignment check
now that the parser doesn't do this test anymore

R=rsc
CC=golang-dev
https://golang.org/cl/179105
2009-12-18 11:21:11 -08:00
Robert Griesemer
c5f41cc58c removed semantic check from parsers
R=rsc
CC=golang-dev
https://golang.org/cl/179099
2009-12-18 10:51:47 -08:00
Robert Griesemer
b6bac1c0a5 Don't ignore flags controlling the amount of source code parsed
in parser's ParsePkgFile and ParsePackage functions.

R=rsc
CC=golang-dev, rog
https://golang.org/cl/180070
2009-12-16 14:12:24 -08:00
Robert Griesemer
1c72959999 1) Change default gofmt default settings for
parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

	       2nd set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/179067
2009-12-15 15:27:16 -08:00
Devon H. O'Dell
857d4cf1a9 Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src
This change removes the necessity to have GOBIN in $PATH,
and also doesn't assume that the build is being run from
$GOROOT/src. This is a minimal set of necessary changes
to get Go to build happily from the FreeBSD ports
collection.

R=rsc
CC=golang-dev
https://golang.org/cl/171044
2009-12-11 15:14:09 -08:00
Robert Griesemer
bda2074193 New flags for gofmt:
- oldparser            parse old syntax (required semicolons)
- oldprinter           print old syntax (required semicolons)

By default, these flags are enabled for now.
Setting -oldparser=false has no effect until go/parser is changed
to accept the new syntax.

Enabled exp/parser in Makefile; update dependent exp/eval.

R=rsc
https://golang.org/cl/174051
2009-12-10 19:03:28 -08:00
Robert Griesemer
02d41ec7df rename exp/parser package to oldParser
to allow simultaneous import with the
current go/parser

R=rsc
https://golang.org/cl/174053
2009-12-10 18:27:48 -08:00
Robert Griesemer
2b3813d0e2 - unmodified copy of existing go/parser, not yet hooked up
R=rsc
CC=r
https://golang.org/cl/175045
2009-12-10 14:26:25 -08:00
Robert Griesemer
2e4334eb3a minor manual format corrections
R=rsc
https://golang.org/cl/172042
2009-12-09 16:54:24 -08:00
Robert Griesemer
295ceb4526 remove uses of string concatenation from src and misc directory
R=rsc
https://golang.org/cl/172041
2009-12-09 16:54:07 -08:00
Russ Cox
609eeee817 make Native Client support build again,
add README explaining how to try the
web demos.

Fixes #339.

R=r
CC=barry.d.silverman, bss, vadim
https://golang.org/cl/165057
2009-12-04 10:11:32 -08:00
Michael Elkins
f3d63bea42 Add Count, Cycle, ZipWith, GroupBy, Repeat, RepeatTimes, Unique to exp/iterable.
Modify iterFunc to take chan<- instead of just chan.

R=rsc, dsymonds1
CC=golang-dev, r
https://golang.org/cl/160064
2009-12-03 20:03:07 -08:00
Rob Pike
b0683bd77a move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.
this breaks the dependency of package io on package bytes.

R=rsc
CC=golang-dev
https://golang.org/cl/163085
2009-12-02 22:02:14 -08:00
Christopher Wedgwood
f0c9719540 Minimise bitrot: bytes.Copy -> copy
(compile tested only)

R=r, rsc
https://golang.org/cl/161069
2009-11-30 11:57:21 -08:00
Sergio Luis O. B. Correia
46892656c7 crypto/md4, exp/draw/x11: fix makefile to build when GOROOT has whitespaces
this is the exact same thing issue #115 is about. fix makefiles to use relative
path to work in the case we have whitespaces as part of GOROOT.

R=rsc
https://golang.org/cl/162055
2009-11-29 18:14:49 -08:00
Nigel Tao
f65427a8be Initial exp/draw/x11 implementation.
This provides an experimental X11 backend for the exp/draw interface.
It does not aim to provide a complete implementation of the X11 client protocol.

This works for me (Ubuntu Hardy 8.04, GOARCH=386). Your mileage my vary.

R=r, rsc, r1
CC=golang-dev
https://golang.org/cl/156109
2009-11-25 18:31:34 +11:00
Robert Griesemer
001a8b11ff Change to container/vector interface:
- removed New(len int) in favor of new(Vector).Resize(len, cap)
- removed Init(len int) in favor of Resize(len, cap)
- runs all.bash

Fixes #294.

R=rsc, r, r1
https://golang.org/cl/157143
2009-11-24 13:43:18 -08:00
Michael Elkins
b320cf5bf4 add Take, TakeWhile, Drop, DropWhile to exp/iterable
R=dsymonds1, rsc
https://golang.org/cl/156079
2009-11-24 11:31:11 -08:00
Sergio Luis O. B. Correia
6fc820729e go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.

this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.

Fixes #115.

R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
Robert Griesemer
7763345379 Support for basic try-catch style exception handling.
Meant as illustration of the Go pattern that is using
goroutines and channels to handle exceptional situations.

Note: There is no need for "Finally" since the
"try block" (the function f supplied to Try)
cannot do a Smalltalk-style non-local return
and terminate the function surrounding Try.

Replaces CL 157083.

R=r, rsc
https://golang.org/cl/157087
2009-11-20 11:50:11 -08:00
Russ Cox
9ac4449cb2 gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkg
R=r, gri
CC=golang-dev
https://golang.org/cl/156115
2009-11-20 11:45:05 -08:00
Robert Griesemer
b48f71213a Permit omission of hi bound in slices.
R=r, rsc
https://golang.org/cl/157082
2009-11-19 16:42:05 -08:00
David Symonds
affcfe5a75 Add some primitive type aliases to exp/iterable and define Iter on them.
R=rsc
https://golang.org/cl/155065
2009-11-16 13:39:59 -08:00
Devon H. O'Dell
553be8427e Build changes to support work on the BSDs.
This does still contain some FreeBSD-specific bits, but
it's a pain to do partial diffs.

R=rsc
https://golang.org/cl/152138
2009-11-14 15:29:09 -08:00
Adam Langley
454c621d91 exp/draw: correct Makefile.
Thanks to Allister Macleod

Fixes #112.

R=rsc
CC=golang-dev
https://golang.org/cl/152102
2009-11-12 13:55:20 -08:00
Robert Griesemer
baba292998 - replaced gofmt expression formatting algorithm with
rsc's algorithm
	- applied gofmt -w misc src
	- partial CL (remaining files in other CLs)

R=rsc, r
http://go/go-review/1026036
2009-11-09 21:13:17 -08:00
Robert Griesemer
40621d5c0d remove semis after statements in one-statement statement lists
R=rsc, r
http://go/go-review/1025029
2009-11-09 12:07:39 -08:00
David Symonds
6ea866c04b Typo fixes.
R=rsc
CC=go-dev
http://go/go-review/1026014
2009-11-06 18:43:57 -08:00
Robert Griesemer
368f8cbc75 - fine-tuning of one-line func heuristic (nodes.go)
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)

R=r, rsc
CC=go-dev
http://go/go-review/1026006
2009-11-06 14:24:38 -08:00
Robert Griesemer
0ea9dd815a gofmt the last outstanding files in src/pkg
- added a list of issues to printer/nodes.go

R=rsc
http://go/go-review/1024002
2009-11-05 18:14:47 -08:00
Robert Griesemer
9786b3f1bd gofmt-ify 4s, iterable
R=rsc
http://go/go-review/1016055
2009-11-05 14:43:03 -08:00
Robert Griesemer
2a89915485 gofmt-ify draw
R=rsc
http://go/go-review/1017055
2009-11-05 14:42:28 -08:00
Robert Griesemer
9e48df682c gofmt-ify eval
R=rsc
http://go/go-review/1016054
2009-11-05 14:41:56 -08:00
Robert Griesemer
d2af73136e gofmt-ify ogle
R=rsc
http://go/go-review/1016053
2009-11-05 14:30:18 -08:00
Robert Griesemer
6238964d7b gofmt-ify nacl
R=rsc
http://go/go-review/1018062
2009-11-05 14:29:38 -08:00
Robert Griesemer
3630bfbe9f gofmt-ify math, expvar, exp/spacewar
R=rsc
http://go/go-review/1018061
2009-11-05 09:08:08 -08:00
Russ Cox
7732d80ceb misc cleanup
R=r
http://go/go-review/1016017
2009-11-01 09:25:55 -08:00
Ian Lance Taylor
b534eb462b Don't use fallthrough in a type switch.
R=rsc
http://go/go-review/1018005
2009-10-30 16:10:42 -07:00
Austin Clements
3040f067c3 Interface types, values, and type compiler. This does not yet
implement any type checking or semantics for interfaces.

R=rsc
APPROVED=rsc
DELTA=305  (289 added, 10 deleted, 6 changed)
OCL=35889
CL=35995
2009-10-22 08:59:18 -07:00
David Symonds
69fc06dfa1 Move usr/dsymonds/iterable to src/pkg/exp/iterable.
Remove remainder of usr/dsymonds.

R=rsc,r
APPROVED=r
DELTA=685  (275 added, 409 deleted, 1 changed)
OCL=35810
CL=35933
2009-10-20 14:10:22 -07:00
Russ Cox
98089b68a3 nacl demos
R=r
DELTA=9147  (9147 added, 0 deleted, 0 changed)
OCL=35734
CL=35776
2009-10-15 11:04:33 -07:00
Russ Cox
4113ca5fb1 explain exp
R=r
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=35732
CL=35775
2009-10-15 11:02:18 -07:00
Russ Cox
2b7fde3406 move austin/eval and austin/ogle to exp/eval and exp/ogle
R=r
OCL=35736
CL=35746
2009-10-14 18:10:43 -07:00
Russ Cox
218a412e73 forgot to update Makefile in last CL
R=gri
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=35737
CL=35745
2009-10-14 18:10:00 -07:00
Russ Cox
7d795d8c01 move native client to exp/nacl.
R=r
DELTA=3706  (1857 added, 1849 deleted, 0 changed)
OCL=35731
CL=35741
2009-10-14 17:16:21 -07:00
Russ Cox
c058e20a18 move draw to exp
R=r
DELTA=942  (471 added, 471 deleted, 0 changed)
OCL=35733
CL=35740
2009-10-14 17:15:56 -07:00
Russ Cox
17dfa682ae move datafmt into exp
R=gri
DELTA=3006  (1503 added, 1503 deleted, 0 changed)
OCL=35730
CL=35735
2009-10-14 16:55:05 -07:00