Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdruppe committed Feb 18, 2012
1 parent 97cda9f commit 6aa03d5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/doc.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,27 @@ void Module::gendocfile()
emitMemberComments(sc);
}

//printf("BODY= '%.*s'\n", buf.offset, buf.data);
Macro::define(&macrotable, (unsigned char *)"BODY", 4, buf.data, buf.offset);
// if I did the character encoding right here, I think we'd be in business
OutBuffer bufEncoded;
bufEncoded.reserve(buf.offset);
for(unsigned where = 0; where < buf.offset; where++)
{
unsigned char c = buf.data[where];
const char* replacement = escapetable->strings[c];
if (replacement == NULL)
bufEncoded.writeByte(c);
else
bufEncoded.writestring(replacement);
}

// printf("BODY= '%.*s'\n", bufEncoded.offset, bufEncoded.data);
// printf("BODY= '%.*s'\n", buf.offset, buf.data);
Macro::define(&macrotable, (unsigned char *)"BODY", 4, bufEncoded.data, bufEncoded.offset);

OutBuffer buf2;
buf2.writestring("$(DDOC)\n");
unsigned end = buf2.offset;

macrotable->expand(&buf2, 0, &end, NULL, 0);

#if 1
Expand Down

0 comments on commit 6aa03d5

Please sign in to comment.