mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-22 07:44:45 -08:00
formatting, fixes from testing latest in Odin fork
This commit is contained in:
parent
e3172057d3
commit
6ffdca8595
@ -305,6 +305,7 @@ struct Code
|
||||
#endif
|
||||
|
||||
Using_CodeOps( Code );
|
||||
forceinline Code operator *() { return * this; } // Required for for-range iteration.
|
||||
forceinline AST* operator ->() { return ast; }
|
||||
|
||||
Code& operator ++();
|
||||
|
@ -1414,7 +1414,7 @@ void var_to_strbuilder_ref(CodeVar self, StrBuilder* result )
|
||||
|
||||
strbuilder_append_fmt( result, "%SB %S", typename_to_string(self->ValueType), self->Name );
|
||||
|
||||
if ( self->ValueType->ArrExpr )
|
||||
if ( self->ValueType && self->ValueType->ArrExpr )
|
||||
{
|
||||
strbuilder_append_fmt( result, "[ %SB ]", code_to_string(self->ValueType->ArrExpr) );
|
||||
|
||||
|
@ -161,9 +161,9 @@ struct CodeBody
|
||||
forceinline void to_string( StrBuilder& result ) { return body_to_strbuilder_ref(* this, & result ); }
|
||||
forceinline void to_strbuilder_export( StrBuilder& result ) { return body_to_strbuilder_export(* this, & result); }
|
||||
|
||||
#endif
|
||||
forceinline Code begin() { return begin_CodeBody(* this); }
|
||||
forceinline Code end() { return end_CodeBody(* this); }
|
||||
#endif
|
||||
Using_CodeOps( CodeBody );
|
||||
forceinline operator Code() { return * rcast( Code*, this ); }
|
||||
forceinline AST_Body* operator->() { return ast; }
|
||||
|
@ -64,7 +64,7 @@ inline AST_Attributes* CodeAttributes::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -95,7 +95,7 @@ inline AST_Comment* CodeComment::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -126,7 +126,7 @@ inline AST_Constructor* CodeConstructor::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -173,7 +173,7 @@ inline AST_Define* CodeDefine::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -204,7 +204,7 @@ inline AST_Destructor* CodeDestructor::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -235,7 +235,7 @@ inline AST_Enum* CodeEnum::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -266,7 +266,7 @@ inline AST_Exec* CodeExec::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -297,7 +297,7 @@ inline AST_Extern* CodeExtern::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -328,7 +328,7 @@ inline AST_Friend* CodeFriend::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -359,7 +359,7 @@ inline AST_Fn* CodeFn::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -390,7 +390,7 @@ inline AST_Include* CodeInclude::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -421,7 +421,7 @@ inline AST_Module* CodeModule::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -452,7 +452,7 @@ inline AST_NS* CodeNS::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -483,7 +483,7 @@ inline AST_Operator* CodeOperator::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -514,7 +514,7 @@ inline AST_OpCast* CodeOpCast::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -561,7 +561,7 @@ inline AST_Pragma* CodePragma::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -592,7 +592,7 @@ inline AST_PreprocessCond* CodePreprocessCond::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -655,7 +655,7 @@ inline AST_Template* CodeTemplate::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -686,7 +686,7 @@ inline AST_Typename* CodeTypename::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -717,7 +717,7 @@ inline AST_Typedef* CodeTypedef::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -748,7 +748,7 @@ inline AST_Union* CodeUnion::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -779,7 +779,7 @@ inline AST_Using* CodeUsing::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
@ -810,7 +810,7 @@ inline AST_Var* CodeVar::operator->()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
|
@ -124,7 +124,7 @@ bool lex__eat(TokArray* self, TokType type )
|
||||
, tok.Column
|
||||
, parser_to_string(Context)
|
||||
);
|
||||
|
||||
GEN_DEBUG_TRAP();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -515,7 +515,7 @@ Code parse_array_decl()
|
||||
|
||||
if ( check( Tok_Operator ) && currtok.Text[0] == '[' && currtok.Text[1] == ']' )
|
||||
{
|
||||
Code array_expr = untyped_str( tok_to_str(currtok) );
|
||||
Code array_expr = untyped_str( txt(" ") );
|
||||
eat( Tok_Operator );
|
||||
// []
|
||||
|
||||
@ -2391,7 +2391,7 @@ CodeOperator parse_operator_after_ret_type(
|
||||
case '<':
|
||||
{
|
||||
if ( currtok.Text[1] == '=' )
|
||||
op = Op_LEqual;
|
||||
op = Op_LesserEqual;
|
||||
|
||||
else if ( currtok.Text[1] == '<' )
|
||||
{
|
||||
@ -3428,12 +3428,12 @@ CodeVar parse_variable_declaration_list()
|
||||
break;
|
||||
}
|
||||
|
||||
// eat(currtok.Type);
|
||||
|
||||
if ( specifiers )
|
||||
specifiers_append(specifiers, spec );
|
||||
else
|
||||
specifiers = def_specifier( spec );
|
||||
|
||||
eat(currtok.Type);
|
||||
}
|
||||
// , <Specifiers>
|
||||
|
||||
|
@ -505,7 +505,7 @@ CodeBody gen_ast_inlines()
|
||||
{
|
||||
if ( ast == nullptr )
|
||||
{
|
||||
log_failure( "Attempt to dereference a nullptr!" );
|
||||
log_failure( "Attempt to dereference a nullptr!\n" );
|
||||
return nullptr;
|
||||
}
|
||||
return ast;
|
||||
|
@ -176,9 +176,9 @@ int gen_main()
|
||||
Code timing = scan_file( path_base "dependencies/timing.cpp" );
|
||||
|
||||
header.print_fmt( roll_own_dependencies_guard_start );
|
||||
header.print( impl_start );
|
||||
header.print_fmt( "GEN_NS_BEGIN\n\n");
|
||||
|
||||
header.print( impl_start );
|
||||
header.print( debug );
|
||||
header.print( string_ops );
|
||||
header.print( printing );
|
||||
@ -210,7 +210,6 @@ int gen_main()
|
||||
Code untyped = scan_file( path_base "components/interface.untyped.cpp" );
|
||||
|
||||
CodeBody etoktype = gen_etoktype( path_base "enums/ETokType.csv", path_base "enums/AttributeTokens.csv" );
|
||||
CodeNS parser_nspace = def_namespace( name(parser), def_namespace_body( args(etoktype)) );
|
||||
|
||||
header.print_fmt( "\nGEN_NS_BEGIN\n");
|
||||
header.print( static_data );
|
||||
@ -225,7 +224,7 @@ int gen_main()
|
||||
header.print( interface );
|
||||
header.print( upfront );
|
||||
header.print_fmt( "\n#pragma region Parsing\n\n" );
|
||||
header.print( format(parser_nspace) );
|
||||
header.print( format(etoktype) );
|
||||
header.print( lexer );
|
||||
header.print( parser );
|
||||
header.print( parsing_interface );
|
||||
|
Loading…
Reference in New Issue
Block a user