Testing git keys, sorry
This commit is contained in:
parent
2ea49d61d7
commit
3032016155
26
src/l1/codegen/list_template_inst.h
Normal file
26
src/l1/codegen/list_template_inst.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef prototype1_src_l1_codegen_list_template_inst_h
|
||||
#define prototype1_src_l1_codegen_list_template_inst_h
|
||||
|
||||
#include "codegen.h"
|
||||
|
||||
typedef struct {
|
||||
SpanU8 T;
|
||||
bool t_primitive;
|
||||
bool t_clonable;
|
||||
} list_instantiation_op;
|
||||
|
||||
NODISCARD VecU8 generate_List_template_instantiation(list_instantiation_op op){
|
||||
if (op.t_primitive)
|
||||
op.t_clonable = true;
|
||||
assert(op.T.len > 0);
|
||||
|
||||
VecU8 res = VecU8_fmt(
|
||||
"typedef struct ListNode_%s ListNode_%s;\n" /* op.T, op.T */
|
||||
"struct ListNode_%s {\n" /* op.T */
|
||||
SPACE ""
|
||||
"}\n\n"
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user