| 501 | } |
| 502 | |
| 503 | static LIST * function_call_member_rule( JAM_FUNCTION * function, FRAME * frame, STACK * s, int32_t n_args, OBJECT * rulename, OBJECT * file, int32_t line ) |
| 504 | { |
| 505 | FRAME inner[ 1 ]; |
| 506 | int32_t i; |
| 507 | LIST * first = stack_pop( s ); |
| 508 | LIST * result = L0; |
| 509 | RULE * rule; |
| 510 | module_t * module; |
| 511 | OBJECT * real_rulename = 0; |
| 512 | |
| 513 | frame->file = file; |
| 514 | frame->line = line; |
| 515 | |
| 516 | if ( list_empty( first ) ) |
| 517 | { |
| 518 | backtrace_line( frame ); |
| 519 | out_printf( "warning: object is empty\n" ); |
| 520 | backtrace( frame ); |
| 521 | |
| 522 | list_free( first ); |
| 523 | |
| 524 | for( i = 0; i < n_args; ++i ) |
| 525 | { |
| 526 | list_free( stack_pop( s ) ); |
| 527 | } |
| 528 | |
| 529 | return result; |
| 530 | } |
| 531 | |
| 532 | /* FIXME: handle generic case */ |
| 533 | assert( list_length( first ) == 1 ); |
| 534 | |
| 535 | module = bindmodule( list_front( first ) ); |
| 536 | if ( module->class_module ) |
| 537 | { |
| 538 | rule = bindrule( rulename, module ); |
| 539 | if ( rule->procedure ) |
| 540 | { |
| 541 | real_rulename = object_copy( function_rulename( rule->procedure ) ); |
| 542 | } |
| 543 | else |
| 544 | { |
| 545 | string buf[ 1 ]; |
| 546 | string_new( buf ); |
| 547 | string_append( buf, object_str( module->name ) ); |
| 548 | string_push_back( buf, '.' ); |
| 549 | string_append( buf, object_str( rulename ) ); |
| 550 | real_rulename = object_new( buf->value ); |
| 551 | string_free( buf ); |
| 552 | } |
| 553 | } |
| 554 | else |
| 555 | { |
| 556 | string buf[ 1 ]; |
| 557 | string_new( buf ); |
| 558 | string_append( buf, object_str( list_front( first ) ) ); |
| 559 | string_push_back( buf, '.' ); |
| 560 | string_append( buf, object_str( rulename ) ); |
no test coverage detected