MAMEWorld >> News
Index   Flat Mode Flat  

ShimaPong
MAME Fan
Reged: 03/12/05
Posts: 783
Send PM
Re: MAME 0.141
01/05/11 03:25 PM


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







Entire thread
Subject Posted by Posted on
* MAME 0.141 ShimaPong 01/01/11 04:52 AM
. * Re: MAME 0.141 ShimaPong  01/02/11 04:09 PM
. * Re: MAME 0.141 ShimaPong  01/03/11 05:05 PM
. * Re: MAME 0.141 ShimaPong  01/04/11 03:38 PM
. * Re: MAME 0.141 ShimaPong  01/05/11 03:25 PM
. * Re: MAME 0.141 SmitdoggAdministrator  01/03/11 05:27 PM
. * Re: MAME 0.141 Shoegazr  01/01/11 05:31 PM
. * Re: MAME 0.141 Cyberzinho Punk  01/01/11 03:56 PM
. * Mambo A Go-Go ShimaPong  01/01/11 03:37 PM
. * Re: Mambo A Go-Go Alexis B.  01/01/11 05:44 PM
. * Re: MAME 0.141 CptGuapo  01/01/11 06:01 AM
. * Re: MAME 0.141 redk9258  01/01/11 06:54 AM
. * Re: MAME 0.141 R. Belmont  01/01/11 05:07 AM
. * Re: MAME 0.141 krick  01/01/11 09:30 AM
. * Re: MAME 0.141 AaronGiles  01/01/11 09:43 PM
. * Re: MAME 0.141 sev  01/02/11 12:44 PM
. * Re: MAME 0.141 R. Belmont  01/01/11 07:56 PM
. * Re: MAME 0.141 AaronGiles  01/01/11 09:37 PM
. * Re: MAME 0.141 Derrick Renaud  01/01/11 11:26 PM
. * Re: MAME 0.141 R. Belmont  01/02/11 02:07 AM
. * Re: MAME 0.141 gregf  01/01/11 08:54 AM
. * Re: MAME 0.141 R. Belmont  01/01/11 09:01 AM
. * Re: MAME 0.141 tamalmalamarrado  01/01/11 05:28 AM
. * Re: MAME 0.141 abelenki  01/01/11 04:59 AM
. * Re: MAME 0.141 redk9258  01/01/11 05:31 AM
. * Re: MAME 0.141 hap  01/01/11 04:53 PM

Extra information Permissions
Moderator:  John IV, Robbbert, Tafoid 
0 registered and 176 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 5797