diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-10 14:40:56 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-10 14:40:56 -0200 |
commit | 595e449537eb6ff17fa6c58742920a1a609fc5c5 (patch) | |
tree | 058f4e2de05310ed977c58715982f65ec670c678 /lparser.c | |
parent | a907aeeb1e4850cb6509a61bdf6a16bc42d68c4f (diff) | |
download | lua-595e449537eb6ff17fa6c58742920a1a609fc5c5.tar.gz lua-595e449537eb6ff17fa6c58742920a1a609fc5c5.tar.bz2 lua-595e449537eb6ff17fa6c58742920a1a609fc5c5.zip |
tighter size for error buffers
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.120 2000/12/26 18:46:09 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.121 2000/12/28 12:55:41 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -71,9 +71,9 @@ static void lookahead (LexState *ls) { | |||
71 | 71 | ||
72 | 72 | ||
73 | static void error_expected (LexState *ls, int token) { | 73 | static void error_expected (LexState *ls, int token) { |
74 | char buff[100], t[TOKEN_LEN]; | 74 | char buff[30], t[TOKEN_LEN]; |
75 | luaX_token2str(token, t); | 75 | luaX_token2str(token, t); |
76 | sprintf(buff, "`%.20s' expected", t); | 76 | sprintf(buff, "`%.10s' expected", t); |
77 | luaK_error(ls, buff); | 77 | luaK_error(ls, buff); |
78 | } | 78 | } |
79 | 79 | ||
@@ -104,11 +104,11 @@ static void check_match (LexState *ls, int what, int who, int where) { | |||
104 | if (where == ls->linenumber) | 104 | if (where == ls->linenumber) |
105 | error_expected(ls, what); | 105 | error_expected(ls, what); |
106 | else { | 106 | else { |
107 | char buff[100]; | 107 | char buff[70]; |
108 | char t_what[TOKEN_LEN], t_who[TOKEN_LEN]; | 108 | char t_what[TOKEN_LEN], t_who[TOKEN_LEN]; |
109 | luaX_token2str(what, t_what); | 109 | luaX_token2str(what, t_what); |
110 | luaX_token2str(who, t_who); | 110 | luaX_token2str(who, t_who); |
111 | sprintf(buff, "`%.20s' expected (to close `%.20s' at line %d)", | 111 | sprintf(buff, "`%.10s' expected (to close `%.10s' at line %d)", |
112 | t_what, t_who, where); | 112 | t_what, t_who, where); |
113 | luaK_error(ls, buff); | 113 | luaK_error(ls, buff); |
114 | } | 114 | } |