eolian-cxx: Added grammar rule parameters_cxx_list.
authorSavio Sena <savio@expertisesolutions.com.br>
Thu, 24 Jul 2014 19:00:10 +0000 (16:00 -0300)
committerSavio Sena <savio@expertisesolutions.com.br>
Thu, 24 Jul 2014 22:52:23 +0000 (19:52 -0300)
Now with the correct semantics: list parameters converting to C++.

src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
src/lib/eolian_cxx/grammar/parameters_generator.hh

index 5c32498ea6ff695258748e75b05a068465003098..12f6550d973f89ae49093d8531fb220ec1fcdc5b 100644 (file)
@@ -111,7 +111,7 @@ operator<<(std::ostream& out, inheritance_wrappers const& x)
             << tab(1)
             << (!function_is_void(func) ? "return ": "")
             << "static_cast<T*>(self->this_)->"
-            << func.name << "(" << parameters_c_list(func.params) << ");" << endl
+            << func.name << "(" << parameters_cxx_list(func.params) << ");" << endl
             << "}" << endl << endl;
      }
    return out;
index 12c09b65606cad73272f1f46c2219752eca6a429..f25c6d0b4ecaa7a1dc88d4cc2cde56901e4b92d7 100644 (file)
@@ -154,6 +154,16 @@ parameters_cxx_list
 inline std::ostream&
 operator<<(std::ostream& out, parameters_cxx_list const& x)
 {
+   auto first = x._params.cbegin(), last = x._params.cend();
+   for (auto it = first; it != last; ++it)
+     {
+        if (it != first)
+          out << ", ";
+        out << to_cxx(it->type, it->name);
+     }
+   return out;
+}
+
 struct
 constructor_parameters_list
 {