avoid '...' and "..." inside comments

This commit is contained in:
Roberto Ierusalimschy 2001-02-22 15:59:59 -03:00
parent 52ee91dd73
commit 5f37134e64
12 changed files with 60 additions and 60 deletions

4
lapi.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lapi.c,v 1.130 2001/02/14 17:04:11 roberto Exp roberto $ ** $Id: lapi.c,v 1.131 2001/02/20 18:15:33 roberto Exp roberto $
** Lua API ** Lua API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -531,7 +531,7 @@ LUA_API int lua_ref (lua_State *L, int lock) {
/* /*
** "do" functions (run Lua code) ** `do' functions (run Lua code)
** (most of them are in ldo.c) ** (most of them are in ldo.c)
*/ */

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lbaselib.c,v 1.24 2001/02/20 18:29:54 roberto Exp roberto $ ** $Id: lbaselib.c,v 1.25 2001/02/22 17:15:18 roberto Exp roberto $
** Basic library ** Basic library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -447,7 +447,7 @@ static int luaB_tremove (lua_State *L) {
luaL_checktype(L, 1, LUA_TTABLE); luaL_checktype(L, 1, LUA_TTABLE);
n = lua_getn(L, 1); n = lua_getn(L, 1);
pos = luaL_opt_int(L, 2, n); pos = luaL_opt_int(L, 2, n);
if (n <= 0) return 0; /* table is "empty" */ if (n <= 0) return 0; /* table is `empty' */
lua_rawgeti(L, 1, pos); /* result = t[pos] */ lua_rawgeti(L, 1, pos); /* result = t[pos] */
for ( ;pos<n; pos++) { for ( ;pos<n; pos++) {
lua_rawgeti(L, 1, pos+1); lua_rawgeti(L, 1, pos+1);
@ -545,7 +545,7 @@ static void auxsort (lua_State *L, int l, int u) {
lua_rawgeti(L, 1, i); lua_rawgeti(L, 1, i);
set2(L, u-1, i); /* swap pivot (a[u-1]) with a[i] */ set2(L, u-1, i); /* swap pivot (a[u-1]) with a[i] */
/* a[l..i-1] <= a[i] == P <= a[i+1..u] */ /* a[l..i-1] <= a[i] == P <= a[i+1..u] */
/* adjust so that smaller "half" is in [j..i] and larger one in [l..u] */ /* adjust so that smaller half is in [j..i] and larger one in [l..u] */
if (i-l < u-i) { if (i-l < u-i) {
j=l; i=i-1; l=i+2; j=l; i=i-1; l=i+2;
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldebug.c,v 1.66 2001/02/20 18:28:11 roberto Exp roberto $ ** $Id: ldebug.c,v 1.67 2001/02/21 16:52:09 roberto Exp roberto $
** Debug Interface ** Debug Interface
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -277,7 +277,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
if (isactive) if (isactive)
func = ar->_func; func = ar->_func;
else { else {
what++; /* skip the '>' */ what++; /* skip the `>' */
func = L->top - 1; func = L->top - 1;
} }
for (; *what; what++) { for (; *what; what++) {

4
ldo.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldo.c,v 1.124 2001/02/20 18:15:33 roberto Exp roberto $ ** $Id: ldo.c,v 1.125 2001/02/22 17:15:18 roberto Exp roberto $
** Stack and Call structure of Lua ** Stack and Call structure of Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -276,7 +276,7 @@ static int parse_file (lua_State *L, const char *filename) {
lua_pushliteral(L, "@"); lua_pushliteral(L, "@");
lua_pushstring(L, (filename == NULL) ? "(stdin)" : filename); lua_pushstring(L, (filename == NULL) ? "(stdin)" : filename);
lua_concat(L, 2); lua_concat(L, 2);
filename = lua_tostring(L, -1); /* filename = '@'..filename */ filename = lua_tostring(L, -1); /* filename = `@'..filename */
luaZ_Fopen(&z, f, filename); luaZ_Fopen(&z, f, filename);
status = protectedparser(L, &z, bin); status = protectedparser(L, &z, bin);
lua_remove(L, -2); /* remove filename */ lua_remove(L, -2); /* remove filename */

4
lgc.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lgc.c,v 1.89 2001/02/20 18:15:33 roberto Exp roberto $ ** $Id: lgc.c,v 1.90 2001/02/20 18:28:11 roberto Exp roberto $
** Garbage Collector ** Garbage Collector
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -18,7 +18,7 @@
/* /*
** optional "lock" for GC ** optional lock for GC
** (when Lua calls GC tag methods it unlocks the regular lock) ** (when Lua calls GC tag methods it unlocks the regular lock)
*/ */
#ifndef LUA_LOCKGC #ifndef LUA_LOCKGC

14
llex.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: llex.c,v 1.77 2001/02/09 20:22:29 roberto Exp roberto $ ** $Id: llex.c,v 1.78 2001/02/22 17:15:18 roberto Exp roberto $
** Lexical Analyzer ** Lexical Analyzer
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -89,7 +89,7 @@ static void luaX_invalidchar (LexState *ls, int c) {
static void inclinenumber (LexState *LS) { static void inclinenumber (LexState *LS) {
next(LS); /* skip '\n' */ next(LS); /* skip `\n' */
++LS->linenumber; ++LS->linenumber;
luaX_checklimit(LS, LS->linenumber, MAX_INT, "lines in a chunk"); luaX_checklimit(LS, LS->linenumber, MAX_INT, "lines in a chunk");
} }
@ -167,7 +167,7 @@ static void read_number (LexState *LS, int comma, SemInfo *seminfo) {
save_and_next(L, LS, l); save_and_next(L, LS, l);
} }
if (LS->current == 'e' || LS->current == 'E') { if (LS->current == 'e' || LS->current == 'E') {
save_and_next(L, LS, l); /* read 'E' */ save_and_next(L, LS, l); /* read `E' */
if (LS->current == '+' || LS->current == '-') if (LS->current == '+' || LS->current == '-')
save_and_next(L, LS, l); /* optional exponent sign */ save_and_next(L, LS, l); /* optional exponent sign */
while (isdigit(LS->current)) { while (isdigit(LS->current)) {
@ -186,8 +186,8 @@ static void read_long_string (LexState *LS, SemInfo *seminfo) {
int cont = 0; int cont = 0;
size_t l = 0; size_t l = 0;
checkbuffer(L, 10, l); checkbuffer(L, 10, l);
save(L, '[', l); /* save first '[' */ save(L, '[', l); /* save first `[' */
save_and_next(L, LS, l); /* pass the second '[' */ save_and_next(L, LS, l); /* pass the second `[' */
for (;;) { for (;;) {
checkbuffer(L, 10, l); checkbuffer(L, 10, l);
switch (LS->current) { switch (LS->current) {
@ -218,7 +218,7 @@ static void read_long_string (LexState *LS, SemInfo *seminfo) {
save_and_next(L, LS, l); save_and_next(L, LS, l);
} }
} endloop: } endloop:
save_and_next(L, LS, l); /* skip the second ']' */ save_and_next(L, LS, l); /* skip the second `]' */
save(L, '\0', l); save(L, '\0', l);
seminfo->ts = luaS_newlstr(L, G(L)->Mbuffer+2, l-5); seminfo->ts = luaS_newlstr(L, G(L)->Mbuffer+2, l-5);
} }
@ -237,7 +237,7 @@ static void read_string (LexState *LS, int del, SemInfo *seminfo) {
luaX_error(LS, "unfinished string", TK_STRING); luaX_error(LS, "unfinished string", TK_STRING);
break; /* to avoid warnings */ break; /* to avoid warnings */
case '\\': case '\\':
next(LS); /* do not save the '\' */ next(LS); /* do not save the `\' */
switch (LS->current) { switch (LS->current) {
case 'a': save(L, '\a', l); next(LS); break; case 'a': save(L, '\a', l); next(LS); break;
case 'b': save(L, '\b', l); next(LS); break; case 'b': save(L, '\b', l); next(LS); break;

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lmathlib.c,v 1.33 2000/12/04 18:33:40 roberto Exp roberto $ ** $Id: lmathlib.c,v 1.34 2001/02/02 19:02:40 roberto Exp roberto $
** Standard mathematical library ** Standard mathematical library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -166,8 +166,8 @@ static int math_max (lua_State *L) {
static int math_random (lua_State *L) { static int math_random (lua_State *L) {
/* the '%' avoids the (rare) case of r==1, and is needed also because on /* the `%' avoids the (rare) case of r==1, and is needed also because on
some systems (SunOS!) "rand()" may return a value larger than RAND_MAX */ some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */
lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX;
switch (lua_gettop(L)) { /* check number of arguments */ switch (lua_gettop(L)) { /* check number of arguments */
case 0: { /* no arguments */ case 0: { /* no arguments */

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lparser.c,v 1.135 2001/02/20 18:15:33 roberto Exp roberto $ ** $Id: lparser.c,v 1.136 2001/02/20 18:28:11 roberto Exp roberto $
** LL(1) Parser and code generator for Lua ** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -26,7 +26,7 @@
** Constructors descriptor: ** Constructors descriptor:
** `n' indicates number of elements, and `k' signals whether ** `n' indicates number of elements, and `k' signals whether
** it is a list constructor (k = 0) or a record constructor (k = 1) ** it is a list constructor (k = 0) or a record constructor (k = 1)
** or empty (k = ';' or '}') ** or empty (k = `;' or `}')
*/ */
typedef struct Constdesc { typedef struct Constdesc {
int n; int n;
@ -381,7 +381,7 @@ Proto *luaY_parser (lua_State *L, ZIO *z) {
static int explist1 (LexState *ls) { static int explist1 (LexState *ls) {
/* explist1 -> expr { ',' expr } */ /* explist1 -> expr { `,' expr } */
int n = 1; /* at least one expression */ int n = 1; /* at least one expression */
expdesc v; expdesc v;
expr(ls, &v); expr(ls, &v);
@ -400,7 +400,7 @@ static void funcargs (LexState *ls, int slf) {
FuncState *fs = ls->fs; FuncState *fs = ls->fs;
int slevel = fs->stacklevel - slf - 1; /* where is func in the stack */ int slevel = fs->stacklevel - slf - 1; /* where is func in the stack */
switch (ls->t.token) { switch (ls->t.token) {
case '(': { /* funcargs -> '(' [ explist1 ] ')' */ case '(': { /* funcargs -> `(' [ explist1 ] `)' */
int line = ls->linenumber; int line = ls->linenumber;
int nargs = 0; int nargs = 0;
next(ls); next(ls);
@ -442,7 +442,7 @@ static void funcargs (LexState *ls, int slf) {
static void recfield (LexState *ls) { static void recfield (LexState *ls) {
/* recfield -> (NAME | '['exp1']') = exp1 */ /* recfield -> (NAME | `['exp1`]') = exp1 */
switch (ls->t.token) { switch (ls->t.token) {
case TK_NAME: { case TK_NAME: {
luaK_kstr(ls, checkname(ls)); luaK_kstr(ls, checkname(ls));
@ -462,7 +462,7 @@ static void recfield (LexState *ls) {
static int recfields (LexState *ls) { static int recfields (LexState *ls) {
/* recfields -> recfield { ',' recfield } [','] */ /* recfields -> recfield { `,' recfield } [`,'] */
FuncState *fs = ls->fs; FuncState *fs = ls->fs;
int n = 1; /* at least one element */ int n = 1; /* at least one element */
recfield(ls); recfield(ls);
@ -481,7 +481,7 @@ static int recfields (LexState *ls) {
static int listfields (LexState *ls) { static int listfields (LexState *ls) {
/* listfields -> exp1 { ',' exp1 } [','] */ /* listfields -> exp1 { `,' exp1 } [`,'] */
FuncState *fs = ls->fs; FuncState *fs = ls->fs;
int n = 1; /* at least one element */ int n = 1; /* at least one element */
exp1(ls); exp1(ls);
@ -531,7 +531,7 @@ static void constructor_part (LexState *ls, Constdesc *cd) {
static void constructor (LexState *ls) { static void constructor (LexState *ls) {
/* constructor -> '{' constructor_part [';' constructor_part] '}' */ /* constructor -> `{' constructor_part [`;' constructor_part] `}' */
FuncState *fs = ls->fs; FuncState *fs = ls->fs;
int line = ls->linenumber; int line = ls->linenumber;
int pc = luaK_code1(fs, OP_CREATETABLE, 0); int pc = luaK_code1(fs, OP_CREATETABLE, 0);
@ -617,18 +617,18 @@ static void primaryexp (LexState *ls, expdesc *v) {
static void simpleexp (LexState *ls, expdesc *v) { static void simpleexp (LexState *ls, expdesc *v) {
/* simpleexp -> /* simpleexp ->
primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ primaryexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
primaryexp(ls, v); primaryexp(ls, v);
for (;;) { for (;;) {
switch (ls->t.token) { switch (ls->t.token) {
case '.': { /* '.' NAME */ case '.': { /* `.' NAME */
next(ls); next(ls);
luaK_tostack(ls, v, 1); /* `v' must be on stack */ luaK_tostack(ls, v, 1); /* `v' must be on stack */
luaK_kstr(ls, checkname(ls)); luaK_kstr(ls, checkname(ls));
v->k = VINDEXED; v->k = VINDEXED;
break; break;
} }
case '[': { /* '[' exp1 ']' */ case '[': { /* `[' exp1 `]' */
next(ls); next(ls);
luaK_tostack(ls, v, 1); /* `v' must be on stack */ luaK_tostack(ls, v, 1); /* `v' must be on stack */
v->k = VINDEXED; v->k = VINDEXED;
@ -636,7 +636,7 @@ static void simpleexp (LexState *ls, expdesc *v) {
check(ls, ']'); check(ls, ']');
break; break;
} }
case ':': { /* ':' NAME funcargs */ case ':': { /* `:' NAME funcargs */
next(ls); next(ls);
luaK_tostack(ls, v, 1); /* `v' must be on stack */ luaK_tostack(ls, v, 1); /* `v' must be on stack */
luaK_code1(ls->fs, OP_PUSHSELF, checkname(ls)); luaK_code1(ls->fs, OP_PUSHSELF, checkname(ls));
@ -775,14 +775,14 @@ static void block (LexState *ls) {
static int assignment (LexState *ls, expdesc *v, int nvars) { static int assignment (LexState *ls, expdesc *v, int nvars) {
int left = 0; /* number of values left in the stack after assignment */ int left = 0; /* number of values left in the stack after assignment */
luaX_checklimit(ls, nvars, MAXVARSLH, "variables in a multiple assignment"); luaX_checklimit(ls, nvars, MAXVARSLH, "variables in a multiple assignment");
if (ls->t.token == ',') { /* assignment -> ',' simpleexp assignment */ if (ls->t.token == ',') { /* assignment -> `,' simpleexp assignment */
expdesc nv; expdesc nv;
next(ls); next(ls);
simpleexp(ls, &nv); simpleexp(ls, &nv);
check_condition(ls, (nv.k != VEXP), "syntax error"); check_condition(ls, (nv.k != VEXP), "syntax error");
left = assignment(ls, &nv, nvars+1); left = assignment(ls, &nv, nvars+1);
} }
else { /* assignment -> '=' explist1 */ else { /* assignment -> `=' explist1 */
int nexps; int nexps;
check(ls, '='); check(ls, '=');
nexps = explist1(ls); nexps = explist1(ls);
@ -943,11 +943,11 @@ static void ifstat (LexState *ls, int line) {
static void localstat (LexState *ls) { static void localstat (LexState *ls) {
/* stat -> LOCAL NAME {',' NAME} ['=' explist1] */ /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */
int nvars = 0; int nvars = 0;
int nexps; int nexps;
do { do {
next(ls); /* skip LOCAL or ',' */ next(ls); /* skip LOCAL or `,' */
new_localvar(ls, str_checkname(ls), nvars++); new_localvar(ls, str_checkname(ls), nvars++);
} while (ls->t.token == ','); } while (ls->t.token == ',');
if (optional(ls, '=')) if (optional(ls, '='))
@ -960,7 +960,7 @@ static void localstat (LexState *ls) {
static int funcname (LexState *ls, expdesc *v) { static int funcname (LexState *ls, expdesc *v) {
/* funcname -> NAME {'.' NAME} [':' NAME] */ /* funcname -> NAME {`.' NAME} [`:' NAME] */
int needself = 0; int needself = 0;
singlevar(ls, str_checkname(ls), v); singlevar(ls, str_checkname(ls), v);
while (ls->t.token == '.') { while (ls->t.token == '.') {
@ -1083,7 +1083,7 @@ static int stat (LexState *ls) {
static void parlist (LexState *ls) { static void parlist (LexState *ls) {
/* parlist -> [ param { ',' param } ] */ /* parlist -> [ param { `,' param } ] */
int nparams = 0; int nparams = 0;
short dots = 0; short dots = 0;
if (ls->t.token != ')') { /* is `parlist' not empty? */ if (ls->t.token != ')') { /* is `parlist' not empty? */
@ -1100,7 +1100,7 @@ static void parlist (LexState *ls) {
static void body (LexState *ls, int needself, int line) { static void body (LexState *ls, int needself, int line) {
/* body -> '(' parlist ')' chunk END */ /* body -> `(' parlist `)' chunk END */
FuncState new_fs; FuncState new_fs;
open_func(ls, &new_fs); open_func(ls, &new_fs);
new_fs.f->lineDefined = line; new_fs.f->lineDefined = line;
@ -1122,7 +1122,7 @@ static void body (LexState *ls, int needself, int line) {
static void chunk (LexState *ls) { static void chunk (LexState *ls) {
/* chunk -> { stat [';'] } */ /* chunk -> { stat [`;'] } */
int islast = 0; int islast = 0;
while (!islast && !block_follow(ls->t.token)) { while (!islast && !block_follow(ls->t.token)) {
islast = stat(ls); islast = stat(ls);

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lstrlib.c,v 1.62 2001/02/02 19:02:40 roberto Exp roberto $ ** $Id: lstrlib.c,v 1.63 2001/02/22 17:15:18 roberto Exp roberto $
** Standard library for string operations and pattern-matching ** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -17,7 +17,7 @@
#include "lualib.h" #include "lualib.h"
typedef long sint32; /* a "signed" version for size_t */ typedef long sint32; /* a signed version for size_t */
static int str_len (lua_State *L) { static int str_len (lua_State *L) {
@ -128,7 +128,7 @@ static int str_char (lua_State *L) {
typedef struct MatchState { typedef struct MatchState {
const char *src_init; /* init of source string */ const char *src_init; /* init of source string */
const char *src_end; /* end ('\0') of source string */ const char *src_end; /* end (`\0') of source string */
int level; /* total number of captures (finished or unfinished) */ int level; /* total number of captures (finished or unfinished) */
struct { struct {
const char *init; const char *init;
@ -166,9 +166,9 @@ static const char *luaI_classend (MatchState *ms, const char *p) {
return p+1; return p+1;
case '[': case '[':
if (*p == '^') p++; if (*p == '^') p++;
do { /* look for a ']' */ do { /* look for a `]' */
if (*p == '\0') lua_error(ms->L, "malformed pattern (missing `]')"); if (*p == '\0') lua_error(ms->L, "malformed pattern (missing `]')");
if (*(p++) == ESC && *p != '\0') p++; /* skip escapes (e.g. '%]') */ if (*(p++) == ESC && *p != '\0') p++; /* skip escapes (e.g. `%]') */
} while (*p != ']'); } while (*p != ']');
return p+1; return p+1;
default: default:
@ -200,7 +200,7 @@ static int matchbracketclass (char c, const char *p, const char *endclass) {
int sig = 1; int sig = 1;
if (*(p+1) == '^') { if (*(p+1) == '^') {
sig = 0; sig = 0;
p++; /* skip the '^' */ p++; /* skip the `^' */
} }
while (++p < endclass) { while (++p < endclass) {
if (*p == ESC) { if (*p == ESC) {
@ -342,7 +342,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) {
case '\0': /* end of pattern */ case '\0': /* end of pattern */
return s; /* match succeeded */ return s; /* match succeeded */
case '$': case '$':
if (*(p+1) == '\0') /* is the '$' the last char in pattern? */ if (*(p+1) == '\0') /* is the `$' the last char in pattern? */
return (s == ms->src_end) ? s : NULL; /* check end of string */ return (s == ms->src_end) ? s : NULL; /* check end of string */
else goto dflt; else goto dflt;
default: dflt: { /* it is a pattern item */ default: dflt: { /* it is a pattern item */
@ -601,7 +601,7 @@ static int str_format (lua_State *L) {
break; break;
case 'q': case 'q':
luaI_addquoted(L, &b, arg); luaI_addquoted(L, &b, arg);
continue; /* skip the "addsize" at the end */ continue; /* skip the `addsize' at the end */
case 's': { case 's': {
size_t l; size_t l;
const char *s = luaL_check_lstr(L, arg, &l); const char *s = luaL_check_lstr(L, arg, &l);
@ -610,7 +610,7 @@ static int str_format (lua_State *L) {
keep original string */ keep original string */
lua_pushvalue(L, arg); lua_pushvalue(L, arg);
luaL_addvalue(&b); luaL_addvalue(&b);
continue; /* skip the "addsize" at the end */ continue; /* skip the `addsize' at the end */
} }
else { else {
sprintf(buff, form, s); sprintf(buff, form, s);

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ltests.c,v 1.69 2001/02/20 18:18:00 roberto Exp roberto $ ** $Id: ltests.c,v 1.70 2001/02/21 16:51:25 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation ** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -473,7 +473,7 @@ static int equal (lua_State *L) {
/* /*
** {====================================================== ** {======================================================
** function to test the API with C. It interprets a kind of "assembler" ** function to test the API with C. It interprets a kind of assembler
** language with calls to the API, so the test can be driven by Lua code ** language with calls to the API, so the test can be driven by Lua code
** ======================================================= ** =======================================================
*/ */

4
ltm.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: ltm.c,v 1.66 2001/02/09 20:22:29 roberto Exp roberto $ ** $Id: ltm.c,v 1.67 2001/02/20 18:15:33 roberto Exp roberto $
** Tag methods ** Tag methods
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -50,7 +50,7 @@ static int luaI_checkevent (lua_State *L, const char *name, int t) {
/* events in LUA_TNIL are all allowed, since this is used as a /* events in LUA_TNIL are all allowed, since this is used as a
* 'placeholder' for "default" fallbacks * `placeholder' for default fallbacks
*/ */
/* ORDER LUA_T, ORDER TM */ /* ORDER LUA_T, ORDER TM */
static const lu_byte luaT_validevents[NUM_TAGS][TM_N] = { static const lu_byte luaT_validevents[NUM_TAGS][TM_N] = {

12
lvm.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lvm.c,v 1.169 2001/02/12 13:04:19 roberto Exp roberto $ ** $Id: lvm.c,v 1.170 2001/02/20 18:15:33 roberto Exp roberto $
** Lua virtual machine ** Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -237,13 +237,13 @@ static int luaV_strlessthan (const TString *ls, const TString *rs) {
for (;;) { for (;;) {
int temp = strcoll(l, r); int temp = strcoll(l, r);
if (temp != 0) return (temp < 0); if (temp != 0) return (temp < 0);
else { /* strings are equal up to a '\0' */ else { /* strings are equal up to a `\0' */
size_t len = strlen(l); /* index of first '\0' in both strings */ size_t len = strlen(l); /* index of first `\0' in both strings */
if (len == lr) /* r is finished? */ if (len == lr) /* r is finished? */
return 0; /* l is equal or greater than r */ return 0; /* l is equal or greater than r */
else if (len == ll) /* l is finished? */ else if (len == ll) /* l is finished? */
return 1; /* l is smaller than r (because r is not finished) */ return 1; /* l is smaller than r (because r is not finished) */
/* both strings longer than `len'; go on comparing (after the '\0') */ /* both strings longer than `len'; go on comparing (after the `\0') */
len++; len++;
l += len; ll -= len; r += len; lr -= len; l += len; ll -= len; r += len; lr -= len;
} }
@ -600,7 +600,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
luaD_error(L, "`for' limit must be a number"); luaD_error(L, "`for' limit must be a number");
if (tonumber(top-3)) if (tonumber(top-3))
luaD_error(L, "`for' initial value must be a number"); luaD_error(L, "`for' initial value must be a number");
pc += -jmp; /* "jump" to loop end (delta is negated here) */ pc += -jmp; /* `jump' to loop end (delta is negated here) */
goto forloop; /* do not increment index */ goto forloop; /* do not increment index */
} }
case OP_FORLOOP: { case OP_FORLOOP: {
@ -626,7 +626,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
setnvalue(top-3, -1); /* initial index */ setnvalue(top-3, -1); /* initial index */
setnilvalue(top-2); setnilvalue(top-2);
setnilvalue(top-1); setnilvalue(top-1);
pc += -jmp; /* "jump" to loop end (delta is negated here) */ pc += -jmp; /* `jump' to loop end (delta is negated here) */
/* go through */ /* go through */
} }
case OP_LFORLOOP: { case OP_LFORLOOP: {