Skip to content

Commit 79f62bb

Browse files
committed
add bases to the codegen json
1 parent 4c21e93 commit 79f62bb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

codegen/src/JsonInterfaceGen.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ matjson::Value generateJsonInterface(Root const& root) {
9999
// Array because
100100
std::vector<matjson::Value> functions;
101101
std::vector<matjson::Value> fields;
102+
std::vector<matjson::Value> bases;
103+
102104
for (auto& f : c.fields) {
103105
if (auto fn = f.get_as<FunctionBindField>()) {
104106
std::vector<matjson::Value> args;
@@ -145,10 +147,15 @@ matjson::Value generateJsonInterface(Root const& root) {
145147
}));
146148
}
147149
}
150+
for (auto& sc : c.superclasses) {
151+
bases.push_back(sc);
152+
}
153+
148154
classes.push_back(matjson::makeObject({
149155
{ "name", c.name },
150156
{ "functions", functions },
151157
{ "fields", fields },
158+
{ "bases", bases },
152159
{ "source", std::filesystem::path(c.source).filename().string() },
153160
{ "line", c.line },
154161
}));

0 commit comments

Comments
 (0)