Damn! I have overlooked important sign completely!!
"!token->is_function_separator()" means "if this comma is NOT function separator" so that it SHOULD ignore if it is function separator. Otherwords, the function separator is NOT recognized by expression engine.
Why does it happens? See normalize_operator():1219
Code:
// Determine if , refers to a function parameter case TVL_COMMA: for (int lookback = 0; lookback < MAX_STACK_DEPTH; lookback++) { parse_token *peek = peek_token(lookback); if (peek == NULL) break;
// if we hit an execute function operator, or else a left parenthesis that is // already tagged, then tag us as well if (peek->is_operator(TVL_EXECUTEFUNC) || (peek->is_operator(TVL_LPAREN) && peek->is_function_separator())) { thistoken.set_function_separator(); break; } } break;
This function is called in parsing phase and checks some operators. peek_token() picks up requested parse_token from internal token_stack array by index. But this array is used in executing phase and all are empty in parsing phase. So "peek == NULL" is always TRUE and never set the flag of function separator.
Troublingly, parse_token uses simple_list template class and it only have the pointer of next and no previous. And you can only see next and previous parse_tokens in this function. In sample code, first comma can see 0x1234 and 0x5678. But you will say, "loop over token list made by parse_string_into_tokens()". It's half correct but half wrong. Because infix_to_postfix() which calls normalize_operator() detaches and reassembles main token list (it's not copy list!) So it will not be ensured that the token list in this function is not original parsed by parse_string_into_tokens().
So you will need to set complicated routine to detect.
"Any company has no power to stop people emulating"
MAME is the emulator of no giving in the pressure from any company even if they don't allow
|