parse_typedef works (sanity test case)
This commit is contained in:
1 parent
b360cf3024
commit
498a51c899
8 files changed
+153
-128
No files matched your search
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
#ifdef gen_time
|
||||
#include "gen.hpp"
|
||||
|
||||
using namespace gen;
|
||||
|
||||
void gen_sanity()
|
||||
{
|
||||
Builder
|
||||
gen_sanity_file;
|
||||
gen_sanity_file.open("./sanity.gen.hpp");
|
||||
|
||||
gen_sanity_file.print( def_comment( StrC::from(
|
||||
"The following will show a series of base cases for the gen parsed api.\n"
|
||||
)));
|
||||
|
||||
// Typedef
|
||||
{
|
||||
Code u8_typedef = parse_typedef( code(
|
||||
typedef unsigned char u8;
|
||||
));
|
||||
|
||||
gen_sanity_file.print(u8_typedef);
|
||||
}
|
||||
|
||||
gen_sanity_file.print_fmt("\n");
|
||||
|
||||
// Class
|
||||
if (0)
|
||||
{
|
||||
Code fwd = parse_class( code(
|
||||
class TestEmptyClass;
|
||||
));
|
||||
|
||||
Code empty_body = parse_class( code(
|
||||
class TestEmptyClass
|
||||
{};
|
||||
));
|
||||
|
||||
empty_body.body()->add_entry( def_comment( StrC::from("Empty class body") ) );
|
||||
|
||||
gen_sanity_file.print(fwd);
|
||||
gen_sanity_file.print(empty_body);
|
||||
}
|
||||
|
||||
gen_sanity_file.print_fmt("\n");
|
||||
|
||||
// Enum
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
gen_sanity_file.write();
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user