Fix missing enums in dbj files
This commit is contained in:
parent
556301366f
commit
30c602d468
|
@ -1167,6 +1167,25 @@ bool Compiler::WriteDbjFile(const char* filename)
|
|||
case DT_TYPE_POINTER:
|
||||
fprintf(file, "\t\t{\"name\": \"%s\", \"typeid\": %d, \"size\": %d, \"type\": \"ptr\", eid: %d}", dec->mIdent ? dec->mIdent->mString : "", i, dec->mSize, types.IndexOrPush(dec->mBase));
|
||||
break;
|
||||
case DT_TYPE_ENUM:
|
||||
{
|
||||
fprintf(file, "\t\t{\"name\": \"%s\", \"typeid\": %d, \"size\": %d, \"type\": \"enum\",\"members\": [\n", dec->mIdent ? dec->mIdent->mString : "", i, dec->mSize);
|
||||
bool tfirst = true;
|
||||
Declaration* mdec = dec->mParams;
|
||||
while (mdec)
|
||||
{
|
||||
if (!tfirst)
|
||||
fprintf(file, ",\n");
|
||||
tfirst = false;
|
||||
|
||||
fprintf(file, "\t\t\t{\"name\": \"%s\", \"value\": %d}", mdec->mIdent->mString, int(mdec->mInteger));
|
||||
|
||||
mdec = mdec->mNext;
|
||||
}
|
||||
fprintf(file, "]}");
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case DT_TYPE_STRUCT:
|
||||
{
|
||||
fprintf(file, "\t\t{\"name\": \"%s\", \"typeid\": %d, \"size\": %d, \"type\": \"struct\",\"members\": [\n", dec->mIdent ? dec->mIdent->mString : "", i, dec->mSize);
|
||||
|
|
|
@ -337,6 +337,9 @@ Declaration* Parser::ParseBaseTypeDeclaration(uint64 flags)
|
|||
mScanner->NextToken();
|
||||
else
|
||||
break;
|
||||
|
||||
cdec->mNext = dec->mParams;
|
||||
dec->mParams = cdec;
|
||||
}
|
||||
|
||||
dec->mMinValue = minValue;
|
||||
|
@ -350,6 +353,7 @@ Declaration* Parser::ParseBaseTypeDeclaration(uint64 flags)
|
|||
}
|
||||
else if (maxValue > 255)
|
||||
dec->mSize = 2;
|
||||
|
||||
}
|
||||
|
||||
if (mScanner->mToken == TK_CLOSE_BRACE)
|
||||
|
|
Loading…
Reference in New Issue