2
0
Эх сурвалжийг харах

details (comments + text of error messages)

Roberto Ierusalimschy 9 жил өмнө
parent
commit
9945253d57
1 өөрчлөгдсөн 5 нэмэгдсэн , 5 устгасан
  1. 5 5
      loslib.c

+ 5 - 5
loslib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: loslib.c,v 1.59 2015/07/06 15:16:51 roberto Exp roberto $
+** $Id: loslib.c,v 1.60 2015/11/19 19:16:22 roberto Exp roberto $
 ** Standard Operating System library
 ** See Copyright Notice in lua.h
 */
@@ -210,18 +210,18 @@ static int getboolfield (lua_State *L, const char *key) {
 
 static int getfield (lua_State *L, const char *key, int d, int delta) {
   int isnum;
-  int t = lua_getfield(L, -1, key);
+  int t = lua_getfield(L, -1, key);  /* get field and its type */
   lua_Integer res = lua_tointegerx(L, -1, &isnum);
-  if (!isnum) {  /* field is not a number? */
+  if (!isnum) {  /* field is not an integer? */
     if (t != LUA_TNIL)  /* some other value? */
-      return luaL_error(L, "field '%s' not an integer", key);
+      return luaL_error(L, "field '%s' is not an integer", key);
     else if (d < 0)  /* absent field; no default? */
       return luaL_error(L, "field '%s' missing in date table", key);
     res = d;
   }
   else {
     if (!(-L_MAXDATEFIELD <= res && res <= L_MAXDATEFIELD))
-      return luaL_error(L, "field '%s' out-of-bounds", key);
+      return luaL_error(L, "field '%s' is out-of-bound", key);
     res -= delta;
   }
   lua_pop(L, 1);