mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 15:30:01 +00:00
Python: Fix potential code generation issue of documentation comment.
This commit is contained in:
@@ -493,7 +493,7 @@ static void GenStruct(const StructDef &struct_def,
|
|||||||
StructDef *root_struct_def) {
|
StructDef *root_struct_def) {
|
||||||
if (struct_def.generated) return;
|
if (struct_def.generated) return;
|
||||||
|
|
||||||
GenComment(struct_def.doc_comment, code_ptr, nullptr);
|
GenComment(struct_def.doc_comment, code_ptr, nullptr, "# ");
|
||||||
BeginClass(struct_def, code_ptr);
|
BeginClass(struct_def, code_ptr);
|
||||||
if (&struct_def == root_struct_def) {
|
if (&struct_def == root_struct_def) {
|
||||||
// Generate a special accessor for the table that has been declared as
|
// Generate a special accessor for the table that has been declared as
|
||||||
@@ -660,5 +660,3 @@ bool GeneratePython(const Parser &parser,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace flatbuffers
|
} // namespace flatbuffers
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ table Stat {
|
|||||||
count:ushort;
|
count:ushort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// an example documentation comment: monster object
|
||||||
table Monster {
|
table Monster {
|
||||||
pos:Vec3 (id: 0);
|
pos:Vec3 (id: 0);
|
||||||
hp:short = 100 (id: 2);
|
hp:short = 100 (id: 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user