]> Cypherpunks repositories - gostls13.git/log
gostls13.git
15 years agoBasic POSIX-compatible tar writer.
David Symonds [Thu, 9 Jul 2009 00:15:18 +0000 (17:15 -0700)]
Basic POSIX-compatible tar writer.

R=rsc
APPROVED=rsc
DELTA=456  (382 added, 66 deleted, 8 changed)
OCL=31246
CL=31372

15 years agoANY is already checked separately,
Russ Cox [Wed, 8 Jul 2009 23:39:19 +0000 (16:39 -0700)]
ANY is already checked separately,
so remove code from go.y.

show original types in badtype; don't remove pointers.
not sure why this was here but it confuses things
if the bad part involves two named pointer types
with different names but the same pointed-at type.

R=ken
OCL=31369
CL=31369

15 years agoreflection for channels
Russ Cox [Wed, 8 Jul 2009 22:00:54 +0000 (15:00 -0700)]
reflection for channels

R=r
DELTA=188  (171 added, 6 deleted, 11 changed)
OCL=31352
CL=31361

15 years ago- update functionality for printer test
Robert Griesemer [Wed, 8 Jul 2009 21:57:51 +0000 (14:57 -0700)]
- 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

15 years agocomment change
Robert Griesemer [Wed, 8 Jul 2009 21:56:20 +0000 (14:56 -0700)]
comment change

R=r
OCL=31359
CL=31359

15 years agoWriteFile util function
Robert Griesemer [Wed, 8 Jul 2009 21:48:09 +0000 (14:48 -0700)]
WriteFile util function

R=rsc
DELTA=41  (41 added, 0 deleted, 0 changed)
OCL=31349
CL=31358

15 years agoreflection for maps
Russ Cox [Wed, 8 Jul 2009 20:55:57 +0000 (13:55 -0700)]
reflection for maps

R=r
DELTA=304  (248 added, 34 deleted, 22 changed)
OCL=31345
CL=31347

15 years agobug fix: encOpFor etc. need to indirect
Rob Pike [Wed, 8 Jul 2009 04:05:24 +0000 (21:05 -0700)]
bug fix: encOpFor etc. need to indirect

R=rsc
DELTA=28  (7 added, 7 deleted, 14 changed)
OCL=31312
CL=31322

15 years agoprinter_test: first cut
Robert Griesemer [Wed, 8 Jul 2009 01:09:26 +0000 (18:09 -0700)]
printer_test: first cut

R=rsc
DELTA=169  (168 added, 0 deleted, 1 changed)
OCL=31319
CL=31321

15 years agothe ld-supplied typestrings are now obsolete
Russ Cox [Wed, 8 Jul 2009 00:35:45 +0000 (17:35 -0700)]
the ld-supplied typestrings are now obsolete

R=r
DELTA=167  (0 added, 167 deleted, 0 changed)
OCL=31304
CL=31316

15 years ago- print comments associated with declarations
Robert Griesemer [Tue, 7 Jul 2009 23:07:34 +0000 (16:07 -0700)]
- 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

15 years agomethod expansion bugs
Russ Cox [Tue, 7 Jul 2009 23:05:55 +0000 (16:05 -0700)]
method expansion bugs

R=ken
OCL=31310
CL=31310

15 years agoAdd entry points for parsing statements and expressions.
Austin Clements [Tue, 7 Jul 2009 22:47:01 +0000 (15:47 -0700)]
Add entry points for parsing statements and expressions.

R=gri
APPROVED=gri
DELTA=73  (48 added, 0 deleted, 25 changed)
OCL=31302
CL=31308

15 years agoUpdate the unsafe docs for the new type implementation.
Ian Lance Taylor [Tue, 7 Jul 2009 22:06:29 +0000 (15:06 -0700)]
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

15 years agotypestring.c is no longer needed.
Ian Lance Taylor [Tue, 7 Jul 2009 21:50:39 +0000 (14:50 -0700)]
typestring.c is no longer needed.

R=rsc
DELTA=35  (0 added, 34 deleted, 1 changed)
OCL=31301
CL=31303

15 years ago- ast.FilterExports: filter non-exported anonymous fields
Robert Griesemer [Tue, 7 Jul 2009 19:02:54 +0000 (12:02 -0700)]
- 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

15 years agobug167
Russ Cox [Tue, 7 Jul 2009 18:48:22 +0000 (11:48 -0700)]
bug167

R=ken
OCL=31295
CL=31295

15 years agoupdate tests for new reflect
Russ Cox [Tue, 7 Jul 2009 18:04:51 +0000 (11:04 -0700)]
update tests for new reflect

R=r
DELTA=12  (0 added, 0 deleted, 12 changed)
OCL=31240
CL=31290

15 years agogob: use new reflect
Russ Cox [Tue, 7 Jul 2009 18:04:42 +0000 (11:04 -0700)]
gob: use new reflect

R=r
DELTA=242  (68 added, 69 deleted, 105 changed)
OCL=31239
CL=31289

15 years agotemplate: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:04:34 +0000 (11:04 -0700)]
template: use new reflect interface (CL 31107)

R=r
DELTA=16  (3 added, 1 deleted, 12 changed)
OCL=31121
CL=31288

15 years agonet: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:04:26 +0000 (11:04 -0700)]
net: use new reflect interface (CL 31107)

R=r
DELTA=186  (55 added, 8 deleted, 123 changed)
OCL=31117
CL=31287

15 years agojson: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:04:18 +0000 (11:04 -0700)]
json: use new reflect interface (CL 31107)

R=r
DELTA=192  (52 added, 43 deleted, 97 changed)
OCL=31116
CL=31286

15 years agogo/printer: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:04:10 +0000 (11:04 -0700)]
go/printer: use new reflect interface (CL 31107)

R=gri
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=31115
CL=31285

15 years agodatafmt: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:03:50 +0000 (11:03 -0700)]
datafmt: use new reflect interface (CL 31107)

R=gri
DELTA=70  (7 added, 17 deleted, 46 changed)
OCL=31113
CL=31283

15 years agobase64_test: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:03:40 +0000 (11:03 -0700)]
base64_test: use new reflect interface (CL 31107)

R=austin
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=31112
CL=31282

15 years agofmt: use new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:03:31 +0000 (11:03 -0700)]
fmt: use new reflect interface (CL 31107)

R=r
DELTA=208  (37 added, 63 deleted, 108 changed)
OCL=31111
CL=31281

15 years agoupdate reflect supporting functions,
Russ Cox [Tue, 7 Jul 2009 18:03:12 +0000 (11:03 -0700)]
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

15 years ago6g, 8g: generate data structures for new reflect interface (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:03:04 +0000 (11:03 -0700)]
6g, 8g: generate data structures for new reflect interface (CL 31107)

R=ken
OCL=31122
CL=31278

15 years agoruntime: use new reflect data structures (CL 31107)
Russ Cox [Tue, 7 Jul 2009 18:02:54 +0000 (11:02 -0700)]
runtime: use new reflect data structures (CL 31107)
in place of sigi, sigt.

R=ken
OCL=31118
CL=31277

15 years agoinstall new reflect:
Russ Cox [Tue, 7 Jul 2009 18:02:44 +0000 (11:02 -0700)]
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

15 years agobug167: types declared in different scopes should
Robert Griesemer [Tue, 7 Jul 2009 17:42:42 +0000 (10:42 -0700)]
bug167: types declared in different scopes should
be independent of each other

R=rsc
DELTA=28  (28 added, 0 deleted, 0 changed)
OCL=31271
CL=31273

15 years agofix test
Robert Griesemer [Tue, 7 Jul 2009 17:30:31 +0000 (10:30 -0700)]
fix test

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=31270
CL=31272

15 years agoAvoid race condition. Following the left to right rule,
Ian Lance Taylor [Tue, 7 Jul 2009 17:15:01 +0000 (10:15 -0700)]
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

15 years agomove 6c/pgen.c, 6c/pswt.c into cc
Russ Cox [Tue, 7 Jul 2009 17:07:15 +0000 (10:07 -0700)]
move 6c/pgen.c, 6c/pswt.c into cc
and make 5c, 8c use them.

centralizes reachability analysis
and switch generation.

now 8c doesn't have spurious warnings
in pkg/runtime.

R=ken
OCL=31266
CL=31266

15 years ago- removed implementation restrictions for creation of small
Robert Griesemer [Tue, 7 Jul 2009 17:03:42 +0000 (10:03 -0700)]
- 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

15 years agoinsert ODCL in type switch case.
Russ Cox [Tue, 7 Jul 2009 06:42:57 +0000 (23:42 -0700)]
insert ODCL in type switch case.
needed for heap allocation if variable escapes.

package main
func main(){
var i interface{} = 42;
switch v := i.(type) {
case int:
println(&v, v);
}
}

R=ken
OCL=31245
CL=31245

15 years agoshift typechecking bugs
Russ Cox [Tue, 7 Jul 2009 06:33:17 +0000 (23:33 -0700)]
shift typechecking bugs
x << "a"
1 << int(2)

R=ken
OCL=31244
CL=31244

15 years agocleaned up data generation in 5g, reverted 5l handling of D_ADDR.
Kai Backman [Tue, 7 Jul 2009 06:04:56 +0000 (23:04 -0700)]
cleaned up data generation in 5g, reverted 5l handling of D_ADDR.

R=rsc
APPROVED=rsc
DELTA=46  (0 added, 5 deleted, 41 changed)
OCL=31241
CL=31243

15 years agoAdd support for v7 tar.
David Symonds [Tue, 7 Jul 2009 05:59:31 +0000 (22:59 -0700)]
Add support for v7 tar.

R=rsc
APPROVED=rsc
DELTA=32  (26 added, 4 deleted, 2 changed)
OCL=31172
CL=31242

15 years agovarious 6g cleanup:
Russ Cox [Tue, 7 Jul 2009 05:31:20 +0000 (22:31 -0700)]
various 6g cleanup:

* give genwrapper and genembedtramp the same signature.
* move duint8, duint16, duint32, duint64, duintptr into gc.
* tidy genwrapper.
* bug involving struct field symbols in signature list.
  (hash-order dependent so hard to trigger)
* new Type print format %#-T like %#T but omits
  names on function arguments.

R=ken
OCL=31237
CL=31237

15 years agostatements after panicln are unreachable, just like after panic.
Russ Cox [Tue, 7 Jul 2009 05:25:54 +0000 (22:25 -0700)]
statements after panicln are unreachable, just like after panic.

missing break after error.

dot symbol bug fix: leave sym alone
(was incorrect for inserted cross-package dots).

R=ken
OCL=31234
CL=31236

15 years agonew reflect Value implementations.
Russ Cox [Tue, 7 Jul 2009 05:10:40 +0000 (22:10 -0700)]
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

15 years agoanother piece for cross-file forward struct declarations.
Russ Cox [Tue, 7 Jul 2009 04:39:18 +0000 (21:39 -0700)]
another piece for cross-file forward struct declarations.

R=ken
OCL=31233
CL=31233

15 years agofix bug involving typed nil constants:
Russ Cox [Tue, 7 Jul 2009 04:37:29 +0000 (21:37 -0700)]
fix bug involving typed nil constants:
interface = (*int)(nil) is not the same as
interface = nil.

package main
func main() {
var x interface{} = (*int)(nil);
println(x.(*int));
}

R=ken
OCL=31232
CL=31232

15 years agofix forward struct declarations
Russ Cox [Tue, 7 Jul 2009 01:05:11 +0000 (18:05 -0700)]
fix forward struct declarations

R=ken
OCL=31230
CL=31230

15 years agoallow conversion to interface type
Russ Cox [Tue, 7 Jul 2009 00:20:48 +0000 (17:20 -0700)]
allow conversion to interface type
when implicit assignment would have been okay.

R=ken
OCL=31225
CL=31227

15 years agomore precise error message
Russ Cox [Mon, 6 Jul 2009 23:29:28 +0000 (16:29 -0700)]
more precise error message

package main

func main() {
       var x interface {} = 42;
       switch x := x.(type) {
       case int:
       case foo:
       }
}

before:
x.go:7: non-type case in type switch
x.go:7: inappropriate case for a type switch

now:
x.go:7: foo: undefined

R=ken
OCL=31221
CL=31221

15 years agonew reflect type.go implementation
Russ Cox [Mon, 6 Jul 2009 23:06:31 +0000 (16:06 -0700)]
new reflect type.go implementation

R=r
DELTA=179  (172 added, 6 deleted, 1 changed)
OCL=31215
CL=31220

15 years agobetter error message + line numbers
Russ Cox [Mon, 6 Jul 2009 23:05:48 +0000 (16:05 -0700)]
better error message + line numbers

package main
func main() {
       var x interface{};
       switch x {
       case 41:
       case "b":
       }
}

before:
x.go:5: fatal error: exprcmp

now:
x.go:5: illegal types for operand: EQ
interface { }
int
x.go:6: illegal types for operand: EQ
interface { }
string

R=ken
OCL=31217
CL=31219

15 years agonew reflect library data structures and code declarations
Russ Cox [Mon, 6 Jul 2009 22:34:04 +0000 (15:34 -0700)]
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

15 years agoa few edits and simplifications.
Rob Pike [Mon, 6 Jul 2009 22:15:56 +0000 (15:15 -0700)]
a few edits and simplifications.

R=rsc
DELTA=248  (40 added, 108 deleted, 100 changed)
OCL=31211
CL=31211

15 years ago- bug fix: do not strip lower-case parameter and result names in signatures
Robert Griesemer [Mon, 6 Jul 2009 18:39:48 +0000 (11:39 -0700)]
- 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

15 years agocatch corruption - avoid crash
Rob Pike [Mon, 6 Jul 2009 17:58:55 +0000 (10:58 -0700)]
catch corruption - avoid crash

R=rsc
DELTA=4  (4 added, 0 deleted, 0 changed)
OCL=31192
CL=31198

15 years ago- ast.FilterExports: strips all non-exported nodes from an AST
Robert Griesemer [Mon, 6 Jul 2009 17:37:33 +0000 (10:37 -0700)]
- 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

15 years agosudoaddable odot
Kai Backman [Mon, 6 Jul 2009 16:23:41 +0000 (09:23 -0700)]
sudoaddable odot

R=rsc
APPROVED=rsc
DELTA=7  (0 added, 1 deleted, 6 changed)
OCL=31189
CL=31191

15 years agofix float32 comparison. was doing l op l instead of l op r.
Russ Cox [Mon, 6 Jul 2009 16:05:33 +0000 (09:05 -0700)]
fix float32 comparison.  was doing l op l instead of l op r.

R=ken
OCL=31190
CL=31190

15 years agoagen, sgen, cgen_callret, cgen_asop, D_ADDR handling, gmove
Kai Backman [Mon, 6 Jul 2009 13:42:37 +0000 (06:42 -0700)]
agen, sgen, cgen_callret, cgen_asop, D_ADDR handling, gmove
8bit and 16bit, some optoas, replaced Addr.index with
Addr.name

empty function compiles, mutex compiles

R=rsc
APPROVED=rsc
DELTA=908  (83 added, 41 deleted, 784 changed)
OCL=31127
CL=31188

15 years agofixed bug that cause -g to segfault
Kai Backman [Mon, 6 Jul 2009 13:36:25 +0000 (06:36 -0700)]
fixed bug that cause -g to segfault

R=rsc
APPROVED=rsc
DELTA=48  (30 added, 16 deleted, 2 changed)
OCL=31152
CL=31187

15 years agoRemove assumption about google.com being the default search domain.
David Symonds [Sun, 5 Jul 2009 22:00:11 +0000 (15:00 -0700)]
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

15 years agoanother seg fault
Ken Thompson [Sat, 4 Jul 2009 20:59:08 +0000 (13:59 -0700)]
another seg fault

R=r
OCL=31156
CL=31156

15 years agobug163
Russ Cox [Fri, 3 Jul 2009 20:34:05 +0000 (13:34 -0700)]
bug163

R=ken
OCL=31149
CL=31149

15 years agochange bug163 to use actual non-letter in identifier
Russ Cox [Fri, 3 Jul 2009 20:33:00 +0000 (13:33 -0700)]
change bug163 to use actual non-letter in identifier

R=r,iant
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31146
CL=31148

15 years agoput gob into the standard build
Rob Pike [Fri, 3 Jul 2009 19:54:59 +0000 (12:54 -0700)]
put gob into the standard build

R=rsc
DELTA=77  (76 added, 0 deleted, 1 changed)
OCL=31147
CL=31147

15 years agomaps have == so maps should work as map keys.
Russ Cox [Fri, 3 Jul 2009 16:45:15 +0000 (09:45 -0700)]
maps have == so maps should work as map keys.
fix tests of bad map keys to use slices instead.

R=r
DELTA=7  (0 added, 1 deleted, 6 changed)
OCL=31123
CL=31145

15 years agomaps have == so maps are okay as map keys.
Russ Cox [Fri, 3 Jul 2009 16:44:59 +0000 (09:44 -0700)]
maps have == so maps are okay as map keys.
alignment issue is fixed.

R=ken
OCL=31124
CL=31144

15 years agosys.cas for mutex
Kai Backman [Fri, 3 Jul 2009 05:05:06 +0000 (22:05 -0700)]
sys.cas for mutex

R=rsc
APPROVED=rsc
DELTA=28  (28 added, 0 deleted, 0 changed)
OCL=31128
CL=31130

15 years agominor comment and debug flag for dumping all oplooks.
Kai Backman [Fri, 3 Jul 2009 04:35:39 +0000 (21:35 -0700)]
minor comment and debug flag for dumping all oplooks.

R=rsc
APPROVED=rsc
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=31016
CL=31126

15 years agomove Structrnd to runtime.h
Russ Cox [Fri, 3 Jul 2009 04:25:46 +0000 (21:25 -0700)]
move Structrnd to runtime.h

R=ken
OCL=31125
CL=31125

15 years agoslices
Rob Pike [Fri, 3 Jul 2009 01:02:42 +0000 (18:02 -0700)]
slices

R=rsc
DELTA=59  (44 added, 13 deleted, 2 changed)
OCL=31105
CL=31105

15 years agoindirection on array elements.
Rob Pike [Fri, 3 Jul 2009 00:21:48 +0000 (17:21 -0700)]
indirection on array elements.

R=rsc
DELTA=57  (34 added, 10 deleted, 13 changed)
OCL=31098
CL=31101

15 years agoadd Uitoa etc.
Russ Cox [Thu, 2 Jul 2009 23:57:46 +0000 (16:57 -0700)]
add Uitoa etc.

R=r
DELTA=113  (89 added, 9 deleted, 15 changed)
OCL=31087
CL=31096

15 years agoarrays, not slices, and only with non-pointer elements.
Rob Pike [Thu, 2 Jul 2009 23:43:46 +0000 (16:43 -0700)]
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

15 years agomake a description of the slice header public
Rob Pike [Thu, 2 Jul 2009 23:28:04 +0000 (16:28 -0700)]
make a description of the slice header public

R=rsc
DELTA=18  (3 added, 0 deleted, 15 changed)
OCL=31086
CL=31094

15 years agofix atoi test
Russ Cox [Thu, 2 Jul 2009 23:24:44 +0000 (16:24 -0700)]
fix atoi test

R=r
DELTA=28  (5 added, 0 deleted, 23 changed)
OCL=31093
CL=31093

15 years agoRecognize gccgo error message.
Ian Lance Taylor [Thu, 2 Jul 2009 22:55:17 +0000 (15:55 -0700)]
Recognize gccgo error message.

bug022.go:8:13: error: attempt to index object which is not array, string, or map

R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31082
CL=31089

15 years agoRecognize gccgo error messages.
Ian Lance Taylor [Thu, 2 Jul 2009 22:54:57 +0000 (15:54 -0700)]
Recognize gccgo error messages.

(Amusing side note: the GNU coding standards say: Please do
not use the term "illegal" to refer to erroneous input to a
computer program.  Please use "invalid" for this, and reserve
the term "illegal" for activities prohibited by law.)

indirect1.go:35:3: error: argument must be string or array or slice or map
indirect1.go:36:3: error: argument must be string or array or slice or map
indirect1.go:38:3: error: argument must be string or array or slice or map
indirect1.go:41:3: error: argument must be string or array or slice or map
indirect1.go:42:3: error: argument must be string or array or slice or map
indirect1.go:44:3: error: argument must be string or array or slice or map
indirect1.go:55:3: error: argument must be string or array or slice or map
indirect1.go:56:3: error: argument must be string or array or slice or map
indirect1.go:58:3: error: argument must be string or array or slice or map
indirect1.go:61:3: error: argument must be array or slice
indirect1.go:62:3: error: argument must be array or slice
indirect1.go:64:3: error: argument must be array or slice

R=rsc
DELTA=12  (0 added, 0 deleted, 12 changed)
OCL=31081
CL=31088

15 years ago- store trailing comments after top-level declarations in ast
Robert Griesemer [Thu, 2 Jul 2009 22:38:36 +0000 (15:38 -0700)]
- 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

15 years agoencode and decode for nested structures.
Rob Pike [Thu, 2 Jul 2009 20:43:47 +0000 (13:43 -0700)]
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

15 years agoencoders and decoders for string, []uint8
Rob Pike [Thu, 2 Jul 2009 18:21:01 +0000 (11:21 -0700)]
encoders and decoders for string, []uint8

R=rsc
DELTA=165  (145 added, 6 deleted, 14 changed)
OCL=31051
CL=31056

15 years agofix bug in $GOROOT handling: error calling Getenv.
Rob Pike [Thu, 2 Jul 2009 16:47:25 +0000 (09:47 -0700)]
fix bug in $GOROOT handling: error calling Getenv.

R=gri
OCL=31047
CL=31047

15 years agonow that we have a separate indirection test, simplify the scalar tests.
Rob Pike [Thu, 2 Jul 2009 16:22:38 +0000 (09:22 -0700)]
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

15 years agosimplify decoders. error checking is done higher up.
Rob Pike [Thu, 2 Jul 2009 16:22:30 +0000 (09:22 -0700)]
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

15 years agofix bug in decoders: got indirection wrong when allocation not required.
Rob Pike [Thu, 2 Jul 2009 15:21:42 +0000 (08:21 -0700)]
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

15 years agomove dereference code out of the ops and into the interpreter loops.
Rob Pike [Thu, 2 Jul 2009 06:04:27 +0000 (23:04 -0700)]
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

15 years agoEncode and decode engines for gobs.
Rob Pike [Thu, 2 Jul 2009 01:25:13 +0000 (18:25 -0700)]
Encode and decode engines for gobs.

R=rsc
DELTA=468  (292 added, 18 deleted, 158 changed)
OCL=31008
CL=31012

15 years agoadd test, fix bug: structs that differ in their
Russ Cox [Wed, 1 Jul 2009 23:45:09 +0000 (16:45 -0700)]
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

15 years agoFix a doc typo.
David Symonds [Wed, 1 Jul 2009 22:07:20 +0000 (15:07 -0700)]
Fix a doc typo.

R=rsc
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=30967
CL=30990

15 years agoclean up some BUG/TODO in go code
Russ Cox [Wed, 1 Jul 2009 14:32:04 +0000 (07:32 -0700)]
clean up some BUG/TODO in go code

R=r
DELTA=23  (1 added, 12 deleted, 10 changed)
OCL=30957
CL=30980

15 years agochange alignment rules: roll receiver into
Russ Cox [Wed, 1 Jul 2009 03:02:07 +0000 (20:02 -0700)]
change alignment rules: roll receiver into
input parameters, move output parameters
into their own struct.

R=ken
OCL=30954
CL=30966

15 years agoremove declarations for functions that cannot be called from c
Russ Cox [Wed, 1 Jul 2009 03:01:59 +0000 (20:01 -0700)]
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

15 years agoconvert string runtime to use cgo.
Russ Cox [Wed, 1 Jul 2009 03:01:50 +0000 (20:01 -0700)]
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

15 years agoin preparation for changing 6g's behavior to
Russ Cox [Wed, 1 Jul 2009 03:01:41 +0000 (20:01 -0700)]
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

15 years agoscalar decoders
Rob Pike [Wed, 1 Jul 2009 00:59:41 +0000 (17:59 -0700)]
scalar decoders

R=rsc
DELTA=897  (728 added, 14 deleted, 155 changed)
OCL=30955
CL=30955

15 years agopass the state to the encoders and decoders so error handling can be centralized.
Rob Pike [Tue, 30 Jun 2009 23:20:31 +0000 (16:20 -0700)]
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

15 years agoencoders for booleans and numbers.
Rob Pike [Tue, 30 Jun 2009 22:37:46 +0000 (15:37 -0700)]
encoders for booleans and numbers.

R=rsc
DELTA=610  (597 added, 5 deleted, 8 changed)
OCL=30934
CL=30939

15 years agodelete io.ByteBuffer
Russ Cox [Tue, 30 Jun 2009 03:53:05 +0000 (20:53 -0700)]
delete io.ByteBuffer

R=r
DELTA=25  (0 added, 15 deleted, 10 changed)
OCL=30892
CL=30892

15 years agobug163 bug164 bug166
Russ Cox [Tue, 30 Jun 2009 00:46:22 +0000 (17:46 -0700)]
bug163 bug164 bug166

R=ken
OCL=30889
CL=30889

15 years agobug041 not a bug.
Russ Cox [Tue, 30 Jun 2009 00:21:33 +0000 (17:21 -0700)]
bug041 not a bug.
can now forward declare across files

R=r
DELTA=15  (0 added, 15 deleted, 0 changed)
OCL=30873
CL=30880

15 years agoio.StringBytes -> strings.Bytes
Russ Cox [Mon, 29 Jun 2009 22:24:23 +0000 (15:24 -0700)]
io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer

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

R=r
OCL=30861
CL=30872

15 years agointeger encode/decode
Rob Pike [Mon, 29 Jun 2009 22:15:07 +0000 (15:15 -0700)]
integer encode/decode

R=rsc
DELTA=185  (175 added, 10 deleted, 0 changed)
OCL=30863
CL=30871