aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/llex.c b/llex.c
index 9ddb117e..269163d9 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 1.71 2000/09/27 17:41:58 roberto Exp roberto $ 2** $Id: llex.c,v 1.72 2000/10/20 16:39:03 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*/
@@ -38,6 +38,7 @@ void luaX_init (lua_State *L) {
38 int i; 38 int i;
39 for (i=0; i<NUM_RESERVED; i++) { 39 for (i=0; i<NUM_RESERVED; i++) {
40 TString *ts = luaS_new(L, token2string[i]); 40 TString *ts = luaS_new(L, token2string[i]);
41 LUA_ASSERT(strlen(token2string[i])+1 <= TOKEN_LEN, "incorrect token_len");
41 ts->marked = (unsigned char)(RESERVEDMARK+i); /* reserved word */ 42 ts->marked = (unsigned char)(RESERVEDMARK+i); /* reserved word */
42 } 43 }
43} 44}
@@ -48,8 +49,8 @@ void luaX_init (lua_State *L) {
48 49
49void luaX_checklimit (LexState *ls, int val, int limit, const char *msg) { 50void luaX_checklimit (LexState *ls, int val, int limit, const char *msg) {
50 if (val > limit) { 51 if (val > limit) {
51 char buff[100]; 52 char buff[90];
52 sprintf(buff, "too many %.50s (limit=%d)", msg, limit); 53 sprintf(buff, "too many %.40s (limit=%d)", msg, limit);
53 luaX_error(ls, buff, ls->t.token); 54 luaX_error(ls, buff, ls->t.token);
54 } 55 }
55} 56}