mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-22 07:44:45 -08:00
More formatting fixes
This commit is contained in:
parent
c4846dad26
commit
a6c6574390
@ -136,7 +136,7 @@ int gen_main()
|
||||
|
||||
header.print( interface );
|
||||
|
||||
header.print_fmt( "\npragma region Inlines\n" );
|
||||
header.print_fmt( "\n#pragma region Inlines\n" );
|
||||
header.print( inlines );
|
||||
header.print( fmt_newline );
|
||||
header.print( ast_inlines );
|
||||
|
@ -255,6 +255,25 @@ namespace Parser
|
||||
move_forward(); \
|
||||
}
|
||||
|
||||
#define end_line() \
|
||||
do \
|
||||
{ \
|
||||
while ( left && current == ' ' ) \
|
||||
{ \
|
||||
move_forward(); \
|
||||
} \
|
||||
if ( left && current == '\r' ) \
|
||||
{ \
|
||||
move_forward(); \
|
||||
move_forward(); \
|
||||
} \
|
||||
else if ( left && current == '\n' ) \
|
||||
{ \
|
||||
move_forward(); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
s32 left = content.Len;
|
||||
char const* scanner = content.Ptr;
|
||||
|
||||
@ -303,7 +322,6 @@ namespace Parser
|
||||
token.Length++;
|
||||
|
||||
Tokens.append( token );
|
||||
// log_fmt( "NewLine: %d\n", token.Line );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -401,11 +419,7 @@ namespace Parser
|
||||
if ( token.Type == TokType::Preprocess_Else || token.Type == TokType::Preprocess_EndIf )
|
||||
{
|
||||
Tokens.append( token );
|
||||
while ( left && current != '\n' )
|
||||
{
|
||||
move_forward();
|
||||
}
|
||||
move_forward();
|
||||
end_line();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -611,6 +625,8 @@ namespace Parser
|
||||
|
||||
if (left)
|
||||
move_forward();
|
||||
|
||||
end_line();
|
||||
goto FoundToken;
|
||||
|
||||
case '[':
|
||||
@ -714,6 +730,8 @@ namespace Parser
|
||||
|
||||
if (left)
|
||||
move_forward();
|
||||
|
||||
end_line();
|
||||
goto FoundToken;
|
||||
|
||||
case '"':
|
||||
@ -915,11 +933,7 @@ namespace Parser
|
||||
move_forward();
|
||||
move_forward();
|
||||
|
||||
while ( left && current != '\n' )
|
||||
{
|
||||
move_forward();
|
||||
}
|
||||
move_forward();
|
||||
end_line();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ int gen_main()
|
||||
CodeBody etoktype = gen_etoktype( project_dir "enums/ETokType.csv", project_dir "enums/AttributeTokens.csv" );
|
||||
CodeNS parser_nspace = def_namespace( name(Parser), def_namespace_body( args(etoktype)) );
|
||||
|
||||
header.print_fmt( "\njGEN_NS_BEGIN\n");
|
||||
header.print_fmt( "\nGEN_NS_BEGIN\n");
|
||||
header.print( static_data );
|
||||
|
||||
header.print_fmt( "#pragma region AST\n\n" );
|
||||
@ -229,7 +229,7 @@ int gen_main()
|
||||
header.print_fmt( "\n#pragma region Parsing\n\n" );
|
||||
header.print( parser_nspace );
|
||||
header.print( parsing );
|
||||
header.print_fmt( "\npragma endregion Parsing\n" );
|
||||
header.print_fmt( "\n#pragma endregion Parsing\n" );
|
||||
header.print( untyped );
|
||||
header.print_fmt( "\n#pragma endregion Interface\n\n");
|
||||
|
||||
@ -237,7 +237,7 @@ int gen_main()
|
||||
{
|
||||
header.print_fmt( "#pragma region Builder\n" );
|
||||
header.print( scan_file( project_dir "auxillary/builder.cpp" ) );
|
||||
header.print_fmt( "\npragma endregion Builder\n\n" );
|
||||
header.print_fmt( "\n#pragma endregion Builder\n\n" );
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user