예제 #1
0
파일: macro.c 프로젝트: leavesbnw/picrin
pic_sym *
pic_uniq(pic_state *pic, pic_value var)
{
  pic_str *str;

  assert(pic_var_p(var));

  str = pic_format(pic, "%s.%d", pic_symbol_name(pic, pic_var_name(pic, var)), pic->ucnt++);

  return pic_intern_str(pic, str);
}
예제 #2
0
파일: error.c 프로젝트: omasanori/benz
const char *
pic_errmsg(pic_state *pic)
{
  pic_str *str;

  assert(! pic_undef_p(pic->err));

  if (! pic_error_p(pic->err)) {
    str = pic_format(pic, "~s", pic->err);
  } else {
    str = pic_error_ptr(pic->err)->msg;
  }

  return pic_str_cstr(str);
}