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

204 Commits

Author SHA1 Message Date
Russ Cox
60ff8cc86f address bug193 and add note to spec about it.
R=ken
OCL=35920
CL=35920
2009-10-20 08:27:14 -07:00
Russ Cox
02fd255a14 bug162, over and over
R=ken
OCL=35919
CL=35919
2009-10-20 08:03:43 -07:00
Russ Cox
a15648658f bug196
R=ken
OCL=35905
CL=35905
2009-10-19 21:10:29 -07:00
Russ Cox
8fffa1d698 bug190.
also eliminate float80 dregs

R=ken
OCL=35894
CL=35896
2009-10-19 18:47:37 -07:00
Russ Cox
22a5c78f44 rename sys functions to runtime,
because they are in package runtime.

another step to enforcing package boundaries.

R=r
DELTA=732  (114 added, 93 deleted, 525 changed)
OCL=35811
CL=35824
2009-10-15 23:10:49 -07:00
Russ Cox
2372408189 sort errors by line number
turn off testdclstack and "not used" errors
when there are syntax errors.

BUG=2181825
R=ken
OCL=35606
CL=35608
2009-10-12 11:03:48 -07:00
Russ Cox
d515063588 better handling of mistaken top-level variable
references during the parsing of :=.  the base
problem is that when reading

	a,b,c,d

the parser makes those refer to existing variables,
which might create a few stub top-level ones
for undefined names, but then if a := is the next
token, we need to undo those stubs.

this was causing problems in multifile packages
in which one file used a := variable named rpc
and the other imported a package named rpc.

R=ken
OCL=35446
CL=35446
2009-10-07 14:55:12 -07:00
Russ Cox
a95ee61aea ideal bools and related fixes
R=ken
OCL=34859
CL=34865
2009-09-21 15:45:55 -07:00
Russ Cox
73e52ae971 check for unused imports
R=ken
OCL=34732
CL=34756
2009-09-17 16:42:10 -07:00
Russ Cox
e780fa8669 defining package block names must override
universe block names.

BUG=2097244
R=ken
OCL=34295
CL=34473
2009-09-09 01:01:39 -07:00
Russ Cox
5438be4541 write-only variable _
R=ken
OCL=34465
CL=34470
2009-09-08 23:16:19 -07:00
Ken Thompson
18f2e360a0 composit literals
plateau - more to come

R=rsc
OCL=34413
CL=34413
2009-09-05 20:32:24 -07:00
Russ Cox
107d404378 stop using filename for disambiguation within a package.
R=ken
OCL=34339
CL=34341
2009-09-03 15:23:21 -07:00
Russ Cox
a1391c2d13 fix one bug involving [...] constructors.
added iant's bug202 (in main code)
and ken's bug203 (in init function).
bug187 remains at large.

R=ken
OCL=34293
CL=34293
2009-09-02 23:26:13 -07:00
Russ Cox
ee2d5128d6 the last bug involving type hashes
R=ken
OCL=34244
CL=34249
2009-09-02 09:09:32 -07:00
Russ Cox
bebe06a784 type switch bug involving function parameter names
R=ken
OCL=34232
CL=34232
2009-09-01 18:04:49 -07:00
Ken Thompson
6fceadbba3 cleanup getting ready for static init
R=rsc
OCL=34090
CL=34090
2009-08-30 14:43:33 -07:00
Russ Cox
3443656bce clean up ideal handling; reject attempts
to write type descriptors for ideal types

R=ken
OCL=33958
CL=33958
2009-08-27 11:16:34 -07:00
Russ Cox
7b29dbb866 symbol bugs.
do not emit unreachable data symbols.

R=austin
DELTA=103  (71 added, 4 deleted, 28 changed)
OCL=33325
CL=33622
2009-08-20 17:33:28 -07:00
Russ Cox
5600435fe4 produce diagnostic for
import "fmt"
var fmt = 1

R=ken
OCL=33556
CL=33561
2009-08-19 17:27:08 -07:00
Russ Cox
38df5ec58d try to do better line number reporting
in the presence of yacc lookahead.
better but still not perfect

R=ken
OCL=33541
CL=33541
2009-08-19 15:18:08 -07:00
Russ Cox
63aeaa2a03 fix import dot bug
R=ken
OCL=33526
CL=33528
2009-08-19 11:32:46 -07:00
Russ Cox
d594639087 rm outfile if 6g exits with an error
R=ken
OCL=33134
CL=33141
2009-08-12 17:58:53 -07:00
Russ Cox
a92610208e delete code for forward type declarations
R=ken
OCL=33108
CL=33113
2009-08-12 14:41:13 -07:00
Russ Cox
7732f79daa fix indirect error
x.go:3: invalid indirect of X (type int)

was
x.go:3: invalid indirect of nil

R=ken
OCL=33008
CL=33008
2009-08-10 18:19:32 -07:00
Ken Thompson
34f76b5de5 1. integer division by a constant done.
2. moved functions from 6g to gc
for portability to other families.
3. added rotate-carry instructions to
peek and reg.

R=rsc
OCL=32946
CL=32946
2009-08-09 15:16:06 -07:00
Russ Cox
aa7bd48389 bug183 - embedded vs non-embedded struct field in eqtype
R=ken
OCL=32888
CL=32888
2009-08-07 13:23:09 -07:00
Russ Cox
b648716ee9 forward declarations not necessary.
still to do:
	* initializer cycle detection
	* nicer error for type checking cycles

R=ken
OCL=32855
CL=32880
2009-08-07 12:50:26 -07:00
Russ Cox
2609731736 delay range processing. old2new is gone
R=ken
OCL=32780
CL=32780
2009-08-05 02:33:30 -07:00
Russ Cox
54b403723b delay := processing
R=ken
OCL=32772
CL=32772
2009-08-05 00:42:44 -07:00
Russ Cox
a121410541 make Syms smaller.
collapse a lot of duplication in dcl.c
switch to NodeList* from Dcl*

R=ken
OCL=32770
CL=32770
2009-08-04 22:59:23 -07:00
Russ Cox
aa347c4a0d move various bits of code around
and delete some dead code.
no actual changes here.

R=ken
OCL=32764
CL=32764
2009-08-04 18:43:32 -07:00
Russ Cox
f7a867e1a6 move select into its own file.
split into typecheck + walk

R=ken
OCL=32726
CL=32726
2009-08-04 12:57:48 -07:00
Russ Cox
9dc22b6d6f more 6g reorg; checkpoint.
typecheck.c is now responsible for all type checking
except for assignment and function argument "..."

R=ken
OCL=32661
CL=32667
2009-08-03 11:58:52 -07:00
Russ Cox
a2b8e38766 checkpoint; still plenty to clean up
R=ken
OCL=32576
CL=32580
2009-07-31 09:29:28 -07:00
Russ Cox
b754b4348f delete some code from walkexpr that is now
handled by typecheck.

second switch is gone

move floating point minus into back end

R=ken
OCL=32558
CL=32558
2009-07-30 18:56:44 -07:00
Russ Cox
ff3a73b407 typechecking checkpoint.
started to move typechecking to another file.
can build entire tree still, but lots of work
is duplicated.  much to clean up.

R=ken
OCL=32536
CL=32543
2009-07-30 16:53:08 -07:00
Russ Cox
9271c6402e introduce typecheck pass before walkexpr.
not complete but compiler still works.

R=ken
OCL=32424
CL=32426
2009-07-29 12:47:51 -07:00
Russ Cox
056940d84b convert walkexpr to take Node**; drop indir
R=ken
OCL=32421
CL=32421
2009-07-29 12:00:34 -07:00
Russ Cox
4152b925f9 expression printer; %#N
R=ken
OCL=32419
CL=32419
2009-07-29 11:51:34 -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
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
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
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
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
e11447f7da bug148.
R=ken
OCL=31582
CL=31582
2009-07-13 23:29:44 -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
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
42af80348c method expansion bugs
R=ken
OCL=31310
CL=31310
2009-07-07 16:05:55 -07:00