From 82a71b18f1d89d41ed5c1807d1ab80cf74491bcd Mon Sep 17 00:00:00 2001 From: Melvi Ts Date: Fri, 28 Aug 2015 23:48:28 +0800 Subject: [PATCH] Python: Fix potential code generation issue of documentation comment. --- src/idl_gen_python.cpp | 4 +--- tests/monster_test.fbs | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/idl_gen_python.cpp b/src/idl_gen_python.cpp index 96f9c42..de47a99 100644 --- a/src/idl_gen_python.cpp +++ b/src/idl_gen_python.cpp @@ -493,7 +493,7 @@ static void GenStruct(const StructDef &struct_def, StructDef *root_struct_def) { 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); if (&struct_def == root_struct_def) { // Generate a special accessor for the table that has been declared as @@ -660,5 +660,3 @@ bool GeneratePython(const Parser &parser, } } // namespace flatbuffers - - diff --git a/tests/monster_test.fbs b/tests/monster_test.fbs index b2b99bb..6fe5f25 100755 --- a/tests/monster_test.fbs +++ b/tests/monster_test.fbs @@ -31,6 +31,7 @@ table Stat { count:ushort; } +/// an example documentation comment: monster object table Monster { pos:Vec3 (id: 0); hp:short = 100 (id: 2); -- 2.7.4