diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-05-14 09:24:04 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-05-14 09:24:04 -0300 |
commit | 924bbe020bfb79a42a4756e36847dab7880d36b4 (patch) | |
tree | cccdb6837c1299683bfdcecd49bce1969a8568bd | |
parent | 3aa500b524793cf79de78c373a618d708bf22004 (diff) | |
download | lua-924bbe020bfb79a42a4756e36847dab7880d36b4.tar.gz lua-924bbe020bfb79a42a4756e36847dab7880d36b4.tar.bz2 lua-924bbe020bfb79a42a4756e36847dab7880d36b4.zip |
bigger limits
-rw-r--r-- | liolib.c | 14 | ||||
-rw-r--r-- | llex.c | 25 | ||||
-rw-r--r-- | lstrlib.c | 4 |
3 files changed, 19 insertions, 24 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 1.38 1999/04/14 20:40:32 roberto Exp $ | 2 | ** $Id: liolib.c,v 1.39 1999/05/05 19:22:26 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -477,7 +477,7 @@ static void io_debug (void) { | |||
477 | #define MAXMESSAGE (MESSAGESIZE*10) | 477 | #define MAXMESSAGE (MESSAGESIZE*10) |
478 | 478 | ||
479 | 479 | ||
480 | #define MAXSRC 40 | 480 | #define MAXSRC 60 |
481 | 481 | ||
482 | 482 | ||
483 | static void errorfb (void) { | 483 | static void errorfb (void) { |
@@ -494,7 +494,7 @@ static void errorfb (void) { | |||
494 | lua_funcinfo(func, &chunkname, &linedefined); | 494 | lua_funcinfo(func, &chunkname, &linedefined); |
495 | luaL_chunkid(buffchunk, chunkname, sizeof(buffchunk)); | 495 | luaL_chunkid(buffchunk, chunkname, sizeof(buffchunk)); |
496 | if (level == 2) strcat(buff, "Active Stack:\n"); | 496 | if (level == 2) strcat(buff, "Active Stack:\n"); |
497 | strcat(buff, "\t"); | 497 | strcat(buff, " "); |
498 | if (strlen(buff) > MAXMESSAGE-MESSAGESIZE) { | 498 | if (strlen(buff) > MAXMESSAGE-MESSAGESIZE) { |
499 | strcat(buff, "...\n"); | 499 | strcat(buff, "...\n"); |
500 | break; /* buffer is full */ | 500 | break; /* buffer is full */ |
@@ -508,11 +508,11 @@ static void errorfb (void) { | |||
508 | break; | 508 | break; |
509 | default: { | 509 | default: { |
510 | if (linedefined == 0) | 510 | if (linedefined == 0) |
511 | sprintf(buff+strlen(buff), "main of %.50s", buffchunk); | 511 | sprintf(buff+strlen(buff), "main of %.70s", buffchunk); |
512 | else if (linedefined < 0) | 512 | else if (linedefined < 0) |
513 | sprintf(buff+strlen(buff), "%.50s", buffchunk); | 513 | sprintf(buff+strlen(buff), "%.70s", buffchunk); |
514 | else | 514 | else |
515 | sprintf(buff+strlen(buff), "function <%d:%.50s>", | 515 | sprintf(buff+strlen(buff), "function <%d:%.70s>", |
516 | linedefined, buffchunk); | 516 | linedefined, buffchunk); |
517 | chunkname = NULL; | 517 | chunkname = NULL; |
518 | } | 518 | } |
@@ -520,7 +520,7 @@ static void errorfb (void) { | |||
520 | if ((currentline = lua_currentline(func)) > 0) | 520 | if ((currentline = lua_currentline(func)) > 0) |
521 | sprintf(buff+strlen(buff), " at line %d", currentline); | 521 | sprintf(buff+strlen(buff), " at line %d", currentline); |
522 | if (chunkname) | 522 | if (chunkname) |
523 | sprintf(buff+strlen(buff), " [%.50s]", buffchunk); | 523 | sprintf(buff+strlen(buff), " [%.70s]", buffchunk); |
524 | strcat(buff, "\n"); | 524 | strcat(buff, "\n"); |
525 | } | 525 | } |
526 | func = lua_rawgetglobal("_ALERT"); | 526 | func = lua_rawgetglobal("_ALERT"); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.33 1999/03/11 18:59:19 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.34 1999/03/25 21:05:05 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -41,14 +41,14 @@ void luaX_init (void) { | |||
41 | } | 41 | } |
42 | 42 | ||
43 | 43 | ||
44 | #define MAXSRC 40 | 44 | #define MAXSRC 80 |
45 | 45 | ||
46 | void luaX_syntaxerror (LexState *ls, char *s, char *token) { | 46 | void luaX_syntaxerror (LexState *ls, char *s, char *token) { |
47 | char buff[MAXSRC]; | 47 | char buff[MAXSRC]; |
48 | luaL_chunkid(buff, zname(ls->lex_z), sizeof(buff)); | 48 | luaL_chunkid(buff, zname(ls->lex_z), sizeof(buff)); |
49 | if (token[0] == '\0') | 49 | if (token[0] == '\0') |
50 | token = "<eof>"; | 50 | token = "<eof>"; |
51 | luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.50s", | 51 | luaL_verror("%.100s;\n last token read: `%.50s' at line %d in %.80s", |
52 | s, token, ls->linenumber, buff); | 52 | s, token, ls->linenumber, buff); |
53 | } | 53 | } |
54 | 54 | ||
@@ -70,7 +70,7 @@ void luaX_token2str (int token, char *s) { | |||
70 | 70 | ||
71 | 71 | ||
72 | static void luaX_invalidchar (LexState *ls, int c) { | 72 | static void luaX_invalidchar (LexState *ls, int c) { |
73 | char buff[10]; | 73 | char buff[8]; |
74 | sprintf(buff, "0x%02X", c); | 74 | sprintf(buff, "0x%02X", c); |
75 | luaX_syntaxerror(ls, "invalid control char", buff); | 75 | luaX_syntaxerror(ls, "invalid control char", buff); |
76 | } | 76 | } |
@@ -106,17 +106,15 @@ void luaX_setinput (LexState *LS, ZIO *z) | |||
106 | ** ======================================================= | 106 | ** ======================================================= |
107 | */ | 107 | */ |
108 | 108 | ||
109 | #define PRAGMASIZE 20 | 109 | #define PRAGMASIZE 80 |
110 | 110 | ||
111 | static void skipspace (LexState *LS) | 111 | static void skipspace (LexState *LS) { |
112 | { | ||
113 | while (LS->current == ' ' || LS->current == '\t' || LS->current == '\r') | 112 | while (LS->current == ' ' || LS->current == '\t' || LS->current == '\r') |
114 | next(LS); | 113 | next(LS); |
115 | } | 114 | } |
116 | 115 | ||
117 | 116 | ||
118 | static int checkcond (LexState *LS, char *buff) | 117 | static int checkcond (LexState *LS, char *buff) { |
119 | { | ||
120 | static char *opts[] = {"nil", "1", NULL}; | 118 | static char *opts[] = {"nil", "1", NULL}; |
121 | int i = luaL_findstring(buff, opts); | 119 | int i = luaL_findstring(buff, opts); |
122 | if (i >= 0) return i; | 120 | if (i >= 0) return i; |
@@ -129,8 +127,7 @@ static int checkcond (LexState *LS, char *buff) | |||
129 | } | 127 | } |
130 | 128 | ||
131 | 129 | ||
132 | static void readname (LexState *LS, char *buff) | 130 | static void readname (LexState *LS, char *buff) { |
133 | { | ||
134 | int i = 0; | 131 | int i = 0; |
135 | skipspace(LS); | 132 | skipspace(LS); |
136 | while (isalnum(LS->current) || LS->current == '_') { | 133 | while (isalnum(LS->current) || LS->current == '_') { |
@@ -148,8 +145,7 @@ static void readname (LexState *LS, char *buff) | |||
148 | static void inclinenumber (LexState *LS); | 145 | static void inclinenumber (LexState *LS); |
149 | 146 | ||
150 | 147 | ||
151 | static void ifskip (LexState *LS) | 148 | static void ifskip (LexState *LS) { |
152 | { | ||
153 | while (LS->ifstate[LS->iflevel].skip) { | 149 | while (LS->ifstate[LS->iflevel].skip) { |
154 | if (LS->current == '\n') | 150 | if (LS->current == '\n') |
155 | inclinenumber(LS); | 151 | inclinenumber(LS); |
@@ -160,8 +156,7 @@ static void ifskip (LexState *LS) | |||
160 | } | 156 | } |
161 | 157 | ||
162 | 158 | ||
163 | static void inclinenumber (LexState *LS) | 159 | static void inclinenumber (LexState *LS) { |
164 | { | ||
165 | static char *pragmas [] = | 160 | static char *pragmas [] = |
166 | {"debug", "nodebug", "endinput", "end", "ifnot", "if", "else", NULL}; | 161 | {"debug", "nodebug", "endinput", "end", "ifnot", "if", "else", NULL}; |
167 | next(LS); /* skip '\n' */ | 162 | next(LS); /* skip '\n' */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.29 1999/04/30 14:12:05 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.30 1999/05/05 19:22:26 roberto Exp roberto $ |
3 | ** Standard library for strings and pattern-matching | 3 | ** Standard library for strings and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -117,7 +117,7 @@ static void str_char (void) { | |||
117 | ** ======================================================= | 117 | ** ======================================================= |
118 | */ | 118 | */ |
119 | 119 | ||
120 | #define MAX_CAPT 9 | 120 | #define MAX_CAPT 32 |
121 | 121 | ||
122 | struct Capture { | 122 | struct Capture { |
123 | char *src_end; /* end ('\0') of source string */ | 123 | char *src_end; /* end ('\0') of source string */ |