/* Try to make 'e' a K expression with an index in the range of R/K indices. Return true iff succeeded.  */
static int luaK_exp2K(FuncState *fs, expdesc *e)
/* Try to make 'e' a K expression with an index in the range of R/K indices. Return true iff succeeded.  */
static int luaK_exp2K(FuncState *fs, expdesc *e)
{
    int info;
    switch (e->k) {
      case VTRUE: info = boolT(fs); break;
      case VFALSE: info = boolF(fs); break;
      case VNIL: info = nilK(fs); break;
      case VKINT: info = luaK_intK(fs, e->u.ival); break;
      case VKFLT: info = luaK_numberK(fs, e->u.nval); break;
      case VKSTR: info = stringK(fs, e->u.strval); break;
      case VK: info = e->u.info; break;
      default: return 0;
    }
    if (info <= MAXINDEXRK) {
      e->k = VK;
      e->u.info = info;
      return 1;
    }
  }
  return 0;
}