pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:253:    switch (TYPEOF(*sval)) {    case PIKE_T_STRING:    string_builder_shared_strcat(&s, sval->u.string);    break;    case PIKE_T_INT:    {    int raw_arg = sval->u.integer;    int arg = raw_arg & DEF_ARG_MASK;    struct pike_string *str;    if (!arguments2 || (arg >= arguments2->size)) { +  if (context_obj) { +  push_text("Too few arguments to macro %s."); +  ref_push_string(d->name); +  safe_apply(context_obj, "cpp_error", 2); +  pop_stack(); +  } else {    my_yyerror("Too few arguments to macro %S.", d->name); -  +  }    break;    }    str = arguments2->item[arg].u.string;    if (raw_arg & DEF_ARG_NEED_COMMA) {    if (!(d->flags & CPP_MACRO_VARARGS) ||    (arg != d->args-1) ||    str->len) {    /* Don't add the comma if the varargs argument and empty. */    string_builder_putchar(&s, ',');    string_builder_putchar(&s, ' ');
pike.git/src/cpp.cmod:308:    ref_push_string(str);    push_int(flags & ~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE));    safe_apply(context_obj, "cpp", 2);    string_builder_shared_strcat(&s, Pike_sp[-1].u.string);    pop_stack();    } else {    string_builder_shared_strcat(&s, str);    }       d->flags = save_flags; -  +     }    }    if (!(raw_arg & DEF_ARG_NOPOSTSPACE)) {    string_builder_putchar(&s, ' ');    }    }    break;    default:    /* FIXME: Check that we have a callable. */    if (arguments) {    add_ref(arguments);    push_array_items(arguments);    safe_apply_svalue(sval, arguments->size, 1);    } else {    safe_apply_svalue(sval, 0, 1);    }    if (TYPEOF(Pike_sp[-1]) != T_STRING) { -  my_yyerror("Invalid return value from macro: %s (expected string).", -  get_name_of_type(TYPEOF(Pike_sp[-1]))); +  if (context_obj) { +  push_text("Invalid return value from macro %s: %s (expected string)."); +  ref_push_string(d->name); +  push_text(get_name_of_type(TYPEOF(Pike_sp[-3]))); +  safe_apply(context_obj, "cpp_error", 3); +  } else { +  my_yyerror("Invalid return value from macro %S: %s (expected string).", +  d->name, get_name_of_type(TYPEOF(Pike_sp[-1]))); +  }    pop_stack();    break;    }    string_builder_shared_strcat(&s, Pike_sp[-1].u.string);    pop_stack();    break;    }    }       done: