summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian_mono.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian_mono.cc')
-rw-r--r--src/bin/eolian_mono/eolian_mono.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bin/eolian_mono/eolian_mono.cc b/src/bin/eolian_mono/eolian_mono.cc
index 235f250..e3cbe5f 100644
--- a/src/bin/eolian_mono/eolian_mono.cc
+++ b/src/bin/eolian_mono/eolian_mono.cc
@@ -33,6 +33,7 @@
33#include <eolian/mono/marshall_annotation.hh> 33#include <eolian/mono/marshall_annotation.hh>
34#include <eolian/mono/function_pointer.hh> 34#include <eolian/mono/function_pointer.hh>
35#include <eolian/mono/alias_definition.hh> 35#include <eolian/mono/alias_definition.hh>
36#include <eolian/mono/variable_definition.hh>
36 37
37namespace eolian_mono { 38namespace eolian_mono {
38 39
@@ -168,6 +169,20 @@ run(options_type const& opts)
168 } 169 }
169 } 170 }
170 171
172 // Constants
173 {
174 auto var_cxt = context_add_tag(class_context{class_context::variables}, context);
175 for (efl::eina::iterator<const Eolian_Variable> var_iterator( ::eolian_state_constants_by_file_get(opts.state, basename_input.c_str()))
176 , var_last; var_iterator != var_last; ++var_iterator)
177 {
178 efl::eolian::grammar::attributes::variable_def var(&*var_iterator, opts.unit);
179 if (!eolian_mono::constant_definition.generate(iterator, var, var_cxt))
180 {
181 throw std::runtime_error("Failed to generate enum");
182 }
183 }
184 }
185
171 if (klass) 186 if (klass)
172 { 187 {
173 efl::eolian::grammar::attributes::klass_def klass_def(klass, opts.unit); 188 efl::eolian::grammar::attributes::klass_def klass_def(klass, opts.unit);
@@ -294,7 +309,7 @@ _assert_not_dup(std::string option, std::string value)
294static eolian_mono::options_type 309static eolian_mono::options_type
295opts_get(int argc, char **argv) 310opts_get(int argc, char **argv)
296{ 311{
297 eolian_mono::options_type opts; 312 eolian_mono::options_type opts{};
298 313
299 const struct option long_options[] = 314 const struct option long_options[] =
300 { 315 {