You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
++ idx; // Will incremnt to possible comma position
if ( _ctx->parser.Tokens.Arr[ idx ].Type != Tok_Comma )
break;
detected_non_varadic_unpaired_param = true;
}
for example, the above uses raw iteration through the lexed tokens to resolve if after thee macro argument is a comma.
We need to setup utilizing a slice for a set of tokens to look ahead that will behave as a sub-slice of the full lexed slice:
structLexSlice
{
Token* Ptr;
s32 Len;
s32 Idx;
};
Like with the regular tokens array, it needs a simple interface to navigate with it (could probably just recycle the current one with TokArray and just change it to take a slice instead.
This sort of iteration is used throughout the parser for aggregating tokens the parser cannot parse:
The parser needs a review both for updating the algo's documentation and to reduce repetitive code.
As of 868b93c much of the parser is littered with manual look-ahead loops to resolve contextual ambiguities:
gencpp/base/components/parser.cpp
Lines 2488 to 2524 in 868b93c
for example, the above uses raw iteration through the lexed tokens to resolve if after thee macro argument is a comma.
We need to setup utilizing a slice for a set of tokens to look ahead that will behave as a sub-slice of the full lexed slice:
Like with the regular tokens array, it needs a simple interface to navigate with it (could probably just recycle the current one with TokArray and just change it to take a slice instead.
This sort of iteration is used throughout the parser for aggregating tokens the parser cannot parse:
It can be generalized for both consumption and look-ahead.
The text was updated successfully, but these errors were encountered: