mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-14 18:51:47 -07:00
Progress toward preprocessor parsing, lexing works, parsing does not.
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include "gen.cpp"
|
||||
#include "sanity.cpp"
|
||||
#include "SOA.cpp"
|
||||
#include "test.singleheader_ast.cpp"
|
||||
|
||||
#if GEN_TIME
|
||||
int gen_main()
|
||||
@ -12,10 +13,12 @@ int gen_main()
|
||||
using namespace gen;
|
||||
log_fmt("\ngen_time:");
|
||||
|
||||
check_sanity();
|
||||
// check_sanity();
|
||||
|
||||
check_SOA();
|
||||
|
||||
check_singleheader_ast();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
31
test/test.singleheader_ast.cpp
Normal file
31
test/test.singleheader_ast.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#define GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
||||
#define GEN_ENFORCE_STRONG_CODE_TYPES
|
||||
#define GEN_EXPOSE_BACKEND
|
||||
#define GEN_BENCHMARK
|
||||
#include "gen.hpp"
|
||||
#include "file_processors/scanner.hpp"
|
||||
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 } );
|
||||
|
||||
log_fmt("generated AST!!!");
|
||||
|
||||
Builder builder;
|
||||
builder.open( "singleheader_copy.hpp" );
|
||||
log_fmt("serializng ast");
|
||||
builder.print( ast );
|
||||
builder.write();
|
||||
|
||||
log_fmt("passed!!\n");
|
||||
gen::deinit();
|
||||
}
|
Reference in New Issue
Block a user