Commit 136f205f authored by hbristow's avatar hbristow

added handling of constants equaling constants for C++ map

parent 6b88a21b
...@@ -33,7 +33,6 @@ class MatlabWrapperGenerator(object): ...@@ -33,7 +33,6 @@ class MatlabWrapperGenerator(object):
jtemplate.filters['void'] = void jtemplate.filters['void'] = void
jtemplate.filters['not'] = flip jtemplate.filters['not'] = flip
# load the templates # load the templates
tfunction = jtemplate.get_template('template_function_base.cpp') tfunction = jtemplate.get_template('template_function_base.cpp')
tclassm = jtemplate.get_template('template_class_base.m') tclassm = jtemplate.get_template('template_class_base.m')
......
...@@ -22,6 +22,10 @@ typedef std::unordered_map Map; ...@@ -22,6 +22,10 @@ typedef std::unordered_map Map;
*/ */
Map<std::string, int> constants = { Map<std::string, int> constants = {
{% for key, val in constants.items() %} {% for key, val in constants.items() %}
{% if val|convertibleToInt %}
{ "{{key}}", {{val}} }, { "{{key}}", {{val}} },
{% else %}
{ "{{key}}", {{constants[val]}} },
{% endif %}
{% endfor %} {% endfor %}
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment