eolian_mono: Respect beta for enum
authorYeongjong Lee <yj34.lee@samsung.com>
Mon, 30 Sep 2019 04:52:45 +0000 (13:52 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 30 Sep 2019 22:27:31 +0000 (07:27 +0900)
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

src/bin/eolian_mono/eolian/mono/enum_definition.hh
src/lib/eolian_cxx/grammar/klass_def.hpp

index c5ab79a..56560af 100644 (file)
@@ -17,6 +17,9 @@ struct enum_definition_generator
   template <typename OutputIterator, typename Context>
   bool generate(OutputIterator sink, attributes::enum_def const& enum_, Context const& context) const
   {
+     if(enum_.is_beta)
+       return true;
+
      if(!name_helpers::open_namespaces(sink, enum_.namespaces, context))
        return false;
 
index 81f40d3..d0de5db 100644 (file)
@@ -1617,6 +1617,7 @@ struct enum_def
   std::vector<std::string> namespaces;
   std::vector<enum_value_def> fields;
   documentation_def documentation;
+  bool is_beta;
 
   enum_def(Eolian_Typedecl const* enum_obj, Eolian_Unit const* unit)
   {
@@ -1634,6 +1635,7 @@ struct enum_def
           enum_value_def field_def(&*field_iterator, unit);
           this->fields.push_back(field_def);
        }
+     is_beta = eolian_object_is_beta(EOLIAN_OBJECT(enum_obj));
 
      documentation = ::eolian_typedecl_documentation_get(enum_obj);
   }