code cleaner for 16 bits.

This commit is contained in:
Roberto Ierusalimschy
2000-05-24 10:54:49 -03:00
parent 5c2dd7a9e0
commit ef62b340e0
31 changed files with 247 additions and 199 deletions

13
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 1.57 2000/04/12 18:57:19 roberto Exp roberto $
** $Id: llex.c,v 1.58 2000/05/08 19:32:53 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -49,6 +49,16 @@ void luaX_init (lua_State *L) {
#define MAXSRC 80
void luaX_checklimit (LexState *ls, int val, int limit, const char *msg) {
if (val > limit) {
char buff[100];
sprintf(buff, "too many %.50s (limit=%d)", msg, limit);
luaX_error(ls, buff, ls->token);
}
}
void luaX_syntaxerror (LexState *ls, const char *s, const char *token) {
char buff[MAXSRC];
luaL_chunkid(buff, zname(ls->z), sizeof(buff));
@@ -175,6 +185,7 @@ static void inclinenumber (lua_State *L, LexState *LS) {
{"debug", "nodebug", "endinput", "end", "ifnot", "if", "else", NULL};
next(LS); /* skip '\n' */
++LS->linenumber;
luaX_checklimit(LS, LS->linenumber, MAX_INT, "lines in a chunk");
if (LS->current == '$') { /* is a pragma? */
char buff[PRAGMASIZE+1];
int ifnot = 0;