static void statement (LexState *ls) {
  int line = ls->linenumber;  /* may be needed for error messages */
  enterlevel(ls);
  switch (ls->t.token) {
    case ';': {  /* stat -> ';' (empty statement) */
      luaX_next(ls);  /* skip ';' */
      break;
    }
    case TK_IF: {  /* stat -> ifstat */
      ifstat(ls, line);
      break;
    }
    case TK_WHILE: {  /* stat -> whilestat */
      whilestat(ls, line);
      break;
    }
    case TK_DO: {  /* stat -> DO block END */
      luaX_next(ls);  /* skip DO */
      block(ls);
      check_match(ls, TK_END, TK_DO, line);
      break;
    }
    case TK_FOR: {  /* stat -> forstat */
      forstat(ls, line);
      break;
    }
    case TK_REPEAT: {  /* stat -> repeatstat */
      repeatstat(ls, line);
      break;
    }
    case TK_FUNCTION: {  /* stat -> funcstat */
      funcstat(ls, line);
      break;
    }
    case TK_LOCAL: {  /* stat -> localstat */
      luaX_next(ls);  /* skip LOCAL */
      if (testnext(ls, TK_FUNCTION))  /* local function? */
        localfunc(ls);
      else
        localstat(ls);
      break;
    }
    case TK_DBCOLON: {  /* stat -> label */
      luaX_next(ls);  /* skip double colon */
      labelstat(ls, str_checkname(ls), line);
      break;
    }
    case TK_RETURN: {  /* stat -> retstat */
      luaX_next(ls);  /* skip RETURN */
      retstat(ls);
      break;
    }
    case TK_BREAK: {  /* stat -> breakstat */
      breakstat(ls);
      break;
    }
    case TK_GOTO: {  /* stat -> 'goto' NAME */
      luaX_next(ls);  /* skip 'goto' */
      gotostat(ls);
      break;
    }
    default: {  /* stat -> func | assignment */
      exprstat(ls);
      break;
    }
  }
  lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg &&
             ls->fs->freereg >= luaY_nvarstack(ls->fs));
  ls->fs->freereg = luaY_nvarstack(ls->fs);  /* free registers */
  leavelevel(ls);
}
static void statement (LexState *ls) {
  int line = ls->linenumber;   
  enterlevel(ls);
  switch (ls->t.token) {
    case ';': {   
      luaX_next(ls);   
      break;
    }
    case TK_IF: {   
      ifstat(ls, line);
      break;
    }
    case TK_WHILE: {   
      whilestat(ls, line);
      break;
    }
    case TK_DO: {   
      luaX_next(ls);   
      block(ls);
      check_match(ls, TK_END, TK_DO, line);
      break;
    }
    case TK_FOR: {   
      forstat(ls, line);
      break;
    }
    case TK_REPEAT: {   
      repeatstat(ls, line);
      break;
    }
    case TK_FUNCTION: {   
      funcstat(ls, line);
      break;
    }
    case TK_LOCAL: {   
      luaX_next(ls);   
      if (testnext(ls, TK_FUNCTION))   
        localfunc(ls);
      else
        localstat(ls);
      break;
    }
    case TK_DBCOLON: {   
      luaX_next(ls);   
      labelstat(ls, str_checkname(ls), line);
      break;
    }
    case TK_RETURN: {   
      luaX_next(ls);   
      retstat(ls);
      break;
    }
    case TK_BREAK: {   
      breakstat(ls);
      break;
    }
    case TK_GOTO: {   
      luaX_next(ls);   
      gotostat(ls);
      break;
    }
    default: {   
      exprstat(ls);
      break;
    }
  }
  lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg &&
             ls->fs->freereg >= luaY_nvarstack(ls->fs));
  ls->fs->freereg = luaY_nvarstack(ls->fs);   
  leavelevel(ls);
}