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

917 Commits

Author SHA1 Message Date
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
Russ Cox
189153ed13 fix error that gcc thinks is a warning
R=ken
OCL=32264
CL=32386
2009-07-28 17:02:05 -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
Phil Pennock
d6f89c69c4 Support use of $GOBINDIR to override $HOME/bin
R=r,gri,rsc
APPROVED=rsc
DELTA=53  (12 added, 6 deleted, 35 changed)
OCL=31822
CL=32282
2009-07-28 11:23:24 -07:00
Russ Cox
18840f5429 constant keys for array initializers
R=ken
OCL=32261
CL=32261
2009-07-27 17:58:25 -07:00
Russ Cox
b7dd312c93 bug170; fix test for bug175
R=ken
OCL=32255
CL=32255
2009-07-27 17:24:07 -07:00
Russ Cox
a587d9a73f multiple return in := bug
R=ken
OCL=32253
CL=32253
2009-07-27 16:59:10 -07:00
Russ Cox
059bbdd340 print(1<<x)
R=ken
OCL=32252
CL=32252
2009-07-27 16:17:09 -07:00
Russ Cox
30228a3bc6 avoid register computing len(x), cap(x)
for slice or string x.

R=ken
OCL=32249
CL=32249
2009-07-27 15:55:27 -07:00
Russ Cox
811e59f2fa named string type bugs
R=ken
OCL=32244
CL=32244
2009-07-27 15:16:28 -07:00
Russ Cox
03b25a92a3 catch
a := true;
	a |= a;
in the front end.

R=ken
OCL=32240
CL=32243
2009-07-27 14:55:14 -07:00
Russ Cox
0b2683d1ee do not insert implicit "return;" in empty function body
R=ken
OCL=32239
CL=32239
2009-07-27 14:36:32 -07:00
Russ Cox
335b3855c6 a little more 6l cleanup
R=r
DELTA=51  (14 added, 24 deleted, 13 changed)
OCL=31968
CL=31971
2009-07-21 17:18:32 -07:00
Russ Cox
5a74c0b6ba do not use ONONAMEs for line number information,
just like ONAME etc.

R=ken
OCL=31964
CL=31964
2009-07-21 16:38:56 -07:00
Rob Pike
304b7954e8 add a .interp section and fix vaddr in INTERP prog.
R=rsc
DELTA=16  (9 added, 3 deleted, 4 changed)
OCL=31956
CL=31963
2009-07-21 16:31:35 -07:00
Rob Pike
3d42e691b9 make 6l produce dynamically linked binaries (although they are fully statically linked as far
as go is concerned).  the -d flag is now flipped; as on the mac, -d disables dynamic.

much remains to be improved to move the output closer to the gcc format.

R=rsc
DELTA=366  (310 added, 30 deleted, 26 changed)
OCL=31929
CL=31951
2009-07-21 15:10:47 -07:00
Russ Cox
1d51978fed fix cut-and-paste bugs in error messages
R=ken
OCL=31890
CL=31890
2009-07-20 17:41:18 -07:00
Russ Cox
6e1ad041f7 avoid strncat in formatters.
the n argument to strncat is the maximum
number of bytes to read from the src,
not the total size of the destination.

R=ken
OCL=31871
CL=31875
2009-07-20 14:16:25 -07:00
Russ Cox
f664d0e904 explain selectsend problem
R=ken
OCL=31865
CL=31867
2009-07-20 13:29:56 -07:00
Rob Pike
f687fb7e73 6l cleanup: last set of magic numbers for elf64 moved to ld/elf64*.
R=rsc
DELTA=68  (21 added, 28 deleted, 19 changed)
OCL=31857
CL=31864
2009-07-20 13:19:47 -07:00
Rob Pike
fe734d8630 clean up generation of exec header.
make endianness explicit when writing values.

R=rsc
DELTA=129  (37 added, 7 deleted, 85 changed)
OCL=31826
CL=31854
2009-07-20 10:08:48 -07:00
Rob Pike
94d89ede1c take care of a few more magic numbers
R=rsc
DELTA=51  (41 added, 0 deleted, 10 changed)
OCL=31815
CL=31818
2009-07-17 17:32:34 -07:00
Rob Pike
b63d40a53e count SHdrs and PHdrs and write them out as a unit
R=rsc
DELTA=181  (93 added, 63 deleted, 25 changed)
OCL=31802
CL=31812
2009-07-17 16:34:58 -07:00
Rob Pike
e86dcf1603 more elf64 support: phdrs, constants
R=rsc
DELTA=130  (68 added, 6 deleted, 56 changed)
OCL=31798
CL=31798
2009-07-17 15:09:17 -07:00
Russ Cox
35e5906f91 another baby step.
excluding import data,
no yacc node has type Type* anymore.

0 reduce/reduce conflicts.

R=ken
OCL=31793
CL=31795
2009-07-17 14:42:14 -07:00
Rob Pike
1593b1fc23 First steps towards cleaner support for ELF64 in 6l.
R=rsc
DELTA=337  (165 added, 119 deleted, 53 changed)
OCL=31786
CL=31794
2009-07-17 14:32:37 -07:00
Russ Cox
db508ccbff baby step: const decls can refer to future
consts in the same factored block

	const (
		X = Y;
		Y = 2;
	)

R=ken
OCL=31782
CL=31782
2009-07-17 13:38:16 -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
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
Robert Griesemer
59ee0373fc - removed TODO, minor adjustments
R=rsc
DELTA=16  (6 added, 1 deleted, 9 changed)
OCL=31638
CL=31641
2009-07-14 16:30:06 -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
Russ Cox
10e995fba8 dead code
R=r
DELTA=20  (0 added, 20 deleted, 0 changed)
OCL=31584
CL=31598
2009-07-14 09:28:42 -07:00
Russ Cox
be16caf872 step toward no function prototypes.
delay evaluation of most types (all but func)
from parse time to type check time.

R=ken
OCL=31585
CL=31585
2009-07-13 23:38:39 -07:00
Russ Cox
a6799963ef update 6g to new REGARG convention.
silence gcc warning.

R=ken
OCL=31583
CL=31583
2009-07-13 23:30:30 -07:00
Russ Cox
e11447f7da bug148.
R=ken
OCL=31582
CL=31582
2009-07-13 23:29:44 -07:00
Kai Backman
60d223a418 added missing pieces required by reflection
R=rsc
APPROVED=rsc
DELTA=61  (40 added, 18 deleted, 3 changed)
OCL=31502
CL=31580
2009-07-13 22:06:28 -07:00
Kai Backman
0e2cce70cb tiny naming cleanup
R=rsc
APPROVED=rsc
DELTA=17  (0 added, 0 deleted, 17 changed)
OCL=31503
CL=31579
2009-07-13 22:04:24 -07:00
Kai Backman
7258bac6e8 fix bug in codegen when we modified move instruction instead
of text.

R=rsc
APPROVED=rsc
DELTA=3  (1 added, 2 deleted, 0 changed)
OCL=31575
CL=31575
2009-07-13 20:33:59 -07:00
Russ Cox
9e2f2fcd2e compilers were inconsistent about
whether no register argument was
REGARG == 0 or REGARG < 0.
use REGARG < 0 because arm needs 0 for R0.

R=ken
OCL=31562
CL=31566
2009-07-13 19:20:43 -07:00
Russ Cox
29e93590b0 fix undefined function error.
before:
	mainstart: undefined: main·init in mainstart
	mainstart: branch out of range in mainstart
	(95)    CALL    ,0(PC) [main·init]
	mainstart: undefined: main·main in mainstart
	mainstart: branch out of range in mainstart
	(97)    CALL    ,0(PC) [main·main]
	mainstart: doasm: notfound from=6f to=6f (95)    CALL    ,
	mainstart: doasm: notfound from=6f to=6f (97)    CALL    ,
	mainstart: doasm: notfound from=6f to=6f (95)    CALL    ,
	mainstart: doasm: notfound from=6f to=6f (97)    CALL    ,
	mainstart: doasm: notfound from=6f to=6f (95)    CALL    ,
	mainstart: doasm: notfound from=6f to=6f (97)    CALL    ,

after:
	mainstart: undefined: main·init in mainstart
	mainstart: undefined: main·main in mainstart

R=r
DELTA=7  (1 added, 0 deleted, 6 changed)
OCL=31555
CL=31555
2009-07-13 16:48:09 -07:00
Robert Griesemer
7b7b83ba1b ebnflint command
- basic verification of EBNF grammars
- tested with (and has testcase for) go_spec.html

R=rsc
DELTA=150  (148 added, 0 deleted, 2 changed)
OCL=31481
CL=31517
2009-07-13 10:26:58 -07:00
Kai Backman
092d6290d0 fixed typo where output arguments where pushed on to R0
instead of SP.

R=rsc
APPROVED=rsc
DELTA=13  (3 added, 7 deleted, 3 changed)
OCL=31488
CL=31501
2009-07-12 22:12:33 -07:00
Russ Cox
0dadc4fe4f cleanup in preparation for new scoping.
walkstate -> walkstmt
walktype -> walkexpr; stmts moved to walkstmt

walktype and friends have a final Node **init
argument that can have side effects appended,
making it more explicit when they do and do not happen.
this replaces the old global addtop and addtotop.

delete switch map and interface conversion cases
(dropped from the language months ago).

R=ken
OCL=31465
CL=31468
2009-07-10 16:29:26 -07:00
Ken Thompson
ed124a971e segfault
R=rsc
OCL=31467
CL=31467
2009-07-10 16:12:21 -07:00
Robert Griesemer
981f4b43ac mention file name only once in error message
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31450
CL=31452
2009-07-10 10:01: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
Russ Cox
7472f4c951 bug168 (dsymonds) + fix
R=ken
OCL=31399
CL=31399
2009-07-09 12:08:50 -07:00
Ken Thompson
5ff7d84892 segment fault
R=rsc
OCL=31396
CL=31396
2009-07-09 11:41:06 -07:00
Ken Thompson
a68b1da3cc another nil reference
R=rsc
OCL=31373
CL=31373
2009-07-08 17:58:15 -07:00
Russ Cox
903d28bd1e 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
2009-07-08 16:39:19 -07:00
Russ Cox
7c534e1bd2 the ld-supplied typestrings are now obsolete
R=r
DELTA=167  (0 added, 167 deleted, 0 changed)
OCL=31304
CL=31316
2009-07-07 17:35:45 -07:00
Russ Cox
42af80348c method expansion bugs
R=ken
OCL=31310
CL=31310
2009-07-07 16:05:55 -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
a1b64821f8 bug167
R=ken
OCL=31295
CL=31295
2009-07-07 11:48:22 -07:00
Russ Cox
541e638f9b 6g, 8g: generate data structures for new reflect interface (CL 31107)
R=ken
OCL=31122
CL=31278
2009-07-07 11:03:04 -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
27432d67ec 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
2009-07-07 10:07:15 -07:00
Russ Cox
0417aafe75 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
2009-07-06 23:42:57 -07:00
Russ Cox
0aa1b1508a shift typechecking bugs
x << "a"
	1 << int(2)

R=ken
OCL=31244
CL=31244
2009-07-06 23:33:17 -07:00
Kai Backman
908cd8f857 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
2009-07-06 23:04:56 -07:00
Russ Cox
2acbc37166 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
2009-07-06 22:31:20 -07:00
Russ Cox
74b546aefd 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
2009-07-06 22:25:54 -07:00
Russ Cox
ef4ddd63f8 another piece for cross-file forward struct declarations.
R=ken
OCL=31233
CL=31233
2009-07-06 21:39:18 -07:00
Russ Cox
a14b28a24d 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
2009-07-06 21:37:29 -07:00
Russ Cox
7af032b87b fix forward struct declarations
R=ken
OCL=31230
CL=31230
2009-07-06 18:05:11 -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
53ebd163c6 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
2009-07-06 16:29:28 -07:00
Russ Cox
769919c4ee 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
2009-07-06 16:05:48 -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
Kai Backman
cd4aab62e3 sudoaddable odot
R=rsc
APPROVED=rsc
DELTA=7  (0 added, 1 deleted, 6 changed)
OCL=31189
CL=31191
2009-07-06 09:23:41 -07:00
Russ Cox
6da41be2d3 fix float32 comparison. was doing l op l instead of l op r.
R=ken
OCL=31190
CL=31190
2009-07-06 09:05:33 -07:00
Kai Backman
86987055a3 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
2009-07-06 06:42:37 -07:00
Kai Backman
a7735f8a16 fixed bug that cause -g to segfault
R=rsc
APPROVED=rsc
DELTA=48  (30 added, 16 deleted, 2 changed)
OCL=31152
CL=31187
2009-07-06 06:36:25 -07:00
Ken Thompson
6bb3c48d3d another seg fault
R=r
OCL=31156
CL=31156
2009-07-04 13:59:08 -07:00
Russ Cox
db312fa8de bug163
R=ken
OCL=31149
CL=31149
2009-07-03 13:34:05 -07:00
Russ Cox
75fe1303c1 maps have == so maps are okay as map keys.
alignment issue is fixed.

R=ken
OCL=31124
CL=31144
2009-07-03 09:44:59 -07:00
Kai Backman
84ef63b9d5 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
2009-07-02 21:35:39 -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
519a70da54 fix bug in $GOROOT handling: error calling Getenv.
R=gri
OCL=31047
CL=31047
2009-07-02 09:47:25 -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
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
Russ Cox
9435dc2bdf allow forward declaration of struct in another file
(in the same package).

allow forward method declaration to be satisfied
by implementation in another file (in the same package).
all methods must be declared in the same file
as the receiver type.

R=ken
OCL=30864
CL=30869
2009-06-29 15:13:37 -07:00
Rob Pike
104d0246ea fix gobuild bug
R=rsc
DELTA=4  (3 added, 0 deleted, 1 changed)
OCL=30845
CL=30845
2009-06-29 11:19:38 -07:00
Kai Backman
b2871b727e working on bgen
- removed smallint optimizations
- lifted raddr from 5c
- add back %R, was used in gc/* causing -g to crash
- changed naddr OREGISTER to emit D_REG instead of D_OREG

R=rsc
APPROVED=rsc
DELTA=74  (38 added, 28 deleted, 8 changed)
OCL=30799
CL=30822
2009-06-26 22:04:30 -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
Kai Backman
d6197d94b5 Adding more debug output when 5l encounters a bad op
combination.

R=rsc
APPROVED=rsc
DELTA=69  (68 added, 0 deleted, 1 changed)
OCL=30798
CL=30801
2009-06-26 13:44:25 -07:00
Kai Backman
4556c04d8b more changes to make 5g code generation arm compatible.
R=rsc
APPROVED=rsc
DELTA=72  (12 added, 52 deleted, 8 changed)
OCL=30748
CL=30793
2009-06-26 04:08:20 -07:00
Russ Cox
480f51243c bug165
R=ken
OCL=30783
CL=30783
2009-06-25 21:02:39 -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
70e232e668 separate local path lookup from standard package directories
R=ken
OCL=30760
CL=30779
2009-06-25 20:15:56 -07:00
Russ Cox
cf370a6206 add ./ to imports where necessary
R=r
DELTA=51  (4 added, 4 deleted, 43 changed)
OCL=30759
CL=30778
2009-06-25 20:13:56 -07:00
Russ Cox
5851a1b5ad allow
package main
type t interface
type t interface{ m(map[t]bool) }
type m map[t] int

making it work without the forward declaration will require a second pass.

R=ken
OCL=30773
CL=30773
2009-06-25 18:19:05 -07:00
Russ Cox
1ea28570ec the any fix was too aggressive; allow any in any import.
R=ken
OCL=30768
CL=30768
2009-06-25 16:57:56 -07:00
Russ Cox
fa6df47986 package main
const foo = []int{1,2}

x.go:3: expression must be a constant

instead of

x.go:3: fatal error: gettype: addtop

R=ken
OCL=30767
CL=30767
2009-06-25 16:42:08 -07:00
Russ Cox
70a273476b better error; clean up lineno in a few places
wreck.mtv=; cat x.go
package main
var x = string.Split()
wreck.mtv=; 6g x.go
x.go:2: type string used as expression
x.go:2: undefined DOT Split on string
x.go:3: illegal types for operand: AS
	undefined
wreck.mtv=;

BUG=1938751
R=ken
OCL=30766
CL=30766
2009-06-25 16:32:33 -07:00
Russ Cox
4bce6d455f package main
func foo(y) { }

was:
x.go:2: NONAME-y G0 u(1) a(1) l(77) x(-1000000000) is not a type

now:
x.go:2: y is not a type

R=ken
OCL=30764
CL=30764
2009-06-25 16:25:06 -07:00
Russ Cox
30f2799f88 disable "any" except during canned imports.
new flag -A enables it during mkbuiltin.
avoids mysterious errors in programs
that refer to any accidentally.

R=ken
OCL=30763
CL=30763
2009-06-25 16:22:46 -07:00
Russ Cox
111ae83bb7 6g: update for spec change CL 30586
R=ken
OCL=30593
CL=30756
2009-06-25 14:44:45 -07:00