engine/source/preprocessorlib/pp_parser.c
/**
 * Gets the next parsable token from the lexer.
 * @param skip_whitespace true to ignore whitespace, false otherwise
 */
Gets the next parsable token from the lexer.
@param skip_whitespace true to ignore whitespace, false otherwise
Gets the next parsable token from the lexer . @param skip_whitespace true to ignore whitespace false otherwise
HRESULT pp_parser_lex_token(pp_parser *self, bool skip_whitespace)
{
    bool success = true;
    while(success)
    {
        if(self->overread)
        {
            memcpy(&self->token, &self->last_token, sizeof(pp_token));
            self->overread = false;
            success = true;
        }
        else
        {
            success = SUCCEEDED(pp_lexer_GetNextToken(&self->lexer, &self->token));
        }
        if(!success)
        {
            return E_FAIL;
        }
        if(skip_whitespace && self->token.theType == PP_TOKEN_WHITESPACE)
        {
            continue;
        }
        else
        {
            break;
        }
    }
    memcpy(&self->last_token, &self->token, sizeof(pp_token));
    return S_OK;
}
HRESULT pp_parser_lex_token ( pp_parser * self , bool skip_whitespace ) { bool success = true ; while ( success ) { if ( self -> overread ) { memcpy ( & self -> token , & self -> last_token , sizeof ( pp_token ) ) ; self -> overread = false ; success = true ; } else { success = SUCCEEDED ( pp_lexer_GetNextToken ( & self -> lexer , & self -> token ) ) ; } if ( ! success ) { return E_FAIL ; } if ( skip_whitespace && self -> token . theType == PP_TOKEN_WHITESPACE ) { continue ; } else { break ; } } memcpy ( & self -> last_token , & self -> token , sizeof ( pp_token ) ) ; return S_OK ; }
Gets the next parsable token from the lexer.
Gets the next parsable token from the lexer .