Changes to include usage, starting to attempt singleheader automated verification

This commit is contained in:
2023-08-23 13:17:22 -04:00
parent f9117a2353
commit 30eec99628
5 changed files with 64 additions and 16 deletions

View File

@ -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;