mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-14 18:51:47 -07:00
WIP: Restructuring project
This commit is contained in:
@ -52,7 +52,7 @@ constexpr StrC implementation_guard_end = txt(R"(
|
||||
#pragma endregion GENCPP IMPLEMENTATION GUARD
|
||||
)");
|
||||
|
||||
void format_file( char const* path )
|
||||
void CHANGE_format_file( char const* path )
|
||||
{
|
||||
String resolved_path = String::make(GlobalAllocator, to_strc_from_c_str(path));
|
||||
|
||||
@ -77,7 +77,7 @@ void format_file( char const* path )
|
||||
#undef cf_verbse
|
||||
}
|
||||
|
||||
Code format_code_to_untyped( Code code )
|
||||
Code CHANGE_format_code_to_untyped( Code code )
|
||||
{
|
||||
Builder ecode_file_temp = Builder::open("gen/scratch.hpp");
|
||||
ecode_file_temp.print(code);
|
||||
@ -88,18 +88,8 @@ Code format_code_to_untyped( Code code )
|
||||
return result;
|
||||
}
|
||||
|
||||
CodeBody parse_file( const char* path )
|
||||
{
|
||||
FileContents file = file_read_contents( GlobalAllocator, true, path );
|
||||
CodeBody code = parse_global_body( { file.size, (char const*)file.data } );
|
||||
log_fmt("\nParsed: %s\n", path);
|
||||
return code;
|
||||
}
|
||||
|
||||
constexpr bool helper_use_c_definition = true;
|
||||
|
||||
constexpr bool will_refactor_to_gen_namespace = true;
|
||||
|
||||
int gen_main()
|
||||
{
|
||||
#define project_dir "../project/"
|
||||
@ -116,8 +106,8 @@ int gen_main()
|
||||
PreprocessorDefines.append(txt("Using_CodeOps("));
|
||||
PreprocessorDefines.append(txt("GEN_OPTIMIZE_MAPPINGS_BEGIN"));
|
||||
PreprocessorDefines.append(txt("GEN_OPITMIZE_MAPPINGS_END"));
|
||||
//PreprocessorDefines.append(txt("GEN_EXECUTION_EXPRESSION_SUPPORT"));
|
||||
PreprocessorDefines.append(txt("GEN_PARAM_DEFAULT"));
|
||||
//PreprocessorDefines.append(txt("GEN_EXECUTION_EXPRESSION_SUPPORT"));
|
||||
|
||||
Code push_ignores = scan_file( project_dir "helpers/push_ignores.inline.hpp" );
|
||||
Code pop_ignores = scan_file( project_dir "helpers/pop_ignores.inline.hpp" );
|
||||
@ -1181,10 +1171,10 @@ R"(#define <interface_name>( code ) _Generic( (code), \
|
||||
|
||||
#pragma region Resolve Components
|
||||
CodeBody array_arena = gen_array(txt("gen_Arena"), txt("Array_gen_Arena"));
|
||||
CodeBody array_pool = gen_array(txt("gen_Pool"), txt("Array_gen_Pool"));
|
||||
CodeBody array_pool = gen_array(txt("gen_Pool"), txt("Array_gen_Pool"));
|
||||
CodeBody array_token = gen_array(txt("gen_Token"), txt("Array_gen_Token"));
|
||||
|
||||
Code src_static_data = scan_file( project_dir "components/static_data.cpp" );
|
||||
Code src_static_data = scan_file( project_dir "components/static_data.cpp" );
|
||||
Code src_ast_case_macros = scan_file( project_dir "components/ast_case_macros.cpp" );
|
||||
Code src_code_serialization = scan_file( project_dir "components/code_serialization.cpp" );
|
||||
Code src_interface = scan_file( project_dir "components/interface.cpp" );
|
||||
|
@ -1,14 +1,5 @@
|
||||
__VERSION 1
|
||||
|
||||
// This is a example template to be used with the refactor program
|
||||
// Use it to refactor the naming convention of this library to your own.
|
||||
// Can be used as an aid to help use use your project's implementation if it fullfills the dependencies of this project.
|
||||
// Example: Most likely have a memory and string library already, just rename the functions and make sure the args are the same.
|
||||
// Program: https://github.com/Ed94/refactor
|
||||
|
||||
// NOTE: Due to the current limitations of the program, not every symbol in the library can be renamed.
|
||||
// This is due to the program not actually parsing C/C++.
|
||||
|
||||
// not : Ignore
|
||||
// include : #includes
|
||||
// word : Alphanumeric or underscore
|
||||
@ -21,6 +12,9 @@
|
||||
// Gen Macro namespace
|
||||
// namespace GEN_, new_namespace_
|
||||
|
||||
// c_library.refactor
|
||||
// Used to prefix all exposed identifiers with the gen_namespace by c_library.cpp using ./gencpp/scripts/helpers/refactor.exe
|
||||
|
||||
// Macros
|
||||
|
||||
word global, gen_global
|
||||
|
Reference in New Issue
Block a user