From 924bbe020bfb79a42a4756e36847dab7880d36b4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 14 May 1999 09:24:04 -0300 Subject: bigger limits --- llex.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'llex.c') 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' */ -- cgit v1.2.3-55-g6feb