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

68 Commits

Author SHA1 Message Date
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
a95ee61aea ideal bools and related fixes
R=ken
OCL=34859
CL=34865
2009-09-21 15:45:55 -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
a92610208e delete code for forward type declarations
R=ken
OCL=33108
CL=33113
2009-08-12 14:41:13 -07:00
Russ Cox
66bb399fdd whole-package compilation
R=ken
OCL=33063
CL=33095
2009-08-12 13:18:19 -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
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
dbe004efe4 delayed evaluation of var blocks
R=ken
OCL=32750
CL=32753
2009-08-04 16:53:06 -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
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
Russ Cox
8f4af6d205 gc: grammar cleanup:
* no longer distinguishes const, var, type, package names.
  * all the predefined names are not tokens anymore.

R=ken
OCL=29326
CL=29985
2009-06-06 12:46:38 -07:00
Russ Cox
4beac9985b simplifying grammar: delete LBASETYPE and LACONST.
take 2

R=ken
OCL=29304
CL=29306
2009-05-22 22:46:06 -07:00
Russ Cox
ca2fe5d8bd Automated g4 rollback of changelist 29302.
*** Reason for rollback ***

too many files included

*** Original change description ***

simplifying grammar: delete LBASETYPE and LACONST

R=ken
OCL=29303
CL=29303
2009-05-22 22:43:57 -07:00
Russ Cox
2a4dcfffc9 simplifying grammar: delete LBASETYPE and LACONST
R=ken
OCL=29300
CL=29302
2009-05-22 22:42:12 -07:00
Russ Cox
b3533dfd72 6g:
new type equality restrictions
	better handling of renamed packages
	"sys" is no longer available to programs

R=ken
OCL=28553
CL=28578
2009-05-08 15:40:31 -07:00
Russ Cox
d4fa253837 eqtype(t1, t2, 0) => eqtype(t1, t2)
R=ken
OCL=28559
CL=28562
2009-05-08 14:40:38 -07:00
Russ Cox
8f194bf5ff make 6g constants behave as ken proposes. (i hope.)
various bug fixes and tests involving constants.

test/const1.go is the major new test case.

R=ken
OCL=26216
CL=26224
2009-03-12 19:04:38 -07:00
Russ Cox
73dd4a37f9 fix export bug Rob tripped over.
the lexer is already hiding names,
so this clumsy hack is no longer necessary.

R=ken
OCL=24783
CL=24783
2009-02-10 13:57:31 -08:00
Russ Cox
4a43198390 update compiler to new func rules
R=ken
OCL=23958
CL=23961
2009-01-30 14:39:42 -08:00
Russ Cox
0183baaf44 * delete export
* rename init functions

R=ken
OCL=23122
CL=23126
2009-01-20 14:40:00 -08:00
Russ Cox
360962420c casify, cleanup sys
R=r
OCL=22978
CL=22984
2009-01-16 14:58:14 -08:00
Russ Cox
dec12d3654 re-export of bools was changing
format from hex to decimal, confusing
ar's strcmp-based value comparison.

switched export format to "true" or "false"
to keep bools separate from ints.

R=ken
OCL=22944
CL=22944
2009-01-16 10:45:28 -08:00
Russ Cox
605d0746c5 catch export on func.
print names in message.

R=ken
OCL=22891
CL=22891
2009-01-15 16:43:51 -08:00
Russ Cox
3decb42e6f add warning for export of lowercase too.
R=ken
OCL=22887
CL=22887
2009-01-15 16:20:21 -08:00
Russ Cox
07d344e442 remove export name-list statement.
make package local the default.
warn about name case not matching export keyword.

R=ken
OCL=22881
CL=22886
2009-01-15 16:16:52 -08:00
Russ Cox
a91af04c06 6g cleanup suggested by ken.
remove TPTR wrapper around TMAP, TCHAN, TSTRING.

R=ken
OCL=22406
CL=22409
2009-01-09 11:13:39 -08:00
Russ Cox
cb64ec5bb6 only generate non-trivial signatures in the
file in which they occur.  avoids duplicate
trampoline generation across multiple files.

R=ken
OCL=20976
CL=20980
2008-12-11 11:54:33 -08:00
Ken Thompson
f8797daa9f import/export of exact mp floating constants
new syntax for exact mp floating constants
     decimal_int ( "p" | "P" ) [ "+" | "-" ] decimal_int
     the value is decimal1 * 2^decimal2

R=r
OCL=20357
CL=20357
2008-12-03 13:17:26 -08:00
Russ Cox
9c7b064043 fix bugs in package locals
R=ken
OCL=19299
CL=19299
2008-11-14 17:31:29 -08:00
Russ Cox
d3f6093931 package-local declarations using keyword "package".
R=r
DELTA=129  (81 added, 0 deleted, 48 changed)
OCL=19283
CL=19291
2008-11-14 16:35:08 -08:00
Russ Cox
4958d41d3b change from $$ to \n$$ for .6 meta section delimiter
R=r
DELTA=13  (5 added, 0 deleted, 8 changed)
OCL=18190
CL=18192
2008-10-30 16:33:50 -07:00
Russ Cox
1a149ca1be stop looking for type names beginning with _.
they're gone.

R=ken
OCL=17569
CL=17569
2008-10-21 14:44:31 -07:00
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
ef40d9435b 6g:
make sure methods end up immediately following
	the struct they are methods on.
ar:
	eliminate duplicate definitions from __.PKGDEF.
	check that multiple .6 do not give different defs for same
		exported type/var/func/const.
	increase ar header name size from 16 to 64 bytes

R=r
DELTA=379  (333 added, 18 deleted, 28 changed)
OCL=17477
CL=17481
2008-10-20 13:53:56 -07:00
Russ Cox
ba46bd1e5a export prereq for interface types
R=ken
OCL=17377
CL=17377
2008-10-17 16:13:17 -07:00
Russ Cox
59167e5bdb diagnose export of incomplete type
R=ken
OCL=17253
CL=17253
2008-10-15 17:51:23 -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
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
Russ Cox
a05c59fe91 cleanup export
R=ken
OCL=16219
CL=16219
2008-09-30 13:52:44 -07:00
Russ Cox
b033c581db fix export bug for /usr/r/rpc
R=ken
OCL=16218
CL=16218
2008-09-30 13:49:31 -07:00
Ken Thompson
b6f59358b5 minor bugs
R=r
OCL=16163
CL=16163
2008-09-29 20:33:51 -07:00
Ken Thompson
9f3d600be6 export
syntax for inheritance

R=r
OCL=16028
CL=16028
2008-09-26 21:27:26 -07:00
Ken Thompson
8545700af8 export
R=r
OCL=16018
CL=16022
2008-09-26 17:41:23 -07:00
Ken Thompson
bcd07252e1 export
R=r
OCL=15805
CL=15805
2008-09-24 16:20:01 -07:00
Ken Thompson
5f0a5e7a13 more export
R=r
OCL=15771
CL=15771
2008-09-24 14:12:21 -07:00
Ken Thompson
1101d406ec more on export
R=r
OCL=15704
CL=15704
2008-09-23 14:16:41 -07:00
Ken Thompson
dc04d096f0 fixed export sort for methods
R=r
OCL=15699
CL=15699
2008-09-23 12:48:52 -07:00
Russ Cox
fb2c66710c compiler changes:
export.c:
		- only expose explicitly exported types to importer
		- fix behind your back
	go.h:
		- add deep() prototype (fixes 64-bit linux crash on time.go)
	go.y:
		- add a new syntax error case
	walk.c:
		- allow a,b = f() where f is func ptr (fixes bug088)

R=ken
OCL=15617
CL=15630
2008-09-22 12:45:01 -07:00
Ken Thompson
2119294af9 methods on any type
-- but only *struct tested

R=r
OCL=15326
CL=15326
2008-09-14 16:57:55 -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