Identation + comments
This commit is contained in:
Roberto Ierusalimschy 2024-09-06 14:35:04 -03:00
parent fd0e1f530d
commit 007b8c7a01
3 changed files with 20 additions and 20 deletions

View File

@ -1837,8 +1837,8 @@ static int finaltarget (Instruction *code, int i) {
Instruction pc = code[i]; Instruction pc = code[i];
if (GET_OPCODE(pc) != OP_JMP) if (GET_OPCODE(pc) != OP_JMP)
break; break;
else else
i += GETARG_sJ(pc) + 1; i += GETARG_sJ(pc) + 1;
} }
return i; return i;
} }

View File

@ -68,8 +68,8 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
,opmode(0, 0, 0, 0, 1, iABC) /* OP_SHL */ ,opmode(0, 0, 0, 0, 1, iABC) /* OP_SHL */
,opmode(0, 0, 0, 0, 1, iABC) /* OP_SHR */ ,opmode(0, 0, 0, 0, 1, iABC) /* OP_SHR */
,opmode(1, 0, 0, 0, 0, iABC) /* OP_MMBIN */ ,opmode(1, 0, 0, 0, 0, iABC) /* OP_MMBIN */
,opmode(1, 0, 0, 0, 0, iABC) /* OP_MMBINI*/ ,opmode(1, 0, 0, 0, 0, iABC) /* OP_MMBINI */
,opmode(1, 0, 0, 0, 0, iABC) /* OP_MMBINK*/ ,opmode(1, 0, 0, 0, 0, iABC) /* OP_MMBINK */
,opmode(0, 0, 0, 0, 1, iABC) /* OP_UNM */ ,opmode(0, 0, 0, 0, 1, iABC) /* OP_UNM */
,opmode(0, 0, 0, 0, 1, iABC) /* OP_BNOT */ ,opmode(0, 0, 0, 0, 1, iABC) /* OP_BNOT */
,opmode(0, 0, 0, 0, 1, iABC) /* OP_NOT */ ,opmode(0, 0, 0, 0, 1, iABC) /* OP_NOT */

View File

@ -192,22 +192,22 @@ static int byteoffset (lua_State *L) {
if (iscontp(s + posi)) if (iscontp(s + posi))
return luaL_error(L, "initial position is a continuation byte"); return luaL_error(L, "initial position is a continuation byte");
if (n < 0) { if (n < 0) {
while (n < 0 && posi > 0) { /* move back */ while (n < 0 && posi > 0) { /* move back */
do { /* find beginning of previous character */ do { /* find beginning of previous character */
posi--; posi--;
} while (posi > 0 && iscontp(s + posi)); } while (posi > 0 && iscontp(s + posi));
n++; n++;
} }
} }
else { else {
n--; /* do not move for 1st character */ n--; /* do not move for 1st character */
while (n > 0 && posi < (lua_Integer)len) { while (n > 0 && posi < (lua_Integer)len) {
do { /* find beginning of next character */ do { /* find beginning of next character */
posi++; posi++;
} while (iscontp(s + posi)); /* (cannot pass final '\0') */ } while (iscontp(s + posi)); /* (cannot pass final '\0') */
n--; n--;
} }
} }
} }
if (n != 0) { /* did not find given character? */ if (n != 0) { /* did not find given character? */
luaL_pushfail(L); luaL_pushfail(L);