MCPcopy Create free account
hub / github.com/boostorg/build / function_call_rule

Function function_call_rule

v2/engine/function.c:427–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427static LIST * function_call_rule( JAM_FUNCTION * function, FRAME * frame,
428 STACK * s, int n_args, char const * unexpanded, OBJECT * file, int line )
429{
430 FRAME inner[ 1 ];
431 int i;
432 LIST * first = stack_pop( s );
433 LIST * result = L0;
434 OBJECT * rulename;
435 LIST * trailing;
436
437 frame->file = file;
438 frame->line = line;
439
440 if ( list_empty( first ) )
441 {
442 backtrace_line( frame );
443 printf( "warning: rulename %s expands to empty string\n", unexpanded );
444 backtrace( frame );
445 list_free( first );
446 for ( i = 0; i < n_args; ++i )
447 list_free( stack_pop( s ) );
448 return result;
449 }
450
451 rulename = object_copy( list_front( first ) );
452
453 frame_init( inner );
454 inner->prev = frame;
455 inner->prev_user = frame->module->user_module ? frame : frame->prev_user;
456 inner->module = frame->module; /* This gets fixed up in evaluate_rule(). */
457
458 for ( i = 0; i < n_args; ++i )
459 lol_add( inner->args, stack_at( s, n_args - i - 1 ) );
460
461 for ( i = 0; i < n_args; ++i )
462 stack_pop( s );
463
464 trailing = list_pop_front( first );
465 if ( trailing )
466 {
467 if ( inner->args->count == 0 )
468 lol_add( inner->args, trailing );
469 else
470 {
471 LIST * * const l = &inner->args->list[ 0 ];
472 *l = list_append( trailing, *l );
473 }
474 }
475
476 result = evaluate_rule( bindrule( rulename, inner->module ), rulename, inner );
477 frame_free( inner );
478 object_free( rulename );
479 return result;
480}
481
482static LIST * function_call_member_rule( JAM_FUNCTION * function, FRAME * frame, STACK * s, int n_args, OBJECT * rulename, OBJECT * file, int line )
483{

Callers 1

function_runFunction · 0.85

Calls 14

stack_popFunction · 0.85
backtrace_lineFunction · 0.85
list_freeFunction · 0.85
object_copyFunction · 0.85
frame_initFunction · 0.85
lol_addFunction · 0.85
stack_atFunction · 0.85
list_pop_frontFunction · 0.85
list_appendFunction · 0.85
evaluate_ruleFunction · 0.85
bindruleFunction · 0.85
frame_freeFunction · 0.85

Tested by

no test coverage detected