addmethod(s, t, 0);
}
-/*
- * ******* import *******
- */
-
-void
-checkimports(void)
-{
- Sym *s;
- Type *t, *t1;
- uint32 h;
- int et;
-
-return;
-
- for(h=0; h<NHASH; h++)
- for(s = hash[h]; s != S; s = s->link) {
- if(s->def == N || s->def->op != OTYPE)
- continue;
- t = s->def->type;
- if(t == T)
- continue;
-
- et = t->etype;
- switch(t->etype) {
- case TFORW:
- print("ci-1: %S %lT\n", s, t);
- break;
-
- case TPTR32:
- case TPTR64:
- if(t->type == T) {
- print("ci-2: %S %lT\n", s, t);
- break;
- }
-
- t1 = t->type;
- if(t1 == T) {
- print("ci-3: %S %lT\n", s, t1);
- break;
- }
-
- et = t1->etype;
- if(et == TFORW) {
- print("%L: ci-4: %S %lT\n", lineno, s, t);
- break;
- }
- break;
- }
- }
-}
-
void importmethod(Sym *s, Type *t);
void importtype(Type *s, Type *t);
void importvar(Sym *s, Type *t, int ctxt);
-void checkimports(void);
Type* pkgtype(Sym*);
Sym* importsym(Sym*, int);
hidden_import_list '$' '$'
{
resumecheckwidth();
- checkimports();
unimportfile();
}
localpkg->prefix = "\"\"";
builtinpkg = mkpkg(strlit("go.builtin"));
+
gostringpkg = mkpkg(strlit("go.string"));
- gostringpkg->prefix = "go.string";
+ gostringpkg->name = "go.string";
+ gostringpkg->prefix = "go.string"; // not go%2estring
+
runtimepkg = mkpkg(strlit("runtime"));
+ runtimepkg->name = "runtime";
+
stringpkg = mkpkg(strlit("string"));
+ stringpkg->name = "string";
+
typepkg = mkpkg(strlit("type"));
+ typepkg->name = "type";
+
unsafepkg = mkpkg(strlit("unsafe"));
+ unsafepkg->name = "unsafe";
goroot = getgoroot();
goos = getgoos();