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

Function argument_compiler_add

src/engine/function.cpp:3447–3513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3445}
3446
3447static void argument_compiler_add( struct argument_compiler * c, OBJECT * arg,
3448 OBJECT * file, int32_t line )
3449{
3450 switch ( c->state )
3451 {
3452 case ARGUMENT_COMPILER_FOUND_OBJECT:
3453
3454 if ( object_equal( arg, constant_question_mark ) )
3455 {
3456 c->arg.flags = ARG_OPTIONAL;
3457 }
3458 else if ( object_equal( arg, constant_plus ) )
3459 {
3460 c->arg.flags = ARG_PLUS;
3461 }
3462 else if ( object_equal( arg, constant_star ) )
3463 {
3464 c->arg.flags = ARG_STAR;
3465 }
3466
3467 dynamic_array_push( c->args, c->arg );
3468 c->state = ARGUMENT_COMPILER_START;
3469
3470 if ( c->arg.flags != ARG_ONE )
3471 break;
3472 /* fall-through */
3473
3474 case ARGUMENT_COMPILER_START:
3475
3476 c->arg.type_name = 0;
3477 c->arg.index = -1;
3478 c->arg.flags = ARG_ONE;
3479
3480 if ( is_type_name( object_str( arg ) ) )
3481 {
3482 c->arg.type_name = object_copy( arg );
3483 c->state = ARGUMENT_COMPILER_FOUND_TYPE;
3484 break;
3485 }
3486 /* fall-through */
3487
3488 case ARGUMENT_COMPILER_FOUND_TYPE:
3489
3490 if ( is_type_name( object_str( arg ) ) )
3491 {
3492 err_printf( "%s:%d: missing argument name before type name: %s\n",
3493 object_str( file ), line, object_str( arg ) );
3494 exit( EXITBAD );
3495 }
3496
3497 c->arg.arg_name = object_copy( arg );
3498 if ( object_equal( arg, constant_star ) )
3499 {
3500 c->arg.flags = ARG_VARIADIC;
3501 dynamic_array_push( c->args, c->arg );
3502 c->state = ARGUMENT_COMPILER_DONE;
3503 }
3504 else

Callers 3

arg_list_compile_builtinFunction · 0.85
arg_list_compile_pythonFunction · 0.85

Calls 5

object_equalFunction · 0.85
is_type_nameFunction · 0.85
object_strFunction · 0.85
object_copyFunction · 0.85
err_printfFunction · 0.85

Tested by

no test coverage detected