OLD | NEW |
---|---|
(Empty) | |
1 {% macro v8_value_to_local_cpp_value(thing) %} | |
2 {# This indirection is just to avoid spurious white-space lines. #} | |
3 {{generate_v8_value_to_local_cpp_value(thing) | trim}} | |
4 {%- endmacro %} | |
5 | |
6 | |
7 {% macro generate_v8_value_to_local_cpp_value(thing) %} | |
8 {% set item = thing.v8_value_to_local_cpp_value or thing %} | |
haraken
2015/02/24 12:44:57
I'm not sure if we want to add conversions.cpp, bu
Jens Widell
2015/02/24 13:36:07
What are the arguments against adding it?
| |
9 {% if item.error_message %} | |
10 /* {{item.error_message}} */ | |
11 {% else %} | |
12 {% if item.declare_variable %} | |
13 {% if item.assign_expression %} | |
14 {{item.cpp_type}} {{item.cpp_name}} = {{item.assign_expression}}; | |
15 {% else %} | |
16 {{item.cpp_type}} {{item.cpp_name}}; | |
17 {% endif %} | |
18 {% else %}{# item.declare_variable #} | |
19 {% if item.assign_expression %} | |
20 {{item.cpp_name}} = {{item.assign_expression}}; | |
21 {% endif %} | |
22 {% endif %}{# item.declare_variable #} | |
23 {% if item.check_expression %} | |
24 {% if item.throw_expression %} | |
25 if ({{item.check_expression}}) { | |
26 {{item.throw_expression}}; | |
27 return{% if item.return_expression %} {{item.return_expression}}{% endif %}; | |
28 } | |
29 {% else %} | |
30 if ({{item.check_expression}}) | |
31 return{% if item.return_expression %} {{item.return_expression}}{% endif %}; | |
32 {% endif %} | |
33 {% endif %}{# item.check_expression #} | |
34 {% endif %}{# item.error_message #} | |
35 {% endmacro %} | |
36 | |
37 | |
OLD | NEW |