Commit 2c3ddf5e authored by Russ Cox's avatar Russ Cox

include local types in typestrings

R=r
DELTA=16  (14 added, 1 deleted, 1 changed)
OCL=17584
CL=17584
parent 44b0ecc5
......@@ -90,16 +90,17 @@ ldpkg(Biobuf *f, int64 len, char *filename)
fprint(2, "6l: short pkg read %s\n", filename);
return;
}
// first $$ marks beginning of exports
p0 = strstr(data, "$$");
if(p0 == nil)
return;
p0 += 2;
while(*p0 != '\n' && *p0 != '\0')
p0++;
p1 = strstr(p0, "$$");
if(p1 == nil) {
fprint(2, "6l: cannot find end of imports in %s\n", filename);
fprint(2, "6l: cannot find end of exports in %s\n", filename);
return;
}
while(*p0 == ' ' || *p0 == '\t' || *p0 == '\n')
......@@ -115,6 +116,18 @@ ldpkg(Biobuf *f, int64 len, char *filename)
p0++;
loadpkgdata(filename, p0, p1 - p0);
// local types begin where exports end.
p0 = p1;
while(*p0 != '\n' && *p0 != '\0')
p0++;
p1 = strstr(p0, "$$");
if(p1 == nil) {
fprint(2, "6l: cannot find end of local types in %s\n", filename);
return;
}
loadpkgdata(filename, p0, p1 - p0);
}
static void
......
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