collect_arguments( RULE* rule, LOL* all_actual )
collect_arguments( RULE* rule, FRAME* frame )
collect_arguments( RULE* rule, LOL* all_actual ){    SETTINGS *locals = 0;        LOL *all_formal = rule->arguments ? rule->arguments->data : 0;    if ( all_formal ) /* Nothing to set; nothing to check */    {        int max = all_formal->count > all_actual->count            ? all_formal->count            : all_actual->count;                int n;        for ( n = 0; n < max ; ++n )        {            LIST *formal = lol_get( all_formal, n );            LIST *actual = lol_get( all_actual, n );            while ( formal )            {                char* name = formal->string;                char modifier = 0;                LIST* value = 0;                if ( formal->next )                {                    char *next = formal->next->string;                    if ( next && next[0] != 0 && next[1] == 0 )                        modifier = next[0];                }                                if ( !actual && modifier != '?' && modifier != '*' )                {                    argument_error( "missing argument", rule, all_actual, formal );                }                switch ( modifier )                {                case '+':                case '*':                    value = list_copy( 0, actual );                    actual = 0;                    /* skip an extra element for the modifier */                    formal = formal->next;                     break;                case '?':                    /* skip an extra element for the modifier */                    formal = formal->next;                     /* fall through */                default:                    if ( actual ) /* in case actual is missing */                    {                        value = list_new( 0, actual->string );                        actual = actual->next;                    }                }                                locals = addsettings( locals, 0, name, value );                formal = formal->next;            }                        if ( actual )            {                argument_error( "extra argument", rule, all_actual, actual );            }        }    }    return locals;}