2023-07-30 15:55:57 -07:00
|
|
|
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
|
|
|
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
|
|
|
#define GEN_EXPOSE_BACKEND
|
|
|
|
#define GEN_BENCHMARK
|
2023-08-04 13:12:13 -07:00
|
|
|
#include "gen/gen.hpp"
|
|
|
|
#include "gen/gen.builder.hpp"
|
|
|
|
#include "gen/gen.scanner.hpp"
|
2023-07-30 15:55:57 -07:00
|
|
|
using namespace gen;
|
|
|
|
|
|
|
|
void check_singleheader_ast()
|
|
|
|
{
|
|
|
|
#define project_dir "../../"
|
|
|
|
gen::init();
|
|
|
|
log_fmt("\ncheck_singleheader_ast:\n");
|
|
|
|
|
|
|
|
FileContents file = file_read_contents( GlobalAllocator, true, project_dir "singleheader/gen/gen.hpp" );
|
|
|
|
|
|
|
|
CodeBody ast = parse_global_body( { file.size, (char const*)file.data } );
|
|
|
|
|
2023-08-01 11:02:54 -07:00
|
|
|
log_fmt("generated AST!!!\n");
|
|
|
|
|
2023-08-04 13:12:13 -07:00
|
|
|
#if 0
|
2023-08-02 09:39:35 -07:00
|
|
|
s32 idx = 0;
|
|
|
|
for ( Code entry : ast )
|
|
|
|
{
|
2023-08-02 11:01:56 -07:00
|
|
|
if (idx == 900)
|
|
|
|
{
|
|
|
|
log_fmt("break here\n");
|
|
|
|
}
|
2023-08-02 09:39:35 -07:00
|
|
|
log_fmt("Entry %d: %s\n", idx, entry.to_string() );
|
|
|
|
idx++;
|
|
|
|
}
|
2023-08-04 13:12:13 -07:00
|
|
|
#endif
|
2023-07-30 15:55:57 -07:00
|
|
|
|
2023-08-04 13:12:13 -07:00
|
|
|
Builder builder = Builder::open( "singleheader_copy.gen.hpp" );
|
2023-08-01 17:56:00 -07:00
|
|
|
log_fmt("\n\nserializng ast\n");
|
2023-07-30 15:55:57 -07:00
|
|
|
builder.print( ast );
|
|
|
|
builder.write();
|
|
|
|
|
|
|
|
log_fmt("passed!!\n");
|
|
|
|
gen::deinit();
|
|
|
|
}
|