mirror of
https://github.com/Ed94/gencpp.git
synced 2025-07-12 00:25:43 -07:00
Changes to include usage, starting to attempt singleheader automated verification
This commit is contained in:
@ -416,7 +416,7 @@ CodeComment def_comment( StrC content )
|
||||
}
|
||||
|
||||
static char line[ MaxCommentLineLength ];
|
||||
|
||||
|
||||
String cmt_formatted = String::make_reserve( GlobalAllocator, kilobytes(1) );
|
||||
char const* end = content.Ptr + content.Len;
|
||||
char const* scanner = content.Ptr;
|
||||
@ -442,13 +442,13 @@ CodeComment def_comment( StrC content )
|
||||
|
||||
if ( cmt_formatted.back() != '\n' )
|
||||
cmt_formatted.append( "\n" );
|
||||
|
||||
|
||||
Code
|
||||
result = make_code();
|
||||
result->Type = ECode::Comment;
|
||||
result->Name = get_cached_string( cmt_formatted );
|
||||
result->Content = result->Name;
|
||||
|
||||
|
||||
cmt_formatted.free();
|
||||
|
||||
return (CodeComment) result;
|
||||
@ -850,7 +850,7 @@ CodeFn def_function( StrC name
|
||||
return result;
|
||||
}
|
||||
|
||||
CodeInclude def_include ( StrC path )
|
||||
CodeInclude def_include( StrC path, bool foreign )
|
||||
{
|
||||
if ( path.Len <= 0 || path.Ptr == nullptr )
|
||||
{
|
||||
@ -858,10 +858,14 @@ CodeInclude def_include ( StrC path )
|
||||
return CodeInvalid;
|
||||
}
|
||||
|
||||
StrC content = foreign ?
|
||||
to_str( str_fmt_buf( "<%.*s>\n", path.Len, path.Ptr ))
|
||||
: to_str( str_fmt_buf( "\"%.*s\"\n", path.Len, path.Ptr ));
|
||||
|
||||
Code
|
||||
result = make_code();
|
||||
result->Type = ECode::Preprocess_Include;
|
||||
result->Name = get_cached_string( path );
|
||||
result->Name = get_cached_string( content );
|
||||
result->Content = result->Name;
|
||||
|
||||
return (CodeInclude) result;
|
||||
|
Reference in New Issue
Block a user