Commit b8babed7 authored by Russ Cox's avatar Russ Cox

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
parent 8877d27b
...@@ -654,20 +654,20 @@ scanpkg(Biobuf *b, long size) ...@@ -654,20 +654,20 @@ scanpkg(Biobuf *b, long size)
int first; int first;
/* /*
* scan until (( * scan until $$
*/ */
for (n=0; n<size; ) { for (n=0; n<size; ) {
c = Bgetc(b); c = Bgetc(b);
if(c == Beof) if(c == Beof)
break; break;
n++; n++;
if(c != '(') if(c != '$')
continue; continue;
c = Bgetc(b); c = Bgetc(b);
if(c == Beof) if(c == Beof)
break; break;
n++; n++;
if(c != '(') if(c != '$')
continue; continue;
goto foundstart; goto foundstart;
} }
...@@ -691,9 +691,9 @@ foundstart: ...@@ -691,9 +691,9 @@ foundstart:
first = 0; first = 0;
continue; continue;
} }
if (strstrn(line, Blinelen(b), "))")) if (strstrn(line, Blinelen(b), "$$"))
goto foundend; goto foundend;
end = Boffset(b); // before closing )) end = Boffset(b); // before closing $$
} }
bad: bad:
fprint(2, "ar: bad package import section in %s\n", file); fprint(2, "ar: bad package import section in %s\n", file);
...@@ -706,9 +706,9 @@ foundend: ...@@ -706,9 +706,9 @@ foundend:
/* this is the first package */ /* this is the first package */
pkgstmt = armalloc(strlen(pkg)+1); pkgstmt = armalloc(strlen(pkg)+1);
strcpy(pkgstmt, pkg); strcpy(pkgstmt, pkg);
pkgdefsize = 7 + 3 + strlen(pkg); /* "import\n((\npackage foo\n" */ pkgdefsize = 7 + 3 + strlen(pkg); /* "import\n$$\npackage foo\n" */
pkgdata = armalloc(pkgdefsize); pkgdata = armalloc(pkgdefsize);
sprint(pkgdata, "import\n((\n%s", pkgstmt); sprint(pkgdata, "import\n$$\n%s", pkgstmt);
} else { } else {
if (strcmp(pkg, pkgstmt) != 0) { if (strcmp(pkg, pkgstmt) != 0) {
fprint(2, "ar: inconsistent package name\n"); fprint(2, "ar: inconsistent package name\n");
...@@ -1018,7 +1018,7 @@ rl(int fd) ...@@ -1018,7 +1018,7 @@ rl(int fd)
headlen = Boffset(&b); headlen = Boffset(&b);
len += headlen; len += headlen;
if (gflag) { if (gflag) {
len += SAR_HDR + pkgdefsize + 3; /* +3 for "))\n" */ len += SAR_HDR + pkgdefsize + 3; /* +3 for "$$\n" */
if (len & 1) if (len & 1)
len++; len++;
} }
...@@ -1037,7 +1037,7 @@ rl(int fd) ...@@ -1037,7 +1037,7 @@ rl(int fd)
Bputc(&b, 0); Bputc(&b, 0);
if (gflag) { if (gflag) {
len = pkgdefsize + 3; /* for "))\n" at close */ len = pkgdefsize + 3; /* for "$$\n" at close */
sprint(a.date, "%-12ld", time(0)); sprint(a.date, "%-12ld", time(0));
sprint(a.uid, "%-6d", 0); sprint(a.uid, "%-6d", 0);
sprint(a.gid, "%-6d", 0); sprint(a.gid, "%-6d", 0);
...@@ -1053,7 +1053,7 @@ rl(int fd) ...@@ -1053,7 +1053,7 @@ rl(int fd)
if (Bwrite(&b, pkgdata, pkgdefsize) != pkgdefsize) if (Bwrite(&b, pkgdata, pkgdefsize) != pkgdefsize)
wrerr(); wrerr();
if (Bwrite(&b, "))\n", 3) != 3) if (Bwrite(&b, "$$\n", 3) != 3)
wrerr(); wrerr();
if(len&0x01) if(len&0x01)
Bputc(&b, 0); Bputc(&b, 0);
......
...@@ -39,10 +39,12 @@ y.tab.h: $(YFILES) ...@@ -39,10 +39,12 @@ y.tab.h: $(YFILES)
y.tab.c: y.tab.h y.tab.c: y.tab.h
test -f y.tab.c && touch y.tab.c test -f y.tab.c && touch y.tab.c
sysimport.c: sys.go mksys.bash sysimport.c: sys.go mksys.c
bash mksys.bash gcc -o mksys mksys.c
6g sys.go
./mksys sys.6 >_sysimport.c && mv _sysimport.c sysimport.c
clean: clean:
rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) rm -f $(OFILES) *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB) _sysimport.c
install: $(LIB) install: $(LIB)
...@@ -50,10 +50,10 @@ dodcltype(Type *n, Type *t) ...@@ -50,10 +50,10 @@ dodcltype(Type *n, Type *t)
t = nt; t = nt;
t->sym = S; t->sym = S;
} }
if(exportadj)
exportsym(n->sym);
n->sym->local = 1; n->sym->local = 1;
addtyp(n, t, dclcontext); addtyp(n, t, dclcontext);
if(exportadj)
exportsym(n->sym);
} }
void void
...@@ -70,8 +70,6 @@ loop: ...@@ -70,8 +70,6 @@ loop:
n = n->right; n = n->right;
goto loop; goto loop;
} }
if(exportadj)
exportsym(n->sym);
if(n->op != ONAME) if(n->op != ONAME)
fatal("dodclconst: not a name"); fatal("dodclconst: not a name");
...@@ -85,6 +83,9 @@ loop: ...@@ -85,6 +83,9 @@ loop:
s->oconst = e; s->oconst = e;
s->lexical = LACONST; s->lexical = LACONST;
if(exportadj)
exportsym(n->sym);
r = autodcl; r = autodcl;
if(dclcontext == PEXTERN) if(dclcontext == PEXTERN)
r = externdcl; r = externdcl;
...@@ -142,51 +143,6 @@ functype(Node *this, Node *in, Node *out) ...@@ -142,51 +143,6 @@ functype(Node *this, Node *in, Node *out)
return t; return t;
} }
void
funcnam(Type *t, char *nam)
{
Node *n;
Sym *s;
char buf[100];
if(nam == nil) {
vargen++;
snprint(buf, sizeof(buf), "_f%s_%.3ld", filename, vargen);
nam = buf;
}
if(t->etype != TFUNC)
fatal("funcnam: not func %T\n", t);
if(t->thistuple > 0) {
vargen++;
snprint(namebuf, sizeof(namebuf), "_t%s_%.3ld", filename, vargen);
s = lookup(namebuf);
addtyp(newtype(s), t->type, PEXTERN);
n = newname(s);
n->vargen = vargen;
t->type->nname = n;
}
if(t->outtuple > 0) {
vargen++;
snprint(namebuf, sizeof(namebuf), "_o%s_%.3ld", filename, vargen);
s = lookup(namebuf);
addtyp(newtype(s), t->type->down, PEXTERN);
n = newname(s);
n->vargen = vargen;
t->type->down->nname = n;
}
if(t->intuple > 0) {
vargen++;
snprint(namebuf, sizeof(namebuf), "_i%s_%.3ld", filename, vargen);
s = lookup(namebuf);
addtyp(newtype(s), t->type->down->down, PEXTERN);
n = newname(s);
n->vargen = vargen;
t->type->down->down->nname = n;
}
}
int int
methcmp(Type *t1, Type *t2) methcmp(Type *t1, Type *t2)
{ {
...@@ -218,6 +174,7 @@ Node* ...@@ -218,6 +174,7 @@ Node*
methodname(Node *n, Type *t) methodname(Node *n, Type *t)
{ {
Sym *s; Sym *s;
char buf[NSYMB];
if(t == T) if(t == T)
goto bad; goto bad;
...@@ -233,8 +190,8 @@ methodname(Node *n, Type *t) ...@@ -233,8 +190,8 @@ methodname(Node *n, Type *t)
if(s == S) if(s == S)
goto bad; goto bad;
snprint(namebuf, sizeof(namebuf), "%s_%s", s->name, n->sym->name); snprint(buf, sizeof(buf), "%s_%s", s->name, n->sym->name);
return newname(lookup(namebuf)); return newname(pkglookup(buf, t->sym->opackage));
bad: bad:
yyerror("illegal <this> type: %T", t); yyerror("illegal <this> type: %T", t);
...@@ -366,7 +323,6 @@ funchdr(Node *n) ...@@ -366,7 +323,6 @@ funchdr(Node *n)
if(on == N) { if(on == N) {
// initial declaration or redeclaration // initial declaration or redeclaration
// declare fun name, argument types and argument names // declare fun name, argument types and argument names
funcnam(n->type, s->name);
n->nname->type = n->type; n->nname->type = n->type;
if(n->type->thistuple == 0) if(n->type->thistuple == 0)
addvar(n->nname, n->type, PEXTERN); addvar(n->nname, n->type, PEXTERN);
...@@ -462,6 +418,7 @@ stotype(Node *n, Type **t) ...@@ -462,6 +418,7 @@ stotype(Node *n, Type **t)
{ {
Type *f; Type *f;
Iter save; Iter save;
char buf[100];
n = listfirst(&save, &n); n = listfirst(&save, &n);
...@@ -490,8 +447,8 @@ loop: ...@@ -490,8 +447,8 @@ loop:
f->nname = n->left; f->nname = n->left;
} else { } else {
vargen++; vargen++;
snprint(namebuf, sizeof(namebuf), "_e%s_%.3ld", filename, vargen); snprint(buf, sizeof(buf), "_e%s_%.3ld", filename, vargen);
f->nname = newname(lookup(namebuf)); f->nname = newname(lookup(buf));
} }
f->sym = f->nname->sym; f->sym = f->nname->sym;
...@@ -600,6 +557,7 @@ poptodcl(void) ...@@ -600,6 +557,7 @@ poptodcl(void)
} }
if(d == S) if(d == S)
fatal("poptodcl: no mark"); fatal("poptodcl: no mark");
dclstack = d;
} }
void void
...@@ -689,17 +647,6 @@ addvar(Node *n, Type *t, int ctxt) ...@@ -689,17 +647,6 @@ addvar(Node *n, Type *t, int ctxt)
if(n==N || n->sym == S || n->op != ONAME || t == T) if(n==N || n->sym == S || n->op != ONAME || t == T)
fatal("addvar: n=%N t=%T nil", n, t); fatal("addvar: n=%N t=%T nil", n, t);
ot = t;
if(isptr[ot->etype])
ot = ot->type;
if(ot->etype == TSTRUCT && ot->vargen == 0) {
vargen++;
snprint(namebuf, sizeof(namebuf), "_s%s_%.3ld", filename, vargen);
s = lookup(namebuf);
addtyp(newtype(s), ot, PEXTERN);
}
s = n->sym; s = n->sym;
vargen++; vargen++;
gen = vargen; gen = vargen;
...@@ -783,7 +730,8 @@ addtyp(Type *n, Type *t, int ctxt) ...@@ -783,7 +730,8 @@ addtyp(Type *n, Type *t, int ctxt)
pushdcl(s); pushdcl(s);
if(t->sym != S) if(t->sym != S)
warn("addtyp: renaming %S/%lT to %S/%lT", t->sym, t->sym->otype, s, n); warn("addtyp: renaming type %S/%lT to %S/%lT",
t->sym, t->sym->otype, s, n);
vargen++; vargen++;
s->vargen = vargen; s->vargen = vargen;
......
This diff is collapsed.
...@@ -123,6 +123,7 @@ struct Type ...@@ -123,6 +123,7 @@ struct Type
uchar recur; // to detect loops uchar recur; // to detect loops
uchar trecur; // to detect loops uchar trecur; // to detect loops
uchar methptr; // 1=direct 2=pointer uchar methptr; // 1=direct 2=pointer
uchar printed;
// TFUNCT // TFUNCT
uchar thistuple; uchar thistuple;
...@@ -464,6 +465,8 @@ EXTERN char* hunk; ...@@ -464,6 +465,8 @@ EXTERN char* hunk;
EXTERN int32 nhunk; EXTERN int32 nhunk;
EXTERN int32 thunk; EXTERN int32 thunk;
EXTERN int exporting;
/* /*
* y.tab.c * y.tab.c
*/ */
...@@ -652,6 +655,7 @@ void fninit(Node*); ...@@ -652,6 +655,7 @@ void fninit(Node*);
Node* nametoanondcl(Node*); Node* nametoanondcl(Node*);
Node* nametodcl(Node*, Type*); Node* nametodcl(Node*, Type*);
Node* anondcl(Type*); Node* anondcl(Type*);
void checkarglist(Node*);
/* /*
* export.c * export.c
...@@ -675,6 +679,12 @@ void doimport6(Node*, Node*); ...@@ -675,6 +679,12 @@ void doimport6(Node*, Node*);
void doimport7(Node*, Node*); void doimport7(Node*, Node*);
void doimport8(Node*, Val*, Node*); void doimport8(Node*, Val*, Node*);
void doimport9(Sym*, Node*); void doimport9(Sym*, Node*);
void importconst(int, Node *ss, Type *t, Val *v);
void importmethod(Sym *s, Type *t);
void importtype(int, Node *ss, Type *t);
void importvar(int, Node *ss, Type *t);
void checkimports(void);
Type* pkgtype(char*, char*);
/* /*
* walk.c * walk.c
......
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
%type <node> vardcl_list_r vardcl Avardcl Bvardcl %type <node> vardcl_list_r vardcl Avardcl Bvardcl
%type <node> interfacedcl_list_r interfacedcl %type <node> interfacedcl_list_r interfacedcl
%type <node> structdcl_list_r structdcl %type <node> structdcl_list_r structdcl
%type <node> hidden_importsym_list_r ohidden_importsym_list hidden_importsym isym
%type <node> hidden_importfield_list_r ohidden_importfield_list hidden_importfield
%type <node> fnres Afnres Bfnres fnliteral xfndcl fndcl fnbody %type <node> fnres Afnres Bfnres fnliteral xfndcl fndcl fnbody
%type <node> keyexpr_list keyval_list_r keyval %type <node> keyexpr_list keyval_list_r keyval
%type <node> typedcl Atypedcl Btypedcl %type <node> typedcl Atypedcl Btypedcl
...@@ -58,6 +56,14 @@ ...@@ -58,6 +56,14 @@
%type <type> Achantype Bchantype %type <type> Achantype Bchantype
%type <val> hidden_constant %type <val> hidden_constant
%type <node> hidden_dcl
%type <type> hidden_type hidden_type1 hidden_type2
%type <node> hidden_structdcl_list ohidden_structdcl_list hidden_structdcl_list_r
%type <node> hidden_interfacedcl_list ohidden_interfacedcl_list hidden_interfacedcl_list_r
%type <node> hidden_interfacedcl
%type <node> hidden_funarg_list ohidden_funarg_list hidden_funarg_list_r
%type <node> hidden_funres ohidden_funres hidden_importsym
%type <lint> oexport
%left LOROR %left LOROR
%left LANDAND %left LANDAND
...@@ -65,6 +71,7 @@ ...@@ -65,6 +71,7 @@
%left LEQ LNE LLE LGE LLT LGT %left LEQ LNE LLE LGE LLT LGT
%left '+' '-' '|' '^' %left '+' '-' '|' '^'
%left '*' '/' '%' '&' LLSH LRSH %left '*' '/' '%' '&' LLSH LRSH
%% %%
file: file:
package import_there imports oxdcl_list package import_there imports oxdcl_list
...@@ -130,12 +137,12 @@ import_package: ...@@ -130,12 +137,12 @@ import_package:
} }
import_there: import_there:
hidden_import_list_r ')' ')' hidden_import_list_r '$' '$'
{ {
checkimports(); checkimports();
unimportfile(); unimportfile();
} }
| LIMPORT '(' '(' hidden_import_list_r ')' ')' | LIMPORT '$' '$' hidden_import_list_r '$' '$'
{ {
checkimports(); checkimports();
} }
...@@ -889,8 +896,7 @@ sym1: ...@@ -889,8 +896,7 @@ sym1:
| keyword | keyword
sym2: sym2:
sym sym1
| keyword
/* /*
* keywords that we can * keywords that we can
...@@ -1124,14 +1130,12 @@ Afntype: ...@@ -1124,14 +1130,12 @@ Afntype:
'(' oarg_type_list ')' Afnres '(' oarg_type_list ')' Afnres
{ {
$$ = functype(N, $2, $4); $$ = functype(N, $2, $4);
funcnam($$, nil);
} }
Bfntype: Bfntype:
'(' oarg_type_list ')' Bfnres '(' oarg_type_list ')' Bfnres
{ {
$$ = functype(N, $2, $4); $$ = functype(N, $2, $4);
funcnam($$, nil);
} }
fnlitdcl: fnlitdcl:
...@@ -1175,8 +1179,7 @@ fnbody: ...@@ -1175,8 +1179,7 @@ fnbody:
if($$ == N) if($$ == N)
$$ = nod(ORETURN, N, N); $$ = nod(ORETURN, N, N);
} }
| ';' | {
{
$$ = N; $$ = N;
} }
...@@ -1296,7 +1299,6 @@ indcl: ...@@ -1296,7 +1299,6 @@ indcl:
{ {
// without func keyword // without func keyword
$$ = functype(fakethis(), $2, $4); $$ = functype(fakethis(), $2, $4);
funcnam($$, nil);
} }
| latype | latype
{ {
...@@ -1357,10 +1359,6 @@ arg_type_list_r: ...@@ -1357,10 +1359,6 @@ arg_type_list_r:
$$ = nametoanondcl($1); $$ = nametoanondcl($1);
} }
/*
* arg type is just list of arg_chunks, except for the
* special case of a simple comma-separated list of names.
*/
arg_type_list: arg_type_list:
arg_type_list_r arg_type_list_r
{ {
...@@ -1493,18 +1491,43 @@ hidden_import_list_r: ...@@ -1493,18 +1491,43 @@ hidden_import_list_r:
hidden_import hidden_import
| hidden_import_list_r hidden_import | hidden_import_list_r hidden_import
hidden_importsym_list_r: hidden_funarg_list_r:
hidden_importsym hidden_dcl
| hidden_importsym_list_r hidden_importsym | hidden_funarg_list_r ',' hidden_dcl
{ {
$$ = nod(OLIST, $1, $2); $$ = nod(OLIST, $1, $3);
} }
hidden_importfield_list_r: hidden_funarg_list:
hidden_importfield hidden_funarg_list_r
| hidden_importfield_list_r hidden_importfield
{ {
$$ = nod(OLIST, $1, $2); $$ = rev($1);
}
hidden_structdcl_list_r:
hidden_dcl
| hidden_structdcl_list_r ';' hidden_dcl
{
$$ = nod(OLIST, $1, $3);
}
hidden_structdcl_list:
hidden_structdcl_list_r
{
$$ = rev($1);
}
hidden_interfacedcl_list_r:
hidden_interfacedcl
| hidden_interfacedcl_list_r ';' hidden_interfacedcl
{
$$ = nod(OLIST, $1, $3);
}
hidden_interfacedcl_list:
hidden_interfacedcl_list_r
{
$$ = rev($1);
} }
keyval_list_r: keyval_list_r:
...@@ -1577,104 +1600,183 @@ oxdcl_list: ...@@ -1577,104 +1600,183 @@ oxdcl_list:
$$ = rev($1); $$ = rev($1);
} }
ohidden_importsym_list: oarg_type_list:
{ {
$$ = N; $$ = N;
} }
| hidden_importsym_list_r | arg_type_list
ohidden_funarg_list:
{ {
$$ = rev($1); $$ = N;
} }
| hidden_funarg_list
ohidden_importfield_list: ohidden_structdcl_list:
{ {
$$ = N; $$ = N;
} }
| hidden_importfield_list_r | hidden_structdcl_list
ohidden_interfacedcl_list:
{ {
$$ = rev($1); $$ = N;
} }
| hidden_interfacedcl_list
oarg_type_list: oexport:
{ {
$$ = N; $$ = 0;
}
| LEXPORT
{
$$ = 1;
} }
| arg_type_list
/* /*
* import syntax from header of * import syntax from header of
* an output package * an output package
*/ */
hidden_import: hidden_import:
/* leftover import ignored */ LPACKAGE sym1
LPACKAGE sym
/* variables */ /* variables */
| LVAR hidden_importsym hidden_importsym | oexport LVAR hidden_importsym hidden_type
{
importvar($1, $3, $4);
}
| oexport LCONST hidden_importsym '=' hidden_constant
{ {
// var importconst($1, $3, T, &$5);
doimportv1($2, $3);
} }
| oexport LCONST hidden_importsym hidden_type '=' hidden_constant
{
importconst($1, $3, $4, &$6);
}
| oexport LTYPE hidden_importsym hidden_type
{
importtype($1, $3, $4);
}
| oexport LFUNC hidden_importsym '(' ohidden_funarg_list ')' ohidden_funres
{
importvar($1, $3, functype(N, $5, $7));
}
| oexport LFUNC '(' hidden_funarg_list ')' sym1 '(' ohidden_funarg_list ')' ohidden_funres
{
// have to put oexport here to avoid shift/reduce
// with non-method func. but it isn't allowed.
if($1)
yyerror("cannot export method");
if($4->op != ODCLFIELD) {
yyerror("bad receiver in method");
YYERROR;
}
importmethod($6, functype($4, $8, $10));
}
hidden_type:
hidden_type1
| hidden_type2
/* constants */ hidden_type1:
| LCONST hidden_importsym hidden_constant hidden_importsym
{ {
doimportc1($2, &$3); $$ = pkgtype($1->sym->name, $1->psym->name);
} }
| LCONST hidden_importsym hidden_importsym hidden_constant | LATYPE
{ {
doimportc2($2, $3, &$4); $$ = oldtype($1);
} }
| '[' ']' hidden_type
{
$$ = aindex(N, $3);
}
| '[' LLITERAL ']' hidden_type
{
Node *n;
/* types */ n = nod(OLITERAL, N, N);
| LTYPE hidden_importsym '[' hidden_importsym ']' hidden_importsym n->val = $2;
$$ = aindex(n, $4);
}
| LMAP '[' hidden_type ']' hidden_type
{
$$ = typ(TMAP);
$$->down = $3;
$$->type = $5;
}
| LSTRUCT '{' ohidden_structdcl_list '}'
{
$$ = dostruct($3, TSTRUCT);
}
| LINTERFACE '{' ohidden_interfacedcl_list '}'
{
$$ = dostruct($3, TINTER);
$$ = sortinter($$);
}
| '*' hidden_type
{ {
// type map dowidth($2);
doimport1($2, $4, $6); $$ = ptrto($2);
}
| LCOMM LCHAN hidden_type
{
$$ = typ(TCHAN);
$$->type = $3;
$$->chan = Crecv;
} }
| LTYPE hidden_importsym '[' LLITERAL ']' hidden_importsym | LCHAN LCOMM hidden_type1
{ {
// type array $$ = typ(TCHAN);
doimport2($2, &$4, $6); $$->type = $3;
$$->chan = Csend;
} }
| LTYPE hidden_importsym '[' ']' hidden_importsym
hidden_type2:
LCHAN hidden_type
{ {
// type array $$ = typ(TCHAN);
doimport2($2, nil, $5); $$->type = $2;
$$->chan = Cboth;
} }
| LTYPE hidden_importsym '(' ohidden_importsym_list ')' | '(' ohidden_funarg_list ')' ohidden_funres
{ {
// type function $$ = functype(N, $2, $4);
doimport3($2, $4);
} }
| LTYPE hidden_importsym '{' ohidden_importfield_list '}'
hidden_dcl:
sym1 hidden_type
{ {
// type structure $$ = nod(ODCLFIELD, newname($1), N);
doimport4($2, $4); $$->type = $2;
} }
| LTYPE hidden_importsym LLITERAL | '?' hidden_type
{ {
// type basic $$ = nod(ODCLFIELD, N, N);
doimport5($2, &$3); $$->type = $2;
} }
| LTYPE hidden_importsym '*' hidden_importsym
hidden_interfacedcl:
sym1 '(' ohidden_funarg_list ')' ohidden_funres
{ {
// type pointer $$ = nod(ODCLFIELD, newname($1), N);
doimport6($2, $4); $$->type = functype(fakethis(), $3, $5);
} }
| LTYPE hidden_importsym LLT ohidden_importfield_list LGT
ohidden_funres:
{ {
// type interface $$ = N;
doimport7($2, $4);
} }
| LTYPE hidden_importsym LLITERAL hidden_importsym | hidden_funres
hidden_funres:
'(' ohidden_funarg_list ')'
{ {
// type interface $$ = $2;
doimport8($2, &$3, $4);
} }
| LFUNC sym1 hidden_importsym | hidden_type1
{ {
// method $$ = nod(ODCLFIELD, N, N);
doimport9($2, $3); $$->type = $1;
} }
hidden_constant: hidden_constant:
...@@ -1694,37 +1796,13 @@ hidden_constant: ...@@ -1694,37 +1796,13 @@ hidden_constant:
} }
} }
isym: hidden_importsym:
sym1 '.' sym2 sym1 '.' sym2
{ {
$$ = nod(OIMPORT, N, N); $$ = nod(OIMPORT, N, N);
$$->osym = $1; $$->osym = $1;
$$->psym = $1; $$->psym = $1;
$$->sym = $3; $$->sym = $3;
renamepkg($$);
}
| '(' sym1 ')' sym1 '.' sym2
{
$$ = nod(OIMPORT, N, N);
$$->osym = $2;
$$->psym = $4;
$$->sym = $6;
renamepkg($$);
}
hidden_importsym:
isym
| '!' isym
{
$$ = $2;
$$->etype = 1;
}
hidden_importfield:
sym1 isym
{
$$ = $2;
$$->fsym = $1;
} }
/* /*
...@@ -1739,7 +1817,7 @@ hidden_importfield: ...@@ -1739,7 +1817,7 @@ hidden_importfield:
* to check whether the rest of the grammar is free of * to check whether the rest of the grammar is free of
* reduce/reduce conflicts, comment this section out by * reduce/reduce conflicts, comment this section out by
* removing the slash on the next line. * removing the slash on the next line.
*/ *
lpack: lpack:
LATYPE LATYPE
{ {
......
...@@ -227,7 +227,7 @@ importfile(Val *f) ...@@ -227,7 +227,7 @@ importfile(Val *f)
/* /*
* position the input right * position the input right
* after (( and return * after $$ and return
*/ */
pushedio = curio; pushedio = curio;
curio.bin = imp; curio.bin = imp;
...@@ -237,12 +237,12 @@ importfile(Val *f) ...@@ -237,12 +237,12 @@ importfile(Val *f)
c = getc(); c = getc();
if(c == EOF) if(c == EOF)
break; break;
if(c != '(') if(c != '$')
continue; continue;
c = getc(); c = getc();
if(c == EOF) if(c == EOF)
break; break;
if(c != '(') if(c != '$')
continue; continue;
return; return;
} }
...@@ -586,9 +586,9 @@ l0: ...@@ -586,9 +586,9 @@ l0:
lx: lx:
if(c > 0xff) if(c > 0xff)
DBG("lex: TOKEN %s\n", lexname(c)); DBG("%L lex: TOKEN %s\n", lineno, lexname(c));
else else
DBG("lex: TOKEN '%c'\n", c); DBG("%L lex: TOKEN '%c'\n", lineno, c);
return c; return c;
asop: asop:
......
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
#!/bin/bash
6g sys.go
echo '1,/((/d
/))/+1,$d
g/init_.*_function/d
1,$s/foop/sys/g
1,$s/^[ ]*/ "/g
1,$s/$/\\n"/g
1i
char* sysimport =
.
$a
;
.
w sysimport.c
q' | /bin/ed sys.6
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Extract import data from sys.6 and generate C string version.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
int
main(int argc, char **argv)
{
FILE *fin;
char buf[1024], *p, *q;
if(argc != 2) {
fprintf(stderr, "usage: mksys sys.6\n");
exit(1);
}
if((fin = fopen(argv[1], "r")) == NULL) {
fprintf(stderr, "open %s: %s\n", argv[1], strerror(errno));
exit(1);
}
// look for $$ that introduces imports
while(fgets(buf, sizeof buf, fin) != NULL)
if(strstr(buf, "$$"))
goto begin;
fprintf(stderr, "did not find beginning of imports\n");
exit(1);
begin:
printf("char *sysimport = \n");
// process imports, stopping at $$ that closes them
while(fgets(buf, sizeof buf, fin) != NULL) {
buf[strlen(buf)-1] = 0; // chop \n
if(strstr(buf, "$$"))
goto end;
// chop leading white space
for(p=buf; *p==' ' || *p == '\t'; p++)
;
// cut out decl of init_sys_function - it doesn't exist
if(strstr(buf, "init_sys_function"))
continue;
// sys.go claims to be in package SYS to avoid
// conflicts during "6g sys.go". rename SYS to sys.
for(q=p; *q; q++)
if(memcmp(q, "SYS", 3) == 0)
memmove(q, "sys", 3);
printf("\t\"%s\\n\"\n", p);
}
fprintf(stderr, "did not find end of imports\n");
exit(1);
end:
printf("\t\"$$\\n\";\n");
return 0;
}
...@@ -22,6 +22,8 @@ yyerror(char *fmt, ...) ...@@ -22,6 +22,8 @@ yyerror(char *fmt, ...)
va_start(arg, fmt); va_start(arg, fmt);
vfprint(1, fmt, arg); vfprint(1, fmt, arg);
va_end(arg); va_end(arg);
if(strcmp(fmt, "syntax error") == 0)
print(" near %s", namebuf);
print("\n"); print("\n");
if(debug['h']) if(debug['h'])
*(int*)0 = 0; *(int*)0 = 0;
...@@ -921,6 +923,7 @@ Sconv(Fmt *fp) ...@@ -921,6 +923,7 @@ Sconv(Fmt *fp)
if(s->name != nil) if(s->name != nil)
nam = s->name; nam = s->name;
if(!(fp->flags & FmtShort))
if(strcmp(pkg, package) || strcmp(opk, package) || (fp->flags & FmtLong)) { if(strcmp(pkg, package) || strcmp(opk, package) || (fp->flags & FmtLong)) {
if(strcmp(opk, pkg) == 0) { if(strcmp(opk, pkg) == 0) {
snprint(buf, sizeof(buf), "%s.%s", pkg, nam); snprint(buf, sizeof(buf), "%s.%s", pkg, nam);
...@@ -948,7 +951,7 @@ static char *basicnames[] = { ...@@ -948,7 +951,7 @@ static char *basicnames[] = {
[TFLOAT64] "float64", [TFLOAT64] "float64",
[TFLOAT80] "float80", [TFLOAT80] "float80",
[TBOOL] "bool", [TBOOL] "bool",
[TSTRING] "string" [TANY] "any",
}; };
int int
...@@ -956,7 +959,10 @@ Tpretty(Fmt *fp, Type *t) ...@@ -956,7 +959,10 @@ Tpretty(Fmt *fp, Type *t)
{ {
Type *t1; Type *t1;
if(t->etype != TFIELD && t->sym != S && t->sym->name[0] != '_') if(t->etype != TFIELD
&& t->sym != S
&& t->sym->name[0] != '_'
&& !(fp->flags&FmtLong))
return fmtprint(fp, "%S", t->sym); return fmtprint(fp, "%S", t->sym);
if(t->etype < nelem(basicnames) && basicnames[t->etype] != nil) if(t->etype < nelem(basicnames) && basicnames[t->etype] != nil)
...@@ -965,21 +971,42 @@ Tpretty(Fmt *fp, Type *t) ...@@ -965,21 +971,42 @@ Tpretty(Fmt *fp, Type *t)
switch(t->etype) { switch(t->etype) {
case TPTR32: case TPTR32:
case TPTR64: case TPTR64:
if(t->type && t->type->etype == TSTRING)
return fmtprint(fp, "string");
return fmtprint(fp, "*%T", t->type); return fmtprint(fp, "*%T", t->type);
case TFUNC: case TFUNC:
// t->type is method struct
// t->type->down is result struct
// t->type->down->down is arg struct
if(t->thistuple && !(fp->flags&FmtSharp) && !(fp->flags&FmtShort)) {
fmtprint(fp, "method(");
for(t1=getthisx(t)->type; t1; t1=t1->down) {
fmtprint(fp, "%T", t1);
if(t1->down)
fmtprint(fp, ", ");
}
fmtprint(fp, ")");
}
fmtprint(fp, "("); fmtprint(fp, "(");
for(t1=t->type->down->down->type; t1; t1=t1->down) { for(t1=getinargx(t)->type; t1; t1=t1->down) {
fmtprint(fp, "%T", t1); fmtprint(fp, "%T", t1);
if(t1->down) if(t1->down)
fmtprint(fp, ", "); fmtprint(fp, ", ");
} }
fmtprint(fp, ")"); fmtprint(fp, ")");
t1 = t->type->down->type; switch(t->outtuple) {
if(t1 != T) { case 0:
if(t1->down == T && t1->etype != TFIELD) break;
case 1:
t1 = getoutargx(t)->type;
if(t1->etype != TFIELD) {
fmtprint(fp, " %T", t1); fmtprint(fp, " %T", t1);
else { break;
}
default:
t1 = getoutargx(t)->type;
fmtprint(fp, " ("); fmtprint(fp, " (");
for(; t1; t1=t1->down) { for(; t1; t1=t1->down) {
fmtprint(fp, "%T", t1); fmtprint(fp, "%T", t1);
...@@ -987,7 +1014,7 @@ Tpretty(Fmt *fp, Type *t) ...@@ -987,7 +1014,7 @@ Tpretty(Fmt *fp, Type *t)
fmtprint(fp, ", "); fmtprint(fp, ", ");
} }
fmtprint(fp, ")"); fmtprint(fp, ")");
} break;
} }
return 0; return 0;
...@@ -1005,21 +1032,35 @@ Tpretty(Fmt *fp, Type *t) ...@@ -1005,21 +1032,35 @@ Tpretty(Fmt *fp, Type *t)
case TINTER: case TINTER:
fmtprint(fp, "interface {"); fmtprint(fp, "interface {");
for(t1=t->type; t1!=T; t1=t1->down) { for(t1=t->type; t1!=T; t1=t1->down) {
fmtprint(fp, " %S %T;", t1->sym, t1); fmtprint(fp, " %hS %hT", t1->sym, t1->type);
if(t1->down)
fmtprint(fp, ";");
} }
return fmtprint(fp, " }"); return fmtprint(fp, " }");
case TSTRUCT: case TSTRUCT:
fmtprint(fp, "struct {"); fmtprint(fp, "struct {");
for(t1=t->type; t1!=T; t1=t1->down) { for(t1=t->type; t1!=T; t1=t1->down) {
fmtprint(fp, " %T;", t1); fmtprint(fp, " %T", t1);
if(t1->down)
fmtprint(fp, ";");
} }
return fmtprint(fp, " }"); return fmtprint(fp, " }");
case TFIELD: case TFIELD:
if(t->sym == S || t->sym->name[0] == '_') if(t->sym == S || t->sym->name[0] == '_') {
if(exporting)
fmtprint(fp, "? ");
return fmtprint(fp, "%T", t->type); return fmtprint(fp, "%T", t->type);
return fmtprint(fp, "%S %T", t->sym, t->type); }
return fmtprint(fp, "%hS %T", t->sym, t->type);
case TFORW:
if(exporting)
yyerror("undefined type %S", t->sym);
if(t->sym)
return fmtprint(fp, "undefined %S", t->sym);
return fmtprint(fp, "undefined");
} }
// Don't know how to handle - fall back to detailed prints. // Don't know how to handle - fall back to detailed prints.
...@@ -1417,6 +1458,9 @@ signame(Type *t) ...@@ -1417,6 +1458,9 @@ signame(Type *t)
{ {
Sym *s, *ss; Sym *s, *ss;
char *e; char *e;
Type *t1;
int n;
char buf[NSYMB];
if(t == T) if(t == T)
goto bad; goto bad;
...@@ -1437,8 +1481,8 @@ signame(Type *t) ...@@ -1437,8 +1481,8 @@ signame(Type *t)
if(t->etype == TINTER) if(t->etype == TINTER)
e = "sigi"; e = "sigi";
snprint(namebuf, sizeof(namebuf), "%s_%s", e, s->name); snprint(buf, sizeof(buf), "%s_%s", e, s->name);
ss = pkglookup(namebuf, s->opackage); ss = pkglookup(buf, s->opackage);
if(ss->oname == N) { if(ss->oname == N) {
ss->oname = newname(ss); ss->oname = newname(ss);
ss->oname->type = types[TUINT8]; ss->oname->type = types[TUINT8];
......
...@@ -3,168 +3,80 @@ ...@@ -3,168 +3,80 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package foop // rename to avoid redeclaration package SYS // rename to avoid redeclaration
func mal(uint32) *any; export func mal(uint32) *any;
func breakpoint(); export func breakpoint();
func throwindex(); export func throwindex();
func throwreturn(); export func throwreturn();
func panicl(int32); export func panicl(int32);
func printbool(bool); export func printbool(bool);
func printfloat(double); export func printfloat(double);
func printint(int64); export func printint(int64);
func printstring(string); export func printstring(string);
func printpointer(*any); export func printpointer(*any);
func printinter(any); export func printinter(any);
func printnl(); export func printnl();
func printsp(); export func printsp();
func catstring(string, string) string; export func catstring(string, string) string;
func cmpstring(string, string) int32; export func cmpstring(string, string) int32;
func slicestring(string, int32, int32) string; export func slicestring(string, int32, int32) string;
func indexstring(string, int32) byte; export func indexstring(string, int32) byte;
func intstring(int64) string; export func intstring(int64) string;
func byteastring(*byte, int32) string; export func byteastring(*byte, int32) string;
func arraystring(*[]byte) string; export func arraystring(*[]byte) string;
func ifaceT2I(sigi *byte, sigt *byte, elem any) (ret any); export func ifaceT2I(sigi *byte, sigt *byte, elem any) (ret any);
func ifaceI2T(sigt *byte, iface any) (ret any); export func ifaceI2T(sigt *byte, iface any) (ret any);
func ifaceI2I(sigi *byte, iface any) (ret any); export func ifaceI2I(sigi *byte, iface any) (ret any);
func argc() int32; export func argc() int32;
func envc() int32; export func envc() int32;
func argv(int32) string; export func argv(int32) string;
func envv(int32) string; export func envv(int32) string;
func frexp(float64) (float64, int32); // break fp into exp,fract export func frexp(float64) (float64, int32); // break fp into exp,fract
func ldexp(float64, int32) float64; // make fp from exp,fract export func ldexp(float64, int32) float64; // make fp from exp,fract
func modf(float64) (float64, float64); // break fp into double.double export func modf(float64) (float64, float64); // break fp into double.double
func isInf(float64, int32) bool; // test for infinity export func isInf(float64, int32) bool; // test for infinity
func isNaN(float64) bool; // test for not-a-number export func isNaN(float64) bool; // test for not-a-number
func Inf(int32) float64; // return signed Inf export func Inf(int32) float64; // return signed Inf
func NaN() float64; // return a NaN export func NaN() float64; // return a NaN
func newmap(keysize uint32, valsize uint32, export func newmap(keysize uint32, valsize uint32,
keyalg uint32, valalg uint32, keyalg uint32, valalg uint32,
hint uint32) (hmap *map[any]any); hint uint32) (hmap *map[any]any);
func mapaccess1(hmap *map[any]any, key any) (val any); export func mapaccess1(hmap *map[any]any, key any) (val any);
func mapaccess2(hmap *map[any]any, key any) (val any, pres bool); export func mapaccess2(hmap *map[any]any, key any) (val any, pres bool);
func mapassign1(hmap *map[any]any, key any, val any); export func mapassign1(hmap *map[any]any, key any, val any);
func mapassign2(hmap *map[any]any, key any, val any, pres bool); export func mapassign2(hmap *map[any]any, key any, val any, pres bool);
func newchan(elemsize uint32, elemalg uint32, hint uint32) (hchan *chan any); export func newchan(elemsize uint32, elemalg uint32, hint uint32) (hchan *chan any);
func chanrecv1(hchan *chan any) (elem any); export func chanrecv1(hchan *chan any) (elem any);
func chanrecv2(hchan *chan any) (elem any, pres bool); export func chanrecv2(hchan *chan any) (elem any, pres bool);
func chanrecv3(hchan *chan any, elem *any) (pres bool); export func chanrecv3(hchan *chan any, elem *any) (pres bool);
func chansend1(hchan *chan any, elem any); export func chansend1(hchan *chan any, elem any);
func chansend2(hchan *chan any, elem any) (pres bool); export func chansend2(hchan *chan any, elem any) (pres bool);
func newselect(size uint32) (sel *byte); export func newselect(size uint32) (sel *byte);
func selectsend(sel *byte, hchan *chan any, elem any) (selected bool); export func selectsend(sel *byte, hchan *chan any, elem any) (selected bool);
func selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool); export func selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);
func selectgo(sel *byte); export func selectgo(sel *byte);
func newarray(nel uint32, cap uint32, width uint32) (ary *[]any); export func newarray(nel uint32, cap uint32, width uint32) (ary *[]any);
func arraysliced(old *[]any, lb uint32, hb uint32, width uint32) (ary *[]any); export func arraysliced(old *[]any, lb uint32, hb uint32, width uint32) (ary *[]any);
func arrayslices(old *any, nel uint32, lb uint32, hb uint32, width uint32) (ary *[]any); export func arrayslices(old *any, nel uint32, lb uint32, hb uint32, width uint32) (ary *[]any);
func arrays2d(old *any, nel uint32) (ary *[]any); export func arrays2d(old *any, nel uint32) (ary *[]any);
func gosched(); export func gosched();
func goexit(); export func goexit();
func readfile(string) (string, bool); // read file into string; boolean status export func readfile(string) (string, bool); // read file into string; boolean status
func writefile(string, string) (bool); // write string into file; boolean status export func writefile(string, string) (bool); // write string into file; boolean status
func bytestorune(*byte, int32, int32) (int32, int32); // convert bytes to runes export func bytestorune(*byte, int32, int32) (int32, int32); // convert bytes to runes
func stringtorune(string, int32, int32) (int32, int32); // convert bytes to runes export func stringtorune(string, int32, int32) (int32, int32); // convert bytes to runes
func exit(int32); export func exit(int32);
export
mal
breakpoint
throwindex
throwreturn
// print panic
panicl
printbool
printfloat
printint
printstring
printpointer
printinter
printnl
printsp
// op string
catstring
cmpstring
slicestring
indexstring
intstring
byteastring
arraystring
// interface
ifaceT2I
ifaceI2T
ifaceI2I
// args
argc
envc
argv
envv
// fp
frexp
ldexp
modf
isInf,
isNaN,
Inf,
NaN,
// map
newmap
mapaccess1
mapaccess2
mapassign1
mapassign2
// chan
newchan
chanrecv1
chanrecv2
chanrecv3
chansend1
chansend2
// select
newselect
selectsend
selectrecv
selectgo
// dynamic arrays
newarray
arraysliced
arrayslices
arrays2d
// go routines
gosched
goexit
// files
readfile
writefile
// runes and utf-8
bytestorune
stringtorune
// system calls
exit
;
This diff is collapsed.
=========== ./func3.go =========== ./func3.go
BUG: errchk func3
BUG: errchk: func3.go: missing expected error message on line 14: 'type' BUG: errchk: func3.go: missing expected error message on line 14: 'type'
=========== ./helloworld.go =========== ./helloworld.go
...@@ -58,7 +57,7 @@ bugs/bug020.go:7: type of a structure field cannot be an open array ...@@ -58,7 +57,7 @@ bugs/bug020.go:7: type of a structure field cannot be an open array
BUG should compile BUG should compile
=========== bugs/bug026.go =========== bugs/bug026.go
sys·printstring: main·sigs_I: not defined sys·printnl: main·sigt_I: not defined
BUG: known to fail incorrectly BUG: known to fail incorrectly
=========== bugs/bug032.go =========== bugs/bug032.go
...@@ -74,11 +73,11 @@ BUG: map increment ...@@ -74,11 +73,11 @@ BUG: map increment
=========== bugs/bug064.go =========== bugs/bug064.go
bugs/bug064.go:15: illegal types for operand: CALL bugs/bug064.go:15: illegal types for operand: CALL
int32 int32
struct { u int32; v int32; } struct { u int32; v int32 }
BUG: compilation should succeed BUG: compilation should succeed
=========== bugs/bug074.go =========== bugs/bug074.go
bugs/bug074.go:6: syntax error bugs/bug074.go:6: syntax error near string
bugs/bug074.go:7: x: undefined bugs/bug074.go:7: x: undefined
BUG: compiler crashes - Bus error BUG: compiler crashes - Bus error
...@@ -91,7 +90,7 @@ BUG: succeeds incorrectly ...@@ -91,7 +90,7 @@ BUG: succeeds incorrectly
=========== bugs/bug080.go =========== bugs/bug080.go
bugs/bug080.go:12: illegal types for operand: CALL bugs/bug080.go:12: illegal types for operand: CALL
int32 int32
struct { x int32; y float32; } struct { x int32; y float32 }
BUG: fails incorrectly BUG: fails incorrectly
=========== bugs/bug083.go =========== bugs/bug083.go
...@@ -115,19 +114,19 @@ M ...@@ -115,19 +114,19 @@ M
=========== bugs/bug094.go =========== bugs/bug094.go
bugs/bug094.go:11: left side of := must be a name bugs/bug094.go:11: left side of := must be a name
bad top bad top
. LITERAL-I0 l(369) . LITERAL-I0 l(81)
bugs/bug094.go:11: fatal error: walktype: top=3 LITERAL bugs/bug094.go:11: fatal error: walktype: top=3 LITERAL
BUG: fails incorrectly BUG: fails incorrectly
=========== bugs/bug095.go =========== bugs/bug095.go
found 2, expected 1 found 2, expected 1
panic on line 368 PC=xxx panic on line 80 PC=xxx
BUG wrong result BUG wrong result
=========== bugs/bug097.go =========== bugs/bug097.go
panic on line 370 PC=xxx panic on line 82 PC=xxx
BUG wrong result BUG wrong result
=========== bugs/bug098.go =========== bugs/bug098.go
...@@ -164,7 +163,7 @@ BUG: should compile ...@@ -164,7 +163,7 @@ BUG: should compile
fixedbugs/bug016.go:7: overflow converting constant to uint32 fixedbugs/bug016.go:7: overflow converting constant to uint32
=========== fixedbugs/bug025.go =========== fixedbugs/bug025.go
fixedbugs/bug025.go:7: variable exported but not defined: Foo fixedbugs/bug025.go:7: variable exported but not defined: main.Foo
=========== fixedbugs/bug027.go =========== fixedbugs/bug027.go
hi hi
...@@ -181,8 +180,8 @@ hi ...@@ -181,8 +180,8 @@ hi
=========== fixedbugs/bug029.go =========== fixedbugs/bug029.go
fixedbugs/bug029.go:6: f is not a type fixedbugs/bug029.go:6: f is not a type
fixedbugs/bug029.go:6: syntax error fixedbugs/bug029.go:6: syntax error near func
fixedbugs/bug029.go:6: syntax error fixedbugs/bug029.go:6: syntax error near int
=========== fixedbugs/bug035.go =========== fixedbugs/bug035.go
fixedbugs/bug035.go:6: var i redeclared in this block fixedbugs/bug035.go:6: var i redeclared in this block
...@@ -192,7 +191,7 @@ fixedbugs/bug035.go:7: var f redeclared in this block ...@@ -192,7 +191,7 @@ fixedbugs/bug035.go:7: var f redeclared in this block
=========== fixedbugs/bug037.go =========== fixedbugs/bug037.go
fixedbugs/bug037.go:6: vlong: undefined fixedbugs/bug037.go:6: vlong: undefined
fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(364) t=<T> nil fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(76) t=<T> nil
=========== fixedbugs/bug039.go =========== fixedbugs/bug039.go
fixedbugs/bug039.go:6: var x redeclared in this block fixedbugs/bug039.go:6: var x redeclared in this block
...@@ -203,7 +202,7 @@ fixedbugs/bug049.go:6: illegal conversion of constant to string ...@@ -203,7 +202,7 @@ fixedbugs/bug049.go:6: illegal conversion of constant to string
=========== fixedbugs/bug050.go =========== fixedbugs/bug050.go
fixedbugs/bug050.go:3: package statement must be first fixedbugs/bug050.go:3: package statement must be first
sys.6:1 fixedbugs/bug050.go:3: syntax error sys.6:1 fixedbugs/bug050.go:3: syntax error near package
=========== fixedbugs/bug051.go =========== fixedbugs/bug051.go
fixedbugs/bug051.go:10: expression must be a constant fixedbugs/bug051.go:10: expression must be a constant
...@@ -241,7 +240,7 @@ fixedbugs/bug073.go:9: illegal types for operand: RSH ...@@ -241,7 +240,7 @@ fixedbugs/bug073.go:9: illegal types for operand: RSH
int32 int32
=========== fixedbugs/bug081.go =========== fixedbugs/bug081.go
fixedbugs/bug081.go:5: syntax error fixedbugs/bug081.go:5: syntax error near x
=========== fixedbugs/bug086.go =========== fixedbugs/bug086.go
fixedbugs/bug086.go:5: function ends without a return statement fixedbugs/bug086.go:5: function ends without a return statement
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment