summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-08-01 21:12:10 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-08-01 21:12:36 +0200
commitbecef7aee4e6390488db5889942d2df6f7aa9bc2 (patch)
treeca8e04773583ba290707cf690f8f6d677515226f /src/bin/eolian_mono/eolian/mono/struct_definition.hh
parent44e00273387ddef127bb98358c729d343ef59f05 (diff)
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
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh19
1 files 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
406 // iterate struct fields 406 // iterate struct fields
407 for (auto const& field : struct_.fields) 407 for (auto const& field : struct_.fields)
408 { 408 {
409 auto field_name = field.name; 409 if (!as_generator(documentation(indent.n + 1)).generate(sink, field, context))
410 field_name[0] = std::toupper(field_name[0]); // Hack to allow 'static' as a field name 410 return false;
411 if (!as_generator 411
412 ( 412 if (!field.type.doc_summary.empty())
413 documentation(indent.n + 1) 413 {
414 << indent << scope_tab << "/// <value>" << string << "</value>\n" 414 if (!as_generator(indent << scope_tab << "/// <value>" << field.type.doc_summary << "</value>\n").generate(sink, attributes::unused, context))
415 << indent << scope_tab << "public " << type << " " << string << ";\n" 415 return false;
416 ) 416 }
417 .generate(sink, std::make_tuple(field, field.type.doc_summary, field.type, name_helpers::to_field_name(field.name)), context)) 417
418 if (!as_generator(indent << scope_tab << "public " << type << " " << name_helpers::to_field_name(field.name) << ";\n").generate(sink, field.type, context))
418 return false; 419 return false;
419 } 420 }
420 421