aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/llex.c b/llex.c
index 27850864..9b74543b 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 1.27 1998/12/28 13:44:54 roberto Exp roberto $ 2** $Id: llex.c,v 1.28 1999/02/04 17:47:59 roberto Exp roberto $
3** Lexical Analizer 3** Lexical Analizer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -258,8 +258,8 @@ static int read_long_string (LexState *LS) {
258 } 258 }
259 } endloop: 259 } endloop:
260 save_and_next(LS); /* skip the second ']' */ 260 save_and_next(LS); /* skip the second ']' */
261 LS->seminfo.ts = luaS_newlstr(L->Mbuffbase+2, 261 LS->seminfo.ts = luaS_newlstr(L->Mbuffer+(L->Mbuffbase+2),
262 L->Mbuffnext-(L->Mbuffbase-L->Mbuffer)-4); 262 L->Mbuffnext-L->Mbuffbase-4);
263 return STRING; 263 return STRING;
264} 264}
265 265
@@ -358,8 +358,8 @@ int luaX_lex (LexState *LS) {
358 } 358 }
359 } 359 }
360 save_and_next(LS); /* skip delimiter */ 360 save_and_next(LS); /* skip delimiter */
361 LS->seminfo.ts = luaS_newlstr(L->Mbuffbase+1, 361 LS->seminfo.ts = luaS_newlstr(L->Mbuffer+(L->Mbuffbase+1),
362 L->Mbuffnext-(L->Mbuffbase-L->Mbuffer)-2); 362 L->Mbuffnext-L->Mbuffbase-2);
363 return STRING; 363 return STRING;
364 } 364 }
365 365
@@ -401,7 +401,7 @@ int luaX_lex (LexState *LS) {
401 save_and_next(LS); 401 save_and_next(LS);
402 } 402 }
403 save('\0'); 403 save('\0');
404 LS->seminfo.r = luaO_str2d(L->Mbuffbase); 404 LS->seminfo.r = luaO_str2d(L->Mbuffer+L->Mbuffbase);
405 if (LS->seminfo.r < 0) 405 if (LS->seminfo.r < 0)
406 luaX_error(LS, "invalid numeric format"); 406 luaX_error(LS, "invalid numeric format");
407 return NUMBER; 407 return NUMBER;
@@ -425,7 +425,7 @@ int luaX_lex (LexState *LS) {
425 save_and_next(LS); 425 save_and_next(LS);
426 } while (isalnum(LS->current) || LS->current == '_'); 426 } while (isalnum(LS->current) || LS->current == '_');
427 save('\0'); 427 save('\0');
428 ts = luaS_new(L->Mbuffbase); 428 ts = luaS_new(L->Mbuffer+L->Mbuffbase);
429 if (ts->head.marked >= FIRST_RESERVED) 429 if (ts->head.marked >= FIRST_RESERVED)
430 return ts->head.marked; /* reserved word */ 430 return ts->head.marked; /* reserved word */
431 LS->seminfo.ts = ts; 431 LS->seminfo.ts = ts;