diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-05 15:03:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-05 15:03:15 -0300 |
commit | e888976bc6ba5592fb8ab8ecc04a8f63e217aa74 (patch) | |
tree | ae0a03f16d413e6a901c6a5f64058264974672fb | |
parent | 4d46289331395a845c5de1f6c0e0fe873c50db4f (diff) | |
download | lua-e888976bc6ba5592fb8ab8ecc04a8f63e217aa74.tar.gz lua-e888976bc6ba5592fb8ab8ecc04a8f63e217aa74.tar.bz2 lua-e888976bc6ba5592fb8ab8ecc04a8f63e217aa74.zip |
Details (typos in comments)
-rw-r--r-- | lauxlib.c | 2 | ||||
-rw-r--r-- | lgc.c | 2 | ||||
-rw-r--r-- | liolib.c | 2 | ||||
-rw-r--r-- | loadlib.c | 2 | ||||
-rw-r--r-- | lopcodes.h | 6 | ||||
-rw-r--r-- | lstate.h | 8 | ||||
-rw-r--r-- | ltablib.c | 2 | ||||
-rw-r--r-- | ltm.c | 12 | ||||
-rw-r--r-- | luaconf.h | 2 |
9 files changed, 19 insertions, 19 deletions
@@ -62,7 +62,7 @@ static int findfield (lua_State *L, int objidx, int level) { | |||
62 | else if (findfield(L, objidx, level - 1)) { /* try recursively */ | 62 | else if (findfield(L, objidx, level - 1)) { /* try recursively */ |
63 | /* stack: lib_name, lib_table, field_name (top) */ | 63 | /* stack: lib_name, lib_table, field_name (top) */ |
64 | lua_pushliteral(L, "."); /* place '.' between the two names */ | 64 | lua_pushliteral(L, "."); /* place '.' between the two names */ |
65 | lua_replace(L, -3); /* (in the slot ocupied by table) */ | 65 | lua_replace(L, -3); /* (in the slot occupied by table) */ |
66 | lua_concat(L, 3); /* lib_name.field_name */ | 66 | lua_concat(L, 3); /* lib_name.field_name */ |
67 | return 1; | 67 | return 1; |
68 | } | 68 | } |
@@ -1250,7 +1250,7 @@ static void setminordebt (global_State *g) { | |||
1250 | /* | 1250 | /* |
1251 | ** Does a major collection after last collection was a "bad collection". | 1251 | ** Does a major collection after last collection was a "bad collection". |
1252 | ** | 1252 | ** |
1253 | ** When the program is building a big struture, it allocates lots of | 1253 | ** When the program is building a big structure, it allocates lots of |
1254 | ** memory but generates very little garbage. In those scenarios, | 1254 | ** memory but generates very little garbage. In those scenarios, |
1255 | ** the generational mode just wastes time doing small collections, and | 1255 | ** the generational mode just wastes time doing small collections, and |
1256 | ** major collections are frequently what we call a "bad collection", a | 1256 | ** major collections are frequently what we call a "bad collection", a |
@@ -338,7 +338,7 @@ static int io_readline (lua_State *L); | |||
338 | #define MAXARGLINE 250 | 338 | #define MAXARGLINE 250 |
339 | 339 | ||
340 | /* | 340 | /* |
341 | ** Auxiliar function to create the iteration function for 'lines'. | 341 | ** Auxiliary function to create the iteration function for 'lines'. |
342 | ** The iteration function is a closure over 'io_readline', with | 342 | ** The iteration function is a closure over 'io_readline', with |
343 | ** the following upvalues: | 343 | ** the following upvalues: |
344 | ** 1) The file being read (first value in the stack) | 344 | ** 1) The file being read (first value in the stack) |
@@ -308,7 +308,7 @@ static void setpath (lua_State *L, const char *fieldname, | |||
308 | luaL_addchar(&b, *LUA_PATH_SEP); | 308 | luaL_addchar(&b, *LUA_PATH_SEP); |
309 | } | 309 | } |
310 | luaL_addstring(&b, dft); /* add default */ | 310 | luaL_addstring(&b, dft); /* add default */ |
311 | if (dftmark < path + len - 2) { /* is there a sufix after ';;'? */ | 311 | if (dftmark < path + len - 2) { /* is there a suffix after ';;'? */ |
312 | luaL_addchar(&b, *LUA_PATH_SEP); | 312 | luaL_addchar(&b, *LUA_PATH_SEP); |
313 | luaL_addlstring(&b, dftmark + 2, (path + len - 2) - dftmark); | 313 | luaL_addlstring(&b, dftmark + 2, (path + len - 2) - dftmark); |
314 | } | 314 | } |
@@ -286,9 +286,9 @@ OP_RETURN,/* A B C return R(A), ... ,R(A+B-2) (see note) */ | |||
286 | OP_RETURN0,/* return */ | 286 | OP_RETURN0,/* return */ |
287 | OP_RETURN1,/* A return R(A) */ | 287 | OP_RETURN1,/* A return R(A) */ |
288 | 288 | ||
289 | OP_FORLOOP,/* A Bx R(A)+=R(A+2); | 289 | OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */ |
290 | if R(A) <?= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */ | 290 | OP_FORPREP,/* A Bx <check values and prepare counters>; |
291 | OP_FORPREP,/* A Bx R(A)-=R(A+2); pc+=Bx */ | 291 | if not to run then pc+=Bx+1; */ |
292 | 292 | ||
293 | OP_TFORPREP,/* A Bx create upvalue for R(A + 3); pc+=Bx */ | 293 | OP_TFORPREP,/* A Bx create upvalue for R(A + 3); pc+=Bx */ |
294 | OP_TFORCALL,/* A C R(A+4), ... ,R(A+3+C) := R(A)(R(A+1), R(A+2)); */ | 294 | OP_TFORCALL,/* A C R(A+4), ... ,R(A+3+C) := R(A)(R(A+1), R(A+2)); */ |
@@ -74,7 +74,7 @@ | |||
74 | ** higher part counts the number of non-yieldable calls in the stack. | 74 | ** higher part counts the number of non-yieldable calls in the stack. |
75 | ** (They are together so that we can change both with one instruction.) | 75 | ** (They are together so that we can change both with one instruction.) |
76 | ** | 76 | ** |
77 | ** Because calls to external C functions can use of unkown amount | 77 | ** Because calls to external C functions can use an unknown amount |
78 | ** of space (e.g., functions using an auxiliary buffer), calls | 78 | ** of space (e.g., functions using an auxiliary buffer), calls |
79 | ** to these functions add more than one to the count (see CSTACKCF). | 79 | ** to these functions add more than one to the count (see CSTACKCF). |
80 | ** | 80 | ** |
@@ -185,9 +185,9 @@ typedef struct CallInfo { | |||
185 | union { | 185 | union { |
186 | int funcidx; /* called-function index */ | 186 | int funcidx; /* called-function index */ |
187 | int nyield; /* number of values yielded */ | 187 | int nyield; /* number of values yielded */ |
188 | struct { /* info about transfered values (for call/return hooks) */ | 188 | struct { /* info about transferred values (for call/return hooks) */ |
189 | unsigned short ftransfer; /* offset of first value transfered */ | 189 | unsigned short ftransfer; /* offset of first value transferred */ |
190 | unsigned short ntransfer; /* number of values transfered */ | 190 | unsigned short ntransfer; /* number of values transferred */ |
191 | } transferinfo; | 191 | } transferinfo; |
192 | } u2; | 192 | } u2; |
193 | short nresults; /* expected number of results from this function */ | 193 | short nresults; /* expected number of results from this function */ |
@@ -338,7 +338,7 @@ static IdxT choosePivot (IdxT lo, IdxT up, unsigned int rnd) { | |||
338 | 338 | ||
339 | 339 | ||
340 | /* | 340 | /* |
341 | ** QuickSort algorithm (recursive function) | 341 | ** Quicksort algorithm (recursive function) |
342 | */ | 342 | */ |
343 | static void auxsort (lua_State *L, IdxT lo, IdxT up, | 343 | static void auxsort (lua_State *L, IdxT lo, IdxT up, |
344 | unsigned int rnd) { | 344 | unsigned int rnd) { |
@@ -168,8 +168,8 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
168 | 168 | ||
169 | 169 | ||
170 | void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2, | 170 | void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2, |
171 | StkId res, int inv, TMS event) { | 171 | StkId res, int flip, TMS event) { |
172 | if (inv) | 172 | if (flip) |
173 | luaT_trybinTM(L, p2, p1, res, event); | 173 | luaT_trybinTM(L, p2, p1, res, event); |
174 | else | 174 | else |
175 | luaT_trybinTM(L, p1, p2, res, event); | 175 | luaT_trybinTM(L, p1, p2, res, event); |
@@ -177,10 +177,10 @@ void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
177 | 177 | ||
178 | 178 | ||
179 | void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, | 179 | void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, |
180 | int inv, StkId res, TMS event) { | 180 | int flip, StkId res, TMS event) { |
181 | TValue aux; | 181 | TValue aux; |
182 | setivalue(&aux, i2); | 182 | setivalue(&aux, i2); |
183 | luaT_trybinassocTM(L, p1, &aux, res, inv, event); | 183 | luaT_trybinassocTM(L, p1, &aux, res, flip, event); |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
@@ -205,14 +205,14 @@ int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
205 | 205 | ||
206 | 206 | ||
207 | int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, | 207 | int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, |
208 | int inv, int isfloat, TMS event) { | 208 | int flip, int isfloat, TMS event) { |
209 | TValue aux; const TValue *p2; | 209 | TValue aux; const TValue *p2; |
210 | if (isfloat) { | 210 | if (isfloat) { |
211 | setfltvalue(&aux, cast_num(v2)); | 211 | setfltvalue(&aux, cast_num(v2)); |
212 | } | 212 | } |
213 | else | 213 | else |
214 | setivalue(&aux, v2); | 214 | setivalue(&aux, v2); |
215 | if (inv) { /* arguments were exchanged? */ | 215 | if (flip) { /* arguments were exchanged? */ |
216 | p2 = p1; p1 = &aux; /* correct them */ | 216 | p2 = p1; p1 = &aux; /* correct them */ |
217 | } | 217 | } |
218 | else | 218 | else |
@@ -493,7 +493,7 @@ | |||
493 | @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. | 493 | @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. |
494 | ** | 494 | ** |
495 | @@ LUAI_UACINT is the result of a 'default argument promotion' | 495 | @@ LUAI_UACINT is the result of a 'default argument promotion' |
496 | @@ over a lUA_INTEGER. | 496 | @@ over a LUA_INTEGER. |
497 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. | 497 | @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. |
498 | @@ LUA_INTEGER_FMT is the format for writing integers. | 498 | @@ LUA_INTEGER_FMT is the format for writing integers. |
499 | @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. | 499 | @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. |