Add message at top of codegen files to avoid overwriting them
This commit is contained in:
parent
96db885344
commit
70e075d2f6
@ -202,7 +202,12 @@ class CFile:
|
||||
outfile.write(str(self))
|
||||
|
||||
def __str__(self) -> str:
|
||||
return ""
|
||||
return """\
|
||||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED. ANY MODIFICATIONS TO IT WILL BE OVERWRITTEN
|
||||
*/
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -237,7 +242,17 @@ class CHeader(CFile):
|
||||
for func in self.funcs:
|
||||
funcs += func.declare()
|
||||
|
||||
return header_guard_open + includes + c_linkage_open + forward_declarations + types + funcs + c_linkage_close + header_guard_close
|
||||
return (
|
||||
super().__str__() +
|
||||
header_guard_open +
|
||||
includes +
|
||||
c_linkage_open +
|
||||
forward_declarations +
|
||||
types +
|
||||
funcs +
|
||||
c_linkage_close +
|
||||
header_guard_close
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -274,7 +289,15 @@ class CSource(CFile):
|
||||
for func in self.funcs:
|
||||
funcs += func.define()
|
||||
|
||||
return includes + forward_declarations + types + internal_funcs_decl + funcs + internal_funcs_def
|
||||
return (
|
||||
super().__str__() +
|
||||
includes +
|
||||
forward_declarations +
|
||||
types +
|
||||
internal_funcs_decl +
|
||||
funcs +
|
||||
internal_funcs_def
|
||||
)
|
||||
|
||||
|
||||
def get_datatype_string(_type: CDataType) -> str:
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED. ANY MODIFICATIONS TO IT WILL BE OVERWRITTEN
|
||||
*/
|
||||
|
||||
#include "./str8_list.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "./str8.h"
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED. ANY MODIFICATIONS TO IT WILL BE OVERWRITTEN
|
||||
*/
|
||||
|
||||
#ifndef STR8_LIST_H
|
||||
#define STR8_LIST_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user