xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=becef7aee4e6390488db5889942d2df6f7aa9bc2

commit becef7aee4e6390488db5889942d2df6f7aa9bc2
Author: Lauro Moura <[email protected]>
Date:   Thu Aug 1 21:12:10 2019 +0200

    csharp: Avoid generating empty <value> tags
    
    Depends on D9478
    
    Reviewers: segfaultxavi, felipealmeida
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D9481
---
 src/bin/eolian_mono/eolian/mono/struct_definition.hh | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh 
b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 413f59ec53..f4d55ea4f9 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -406,15 +406,16 @@ struct struct_definition_generator
      // iterate struct fields
      for (auto const& field : struct_.fields)
        {
-          auto field_name = field.name;
-          field_name[0] = std::toupper(field_name[0]); // Hack to allow 
'static' as a field name
-          if (!as_generator
-              (
-               documentation(indent.n + 1)
-               << indent << scope_tab << "/// <value>" << string << 
"</value>\n"
-               << indent << scope_tab << "public " << type << " " << string << 
";\n"
-              )
-              .generate(sink, std::make_tuple(field, field.type.doc_summary, 
field.type, name_helpers::to_field_name(field.name)), context))
+          if (!as_generator(documentation(indent.n + 1)).generate(sink, field, 
context))
+            return false;
+
+          if (!field.type.doc_summary.empty())
+            {
+               if (!as_generator(indent << scope_tab << "/// <value>" << 
field.type.doc_summary << "</value>\n").generate(sink, attributes::unused, 
context))
+                 return false;
+            }
+
+          if (!as_generator(indent << scope_tab << "public " << type << " " << 
name_helpers::to_field_name(field.name) << ";\n").generate(sink, field.type, 
context))
             return false;
        }
 

-- 


Reply via email to