|
|
|
@ -1291,16 +1291,19 @@ void WriteMessageField(upb::FieldDefPtr field, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string GetSub(upb::FieldDefPtr field) { |
|
|
|
|
if (auto message_def = field.message_type(); message_def) { |
|
|
|
|
if (auto message_def = field.message_type()) { |
|
|
|
|
return absl::Substitute("{.submsg = &$0}", MessageInitName(message_def)); |
|
|
|
|
} else if (auto enum_def = field.enum_subdef(); |
|
|
|
|
enum_def && enum_def.is_closed()) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (auto enum_def = field.enum_subdef()) { |
|
|
|
|
if (enum_def.is_closed()) { |
|
|
|
|
return absl::Substitute("{.subenum = &$0}", EnumInit(enum_def)); |
|
|
|
|
} else { |
|
|
|
|
return std::string("{.submsg = NULL}"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return std::string("{.submsg = NULL}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Writes a single message into a .upb.c source file.
|
|
|
|
|
void WriteMessage(upb::MessageDefPtr message, const DefPoolPair& pools, |
|
|
|
|
const Options& options, Output& output) { |
|
|
|
|