mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-14 18:51:47 -07:00
Parsing constructors work, finally reached parity.
This commit is contained in:
@ -2079,6 +2079,9 @@ namespace gen
|
||||
|
||||
case Friend:
|
||||
result.append_fmt( "friend %s", Declaration->to_string() );
|
||||
|
||||
if ( result[ result.length() -1 ] != ';' )
|
||||
result.append( ";" );
|
||||
break;
|
||||
|
||||
case Function:
|
||||
@ -2221,7 +2224,7 @@ namespace gen
|
||||
else
|
||||
result.append_fmt( "%s", ValueType->to_string() );
|
||||
|
||||
if ( NumEntries - 1)
|
||||
if ( NumEntries - 1 > 0)
|
||||
{
|
||||
for ( CodeParam param : Next->cast<CodeParam>() )
|
||||
{
|
||||
@ -5382,7 +5385,7 @@ namespace gen
|
||||
internal CodeType parse_type ( Parser::TokArray& toks, char const* context );
|
||||
internal CodeTypedef parse_typedef ( Parser::TokArray& toks, char const* context );
|
||||
internal CodeUnion parse_union ( Parser::TokArray& toks, char const* context );
|
||||
internal CodeUsing parse_using ( Parser::TokArray& toks, char const* context );
|
||||
internal Code parse_using ( Parser::TokArray& toks, char const* context );
|
||||
|
||||
internal inline
|
||||
Code parse_array_decl( Parser::TokArray& toks, char const* context )
|
||||
@ -5535,6 +5538,8 @@ namespace gen
|
||||
if ( value )
|
||||
result->Value = value;
|
||||
|
||||
result->NumEntries++;
|
||||
|
||||
while ( left
|
||||
&& use_template_capture ?
|
||||
currtok.Type != TokType::Operator && currtok.Text[0] != '>'
|
||||
@ -7490,7 +7495,7 @@ namespace gen
|
||||
}
|
||||
|
||||
internal
|
||||
CodeUsing parse_using( Parser::TokArray& toks, char const* context )
|
||||
Code parse_using( Parser::TokArray& toks, char const* context )
|
||||
{
|
||||
using namespace Parser;
|
||||
|
||||
@ -7531,21 +7536,30 @@ namespace gen
|
||||
|
||||
using namespace ECode;
|
||||
|
||||
CodeUsing
|
||||
result = (CodeUsing) make_code();
|
||||
result->Type = is_namespace ? Using_Namespace : Using;
|
||||
Code
|
||||
result = make_code();
|
||||
result->Name = get_cached_string( name );
|
||||
|
||||
if ( type )
|
||||
result->UnderlyingType = type;
|
||||
if ( is_namespace)
|
||||
{
|
||||
result->Type = Using_Namespace;
|
||||
}
|
||||
else
|
||||
{
|
||||
result->Type = Using;
|
||||
|
||||
if ( array_expr )
|
||||
type->ArrExpr = array_expr;
|
||||
CodeUsing using_code = (CodeUsing) result;
|
||||
|
||||
if ( type )
|
||||
using_code->UnderlyingType = type;
|
||||
|
||||
if ( array_expr )
|
||||
type->ArrExpr = array_expr;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
CodeUsing parse_using( StrC def )
|
||||
Code parse_using( StrC def )
|
||||
{
|
||||
check_parse_args( parse_using, def );
|
||||
using namespace Parser;
|
||||
|
@ -2683,7 +2683,6 @@ namespace gen
|
||||
{ \
|
||||
return ast != nullptr; \
|
||||
}
|
||||
// operator AST*();
|
||||
|
||||
template< class Type >
|
||||
Type cast()
|
||||
@ -2696,6 +2695,10 @@ namespace gen
|
||||
return ast;
|
||||
}
|
||||
Code& operator ++();
|
||||
Code& operator*()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Using_Code( Code );
|
||||
|
||||
@ -2841,7 +2844,7 @@ namespace gen
|
||||
union {
|
||||
OperatorT Op;
|
||||
AccessSpec ParentAccess;
|
||||
u32 NumEntries;
|
||||
s32 NumEntries;
|
||||
};
|
||||
};
|
||||
|
||||
@ -2896,7 +2899,7 @@ namespace gen
|
||||
union {
|
||||
OperatorT Op;
|
||||
AccessSpec ParentAccess;
|
||||
u32 NumEntries;
|
||||
s32 NumEntries;
|
||||
};
|
||||
};
|
||||
|
||||
@ -2966,16 +2969,16 @@ namespace gen
|
||||
return * rcast( Code*, this );
|
||||
}
|
||||
#pragma region Iterator
|
||||
Code* begin()
|
||||
Code begin()
|
||||
{
|
||||
if ( ast )
|
||||
return rcast( Code*, & rcast( AST*, ast)->Front );
|
||||
return { rcast( AST*, ast)->Front };
|
||||
|
||||
return nullptr;
|
||||
return { nullptr };
|
||||
}
|
||||
Code* end()
|
||||
Code end()
|
||||
{
|
||||
return nullptr;
|
||||
return { rcast(AST*, ast)->Back->Next };
|
||||
}
|
||||
#pragma endregion Iterator
|
||||
|
||||
@ -3130,7 +3133,8 @@ namespace gen
|
||||
Code Parent;
|
||||
StringCached Name;
|
||||
CodeT Type;
|
||||
char _PAD_UNUSED_[ sizeof(ModuleFlag) + sizeof(u32) ];
|
||||
char _PAD_UNUSED_[ sizeof(ModuleFlag) ];
|
||||
s32 NumEntries;
|
||||
};
|
||||
static_assert( sizeof(AST_Body) == sizeof(AST), "ERROR: AST_Filtered is not the same size as AST");
|
||||
|
||||
@ -3399,7 +3403,7 @@ namespace gen
|
||||
StringCached Name;
|
||||
CodeT Type;
|
||||
char _PAD_UNUSED_[ sizeof(ModuleFlag) ];
|
||||
u32 NumEntries;
|
||||
s32 NumEntries;
|
||||
};
|
||||
static_assert( sizeof(AST_Param) == sizeof(AST), "ERROR: AST_Param is not the same size as AST");
|
||||
|
||||
@ -3412,7 +3416,7 @@ namespace gen
|
||||
StringCached Name;
|
||||
CodeT Type;
|
||||
char _PAD_UNUSED_[ sizeof(ModuleFlag) ];
|
||||
u32 NumEntries;
|
||||
s32 NumEntries;
|
||||
};
|
||||
static_assert( sizeof(AST_Specifier) == sizeof(AST), "ERROR: AST_Specifier is not the same size as AST");
|
||||
|
||||
@ -3721,7 +3725,7 @@ namespace gen
|
||||
CodeType parse_type ( StrC type_def );
|
||||
CodeTypedef parse_typedef ( StrC typedef_def );
|
||||
CodeUnion parse_union ( StrC union_def );
|
||||
CodeUsing parse_using ( StrC using_def );
|
||||
Code parse_using ( StrC using_def );
|
||||
CodeVar parse_variable ( StrC var_def );
|
||||
# endif
|
||||
# pragma endregion Parsing
|
||||
|
Reference in New Issue
Block a user