summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_fields.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_fields.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_fields.hh40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_fields.hh b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
index b8bb0a2..76e0f64 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_fields.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
@@ -28,6 +28,30 @@
28 28
29namespace eolian_mono { 29namespace eolian_mono {
30 30
31struct field_argument_name_generator
32{
33 template<typename OutputIterator, typename Context>
34 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
35 {
36 if (!as_generator(name_helpers::to_field_name(field.name))
37 .generate(sink, attributes::unused, context))
38 return false;
39 return true;
40 }
41} const field_argument_name {};
42
43struct field_argument_decl_generator
44{
45 template<typename OutputIterator, typename Context>
46 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
47 {
48 if (!as_generator(type << " " << string)
49 .generate(sink, std::make_tuple(field.type, name_helpers::to_field_name(field.name)), context))
50 return false;
51 return true;
52 }
53} const field_argument_decl {};
54
31struct field_argument_default_generator 55struct field_argument_default_generator
32{ 56{
33 template<typename OutputIterator, typename Context> 57 template<typename OutputIterator, typename Context>
@@ -70,6 +94,16 @@ struct field_argument_docs_generator
70namespace efl { namespace eolian { namespace grammar { 94namespace efl { namespace eolian { namespace grammar {
71 95
72template<> 96template<>
97struct is_eager_generator< ::eolian_mono::field_argument_name_generator> : std::true_type {};
98template<>
99struct is_generator< ::eolian_mono::field_argument_name_generator> : std::true_type {};
100
101template<>
102struct is_eager_generator< ::eolian_mono::field_argument_decl_generator> : std::true_type {};
103template<>
104struct is_generator< ::eolian_mono::field_argument_decl_generator> : std::true_type {};
105
106template<>
73struct is_eager_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {}; 107struct is_eager_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {};
74template<> 108template<>
75struct is_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {}; 109struct is_generator< ::eolian_mono::field_argument_default_generator> : std::true_type {};
@@ -87,6 +121,12 @@ struct is_generator< ::eolian_mono::field_argument_docs_generator> : std::true_t
87namespace type_traits { 121namespace type_traits {
88 122
89template <> 123template <>
124struct attributes_needed< ::eolian_mono::field_argument_name_generator> : std::integral_constant<int, 1> {};
125
126template <>
127struct attributes_needed< ::eolian_mono::field_argument_decl_generator> : std::integral_constant<int, 1> {};
128
129template <>
90struct attributes_needed< ::eolian_mono::field_argument_default_generator> : std::integral_constant<int, 1> {}; 130struct attributes_needed< ::eolian_mono::field_argument_default_generator> : std::integral_constant<int, 1> {};
91 131
92template <> 132template <>