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

204 Commits

Author SHA1 Message Date
Russ Cox
aacfbb461b 6g:
* print int as int, not P.int
	* write type info for non-exported types
	   in its own new section.

ar:
	skip over rest of line after $$

R=ken
OCL=17568
CL=17568
2008-10-21 14:34:45 -07:00
Russ Cox
28912ce03f fix compiler warnings
R=r
DELTA=44  (10 added, 9 deleted, 25 changed)
OCL=17502
CL=17502
2008-10-20 15:26:38 -07:00
Russ Cox
1163b1db6f diagnose various conversion problems
R=ken
OCL=17320
CL=17320
2008-10-16 15:59:31 -07:00
Ken Thompson
1bf38484d1 interface on arbitrary types
global signatures for basic types

R=r
OCL=17238
CL=17240
2008-10-15 17:08:10 -07:00
Russ Cox
0adc1db757 until 6g implements it, warn about using int in interface.
R=ken
OCL=16935
CL=16935
2008-10-10 16:14:13 -07:00
Russ Cox
b4f8e01acb more interface checks:
- pointer to interface cannot have methods
	- record type names for better runtime error

R=r,ken
DELTA=85  (80 added, 0 deleted, 5 changed)
OCL=16658
CL=16722
2008-10-08 09:21:57 -07:00
Russ Cox
74e2e087e2 change type names to go live at the name, so that
type T struct {
		next *T
	}

and

	type T *struct {
		next T
	}

are valid without needing forward declarations.

add "type T struct" syntax for forward struct declarations.

add "type T interface" syntax, but commented out
	(need to fix semicolons first)

R=ken
DELTA=452  (259 added, 115 deleted, 78 changed)
OCL=16580
CL=16584
2008-10-06 16:44:17 -07:00
Ken Thompson
f25843e65e bug 026
R=r
OCL=16494
CL=16494
2008-10-04 15:17:49 -07:00
Russ Cox
45f4e38506 silence gcc warnings
R=ken
OCL=16449
CL=16466
2008-10-03 16:23:02 -07:00
Russ Cox
b8babed7c2 new import/export format
package flag
	export type flag.Flag struct { name flag.string; usage flag.string; \
		value flag.Value; next *flag.Flag }
	type flag.string string
	type flag.Value interface { AsBool () (? *flag.BoolValue); \
		AsInt () (? *flag.IntValue); AsString () (? *flag.StringValue); \
		IsBool () (? flag.bool); IsInt () (? flag.bool); IsString () (? flag.bool); \
		Str () (? flag.string); ValidValue (str flag.string) (? flag.bool) }
	type flag.BoolValue struct { val flag.bool; p *flag.bool }
	type flag.IntValue struct { val flag.int64; p *flag.int64 }
	type flag.StringValue struct { val flag.string; p *flag.string }
	type flag.bool bool
	func (e *flag.StringValue) AsBool () (? *flag.BoolValue)
	func (e *flag.StringValue) AsInt () (? *flag.IntValue)
	...

the \ continuations are for this message, not real.

changed delimiter for import from (( )) to $$ $$.

replaced mksys.bash with mksys.c

changed sys.go to use leading export,
	fake package name is now SYS not foop

don't always require ; on forward func decls

R=ken,r
DELTA=1827  (446 added, 1083 deleted, 298 changed)
OCL=16433
CL=16463
2008-10-03 16:15:55 -07:00
Ken Thompson
8877d27b40 interfaces of all types
R=r
OCL=16462
CL=16462
2008-10-03 16:12:21 -07:00
Ken Thompson
ed139c1e37 more on arbitrary receiver types
this CL passes the tests, but should
be considered unstable

R=r
OCL=16390
CL=16390
2008-10-02 20:51:10 -07:00
Ken Thompson
f21e731c71 added printn and panicn
prints that insert spaces and new line

R=r
OCL=16370
CL=16370
2008-10-02 14:38:07 -07:00
Russ Cox
8dc08788ef remove ( ) around mismatch type prints,
so that they don't look like functions.

R=ken
OCL=16244
CL=16244
2008-09-30 15:38:41 -07:00
Russ Cox
387c1bc31e pretty types; use 6g -t to disable
R=ken
OCL=16240
CL=16242
2008-09-30 15:35:40 -07:00
Russ Cox
4d571c9093 fix up arg list parsing to handle any names:
type t1 int;
type t2 int;
type t3 int;
func f1(t1, t2, t3);
func f2(t1, t2, t3 bool);
func f3(t1, t2, x t3);
func f4(*t2, x t3);	// error: cannot mix
func f5(t1, *t3);
func (x *t1) f6(y *[]t2) (t1, *t3);
func f7() (int, *string);
func f8(t1, *t2, x t3);	// error: cannot mix
func f9() (x int, *string);
func f10(*t2, t3);

R=ken
OCL=16202
CL=16210
2008-09-30 12:53:11 -07:00
Ken Thompson
89ac5618ac toward methods on any type
R=r
OCL=16068
CL=16068
2008-09-28 20:22:31 -07:00
Ken Thompson
4332e0a546 remove extraneous print
R=r
OCL=15666
CL=15666
2008-09-22 17:29:12 -07:00
Ken Thompson
8231e94520 now method/interface code
R=r
OCL=15627
CL=15627
2008-09-22 12:16:19 -07:00
Ken Thompson
39a4b1421f bug103 - but the fix caused other
things to break. hopefully all fixed
now.

R=r
OCL=15597
CL=15597
2008-09-20 14:59:15 -07:00
Ken Thompson
9dbaab54d1 rewriting bugs
R=r
OCL=14810
CL=14810
2008-09-04 12:21:10 -07:00
Ken Thompson
182f91ffe0 map literals
R=r
OCL=14759
CL=14759
2008-09-03 14:40:22 -07:00
Ken Thompson
4539ced714 array literals
R=r
OCL=14756
CL=14756
2008-09-03 14:09:29 -07:00
Ken Thompson
1423bf3dc4 structure literals
R=r
OCL=14735
CL=14735
2008-09-02 19:11:25 -07:00
Ken Thompson
9c5669bd0b bug in conv(string, bytearray)
R=r
OCL=14732
CL=14732
2008-09-02 16:21:30 -07:00
Ken Thompson
c6130e9f1f get rid of static/dynamic array distinction
R=r
OCL=14634
CL=14634
2008-08-28 15:17:37 -07:00
Ken Thompson
66a603c986 arrays
R=r
OCL=14603
CL=14603
2008-08-27 17:28:30 -07:00
Ken Thompson
4797523572 fixed bugs in const/case
R=r
DELTA=138  (75 added, 12 deleted, 51 changed)
OCL=14129
CL=14131
2008-08-12 14:04:03 -07:00
Ken Thompson
2b75556436 export large constants
R=r
DELTA=37  (31 added, 4 deleted, 2 changed)
OCL=14089
CL=14089
2008-08-11 13:22:04 -07:00
Ken Thompson
9c2ade358d mp constants
R=r
DELTA=381  (142 added, 26 deleted, 213 changed)
OCL=14011
CL=14016
2008-08-08 17:13:31 -07:00
Ken Thompson
989676d2ba add 'export' adjectives to external
var, const and type declarations.

R=r
DELTA=49  (12 added, 28 deleted, 9 changed)
OCL=13791
CL=13791
2008-08-03 18:47:02 -07:00
Russ Cox
9aad9fef76 make 6a, 6c, 6g, 6l, libmach_amd64 build on 64-bit gcc.
these guys really really want long to be 32-bits,
so ,s/long/int32/ (and then manual fixup).
still passes all tests.

(i started out looking for just those longs that
needed to be int32 instead, and it was just too hard
to track them down one by one.)

the longs were rare enough that i don't think
it will cause integration problems.

R=ken
OCL=13787
CL=13789
2008-08-03 17:25:15 -07:00
Ken Thompson
ece3e57c85 read select
R=r
APPROVED=r
DELTA=120  (108 added, 0 deleted, 12 changed)
OCL=13468
CL=13468
2008-07-25 11:58:26 -07:00
Ken Thompson
cb9b1038db select
R=r
APPROVED=r
DELTA=638  (433 added, 21 deleted, 184 changed)
OCL=13426
CL=13438
2008-07-24 15:57:30 -07:00
Ken Thompson
b78676a49d start of select
random bugs fixed

SVN=128149
2008-07-20 20:13:07 -07:00
Ken Thompson
0ca551fc36 loop in subtype
SVN=127933
2008-07-17 18:15:05 -07:00
Ken Thompson
9e2d185040 div bug
[]ptr bug
proc reuses old g* structures
differnt assignment of offsets to parameters

SVN=127888
2008-07-17 15:03:39 -07:00
Ken Thompson
97cab903af chan
SVN=126959
2008-07-13 16:20:27 -07:00
Ken Thompson
3856e45e03 more on channels
arg space magic number for morestack

SVN=126936
2008-07-12 13:08:53 -07:00
Ken Thompson
81b325db1b a,b := fun()
SVN=125998
2008-07-03 17:41:05 -07:00
Ken Thompson
d915b96100 new iota
SVN=125984
2008-07-03 16:41:32 -07:00
Ken Thompson
d3237f9a2a more line numbers
SVN=125265
2008-06-28 17:27:39 -07:00
Ken Thompson
57d80398e6 line numbers
SVN=125228
2008-06-27 17:35:42 -07:00
Ken Thompson
75937c2a16 better line numbers
SVN=125018
2008-06-26 17:54:44 -07:00
Ken Thompson
e90ae879d6 autolib (#pragma lib)
added to 6g to autoload
the included import files.

SVN=124759
2008-06-25 20:22:10 -07:00
Ken Thompson
78c8dec944 bug miscalculating ullman
in CALLMETH/DOTMETH

SVN=124321
2008-06-24 10:30:33 -07:00
Ken Thompson
54abac678a redeclarations of variables in the same block.
half-step toward multivalued map indexing

SVN=124019
2008-06-21 15:11:29 -07:00
Ken Thompson
c242b53d22 more maps
more semi-colons
type assignment of constants

SVN=123278
2008-06-17 22:33:32 -07:00
Ken Thompson
7131bf476c SVN=123250 2008-06-17 18:02:06 -07:00
Ken Thompson
e1a06ccc80 now checks for lvalue/rvalue context of
expressions.
start of generics for calling builtin
     functions
start of map type
'any' demoted from reserved word to type

SVN=122808
2008-06-15 20:24:30 -07:00
Ken Thompson
efec14bc5a plan9 line numbers and line table
SVN=122793
2008-06-13 18:16:23 -07:00
Ken Thompson
343f5aa7b4 better import/export
SVN=122584
2008-06-12 21:48:56 -07:00
Ken Thompson
e372be9e76 code gen bug in ++ and --
SVN=121476
2008-06-06 13:54:59 -07:00
Rob Pike
0cafb9ea3d Add compiler source to new directory structure
SVN=121164
2008-06-04 14:37:38 -07:00