From 924bbe020bfb79a42a4756e36847dab7880d36b4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 14 May 1999 09:24:04 -0300 Subject: bigger limits --- liolib.c | 14 +++++++------- llex.c | 25 ++++++++++--------------- lstrlib.c | 4 ++-- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/liolib.c b/liolib.c index f43c3fd0..63a698d1 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 1.38 1999/04/14 20:40:32 roberto Exp $ +** $Id: liolib.c,v 1.39 1999/05/05 19:22:26 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -477,7 +477,7 @@ static void io_debug (void) { #define MAXMESSAGE (MESSAGESIZE*10) -#define MAXSRC 40 +#define MAXSRC 60 static void errorfb (void) { @@ -494,7 +494,7 @@ static void errorfb (void) { lua_funcinfo(func, &chunkname, &linedefined); luaL_chunkid(buffchunk, chunkname, sizeof(buffchunk)); if (level == 2) strcat(buff, "Active Stack:\n"); - strcat(buff, "\t"); + strcat(buff, " "); if (strlen(buff) > MAXMESSAGE-MESSAGESIZE) { strcat(buff, "...\n"); break; /* buffer is full */ @@ -508,11 +508,11 @@ static void errorfb (void) { break; default: { if (linedefined == 0) - sprintf(buff+strlen(buff), "main of %.50s", buffchunk); + sprintf(buff+strlen(buff), "main of %.70s", buffchunk); else if (linedefined < 0) - sprintf(buff+strlen(buff), "%.50s", buffchunk); + sprintf(buff+strlen(buff), "%.70s", buffchunk); else - sprintf(buff+strlen(buff), "function <%d:%.50s>", + sprintf(buff+strlen(buff), "function <%d:%.70s>", linedefined, buffchunk); chunkname = NULL; } @@ -520,7 +520,7 @@ static void errorfb (void) { if ((currentline = lua_currentline(func)) > 0) sprintf(buff+strlen(buff), " at line %d", currentline); if (chunkname) - sprintf(buff+strlen(buff), " [%.50s]", buffchunk); + sprintf(buff+strlen(buff), " [%.70s]", buffchunk); strcat(buff, "\n"); } func = lua_rawgetglobal("_ALERT"); diff --git a/llex.c b/llex.c index 384da751..3734b003 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 1.33 1999/03/11 18:59:19 roberto Exp roberto $ +** $Id: llex.c,v 1.34 1999/03/25 21:05:05 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -41,14 +41,14 @@ void luaX_init (void) { } -#define MAXSRC 40 +#define MAXSRC 80 void luaX_syntaxerror (LexState *ls, char *s, char *token) { char buff[MAXSRC]; luaL_chunkid(buff, zname(ls->lex_z), sizeof(buff)); if (token[0] == '\0') token = ""; - luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.50s", + luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.80s", s, token, ls->linenumber, buff); } @@ -70,7 +70,7 @@ void luaX_token2str (int token, char *s) { static void luaX_invalidchar (LexState *ls, int c) { - char buff[10]; + char buff[8]; sprintf(buff, "0x%02X", c); luaX_syntaxerror(ls, "invalid control char", buff); } @@ -106,17 +106,15 @@ void luaX_setinput (LexState *LS, ZIO *z) ** ======================================================= */ -#define PRAGMASIZE 20 +#define PRAGMASIZE 80 -static void skipspace (LexState *LS) -{ +static void skipspace (LexState *LS) { while (LS->current == ' ' || LS->current == '\t' || LS->current == '\r') next(LS); } -static int checkcond (LexState *LS, char *buff) -{ +static int checkcond (LexState *LS, char *buff) { static char *opts[] = {"nil", "1", NULL}; int i = luaL_findstring(buff, opts); if (i >= 0) return i; @@ -129,8 +127,7 @@ static int checkcond (LexState *LS, char *buff) } -static void readname (LexState *LS, char *buff) -{ +static void readname (LexState *LS, char *buff) { int i = 0; skipspace(LS); while (isalnum(LS->current) || LS->current == '_') { @@ -148,8 +145,7 @@ static void readname (LexState *LS, char *buff) static void inclinenumber (LexState *LS); -static void ifskip (LexState *LS) -{ +static void ifskip (LexState *LS) { while (LS->ifstate[LS->iflevel].skip) { if (LS->current == '\n') inclinenumber(LS); @@ -160,8 +156,7 @@ static void ifskip (LexState *LS) } -static void inclinenumber (LexState *LS) -{ +static void inclinenumber (LexState *LS) { static char *pragmas [] = {"debug", "nodebug", "endinput", "end", "ifnot", "if", "else", NULL}; next(LS); /* skip '\n' */ diff --git a/lstrlib.c b/lstrlib.c index bcfa457e..d03612af 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.29 1999/04/30 14:12:05 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.30 1999/05/05 19:22:26 roberto Exp roberto $ ** Standard library for strings and pattern-matching ** See Copyright Notice in lua.h */ @@ -117,7 +117,7 @@ static void str_char (void) { ** ======================================================= */ -#define MAX_CAPT 9 +#define MAX_CAPT 32 struct Capture { char *src_end; /* end ('\0') of source string */ -- cgit v1.2.3-55-g6feb