engine/source/preprocessorlib/pp_expr.c
/**
 * Parses an #if/#elif boolean expression from the parser and evaluates it.
 * @param lexer a lexer where the next token is the start of the expression
 * @return 1 if result is nonzero, 0 if result is zero, -1 on error
 */
Parses an #if/#elif boolean expression from the parser and evaluates it.
@param lexer a lexer where the next token is the start of the expression
@return 1 if result is nonzero, 0 if result is zero, -1 on error
Parses an #if / #elif boolean expression from the parser and evaluates it . @param lexer a lexer where the next token is the start of the expression @return 1 if result is nonzero 0 if result is zero - 1 on error
int pp_expr_eval_expression(pp_parser *parser)
{
    int result;
    pp_expr *expression = pp_expr_parse(parser, false);
    if(expression == NULL)
    {
        return -1;
    }
    pp_expr_fix_precedence(expression);
    result = pp_expr_eval(expression) ? 1 : 0;
    pp_expr_destroy(expression);
    return result;
}
int pp_expr_eval_expression ( pp_parser * parser ) { int result ; pp_expr * expression = pp_expr_parse ( parser , false ) ; if ( expression == NULL ) { return -1 ; } pp_expr_fix_precedence ( expression ) ; result = pp_expr_eval ( expression ) ? 1 : 0 ; pp_expr_destroy ( expression ) ; return result ; }
Parses an #if/#elif boolean expression from the parser and evaluates it.
Parses an #if / #elif boolean expression from the parser and evaluates it .