1{#--- Constants #} 2{%- for constant in module.constants %} 3 var {{constant.name}} = {{constant.value|expression_to_text}}; 4{%- endfor %} 5 6{#--- Enums #} 7{%- from "enum_definition.tmpl" import enum_def %} 8{%- for enum in enums %} 9 var {{ enum_def(enum.name, enum) }} 10{%- endfor %} 11 12{#--- Struct definitions #} 13{% for struct in structs %} 14{%- include "struct_definition.tmpl" %} 15{%- endfor -%} 16 17{#--- Union definitions #} 18{%- from "union_definition.tmpl" import union_def %} 19{%- for union in unions %} 20{{union_def(union, generate_fuzzing)|indent(2)}} 21{%- endfor %} 22 23{#--- Interface definitions #} 24{%- for interface in interfaces -%} 25{%- include "interface_definition.tmpl" %} 26{%- endfor %} 27 28{%- for constant in module.constants %} 29 exports.{{constant.name}} = {{constant.name}}; 30{%- endfor %} 31{%- for enum in enums %} 32 exports.{{enum.name}} = {{enum.name}}; 33{%- endfor %} 34{%- for struct in structs if struct.exported %} 35 exports.{{struct.name}} = {{struct.name}}; 36{%- endfor %} 37{%- for union in unions %} 38 exports.{{union.name}} = {{union.name}}; 39{%- endfor %} 40{%- for interface in interfaces %} 41 exports.{{interface.name}} = {{interface.name}}; 42 exports.{{interface.name}}Ptr = {{interface.name}}Ptr; 43 exports.{{interface.name}}AssociatedPtr = {{interface.name}}AssociatedPtr; 44{%- endfor %} 45