summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-09-30 13:52:45 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-09-30 13:52:45 +0900
commitd1dd3c30b91fd1015a157690f5678fc0520bd23c (patch)
tree2fa70189364cbb9b22e392ab1d20b3c327340de2
parent4429b16e36254087f9e6f952677c561f2236d8c0 (diff)
eolian_mono: Respect beta for enum
Summary: this prevent generating beta enum with `-Dmono-beta=false`. Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=false Reviewers: lauromoura, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10245
-rw-r--r--src/bin/eolian_mono/eolian/mono/enum_definition.hh3
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/enum_definition.hh b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
index c5ab79ae66..56560afcf2 100644
--- a/src/bin/eolian_mono/eolian/mono/enum_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
@@ -17,6 +17,9 @@ struct enum_definition_generator
17 template <typename OutputIterator, typename Context> 17 template <typename OutputIterator, typename Context>
18 bool generate(OutputIterator sink, attributes::enum_def const& enum_, Context const& context) const 18 bool generate(OutputIterator sink, attributes::enum_def const& enum_, Context const& context) const
19 { 19 {
20 if(enum_.is_beta)
21 return true;
22
20 if(!name_helpers::open_namespaces(sink, enum_.namespaces, context)) 23 if(!name_helpers::open_namespaces(sink, enum_.namespaces, context))
21 return false; 24 return false;
22 25
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 81f40d3ba5..d0de5db39b 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -1617,6 +1617,7 @@ struct enum_def
1617 std::vector<std::string> namespaces; 1617 std::vector<std::string> namespaces;
1618 std::vector<enum_value_def> fields; 1618 std::vector<enum_value_def> fields;
1619 documentation_def documentation; 1619 documentation_def documentation;
1620 bool is_beta;
1620 1621
1621 enum_def(Eolian_Typedecl const* enum_obj, Eolian_Unit const* unit) 1622 enum_def(Eolian_Typedecl const* enum_obj, Eolian_Unit const* unit)
1622 { 1623 {
@@ -1634,6 +1635,7 @@ struct enum_def
1634 enum_value_def field_def(&*field_iterator, unit); 1635 enum_value_def field_def(&*field_iterator, unit);
1635 this->fields.push_back(field_def); 1636 this->fields.push_back(field_def);
1636 } 1637 }
1638 is_beta = eolian_object_is_beta(EOLIAN_OBJECT(enum_obj));
1637 1639
1638 documentation = ::eolian_typedecl_documentation_get(enum_obj); 1640 documentation = ::eolian_typedecl_documentation_get(enum_obj);
1639 } 1641 }