diff options
| -rw-r--r-- | llex.c | 12 |
1 files changed, 5 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 1.15 1998/02/11 20:56:46 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.16 1998/03/06 16:54:42 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 | */ |
| @@ -244,9 +244,8 @@ static int read_long_string (LexState *LS, YYSTYPE *l) | |||
| 244 | } | 244 | } |
| 245 | } endloop: | 245 | } endloop: |
| 246 | save_and_next(LS); /* pass the second ']' */ | 246 | save_and_next(LS); /* pass the second ']' */ |
| 247 | L->Mbuffer[L->Mbuffnext-2] = 0; /* erases ']]' */ | 247 | l->pTStr = luaS_newlstr(L->Mbuffbase+2, |
| 248 | l->pTStr = luaS_new(L->Mbuffbase+2); | 248 | L->Mbuffnext-(L->Mbuffbase-L->Mbuffer)-4); |
| 249 | L->Mbuffer[L->Mbuffnext-2] = ']'; /* restores ']]' */ | ||
| 250 | return STRING; | 249 | return STRING; |
| 251 | } | 250 | } |
| 252 | 251 | ||
| @@ -357,10 +356,9 @@ int luaY_lex (YYSTYPE *l) | |||
| 357 | save_and_next(LS); | 356 | save_and_next(LS); |
| 358 | } | 357 | } |
| 359 | } | 358 | } |
| 360 | next(LS); /* skip delimiter */ | 359 | save_and_next(LS); /* skip delimiter */ |
| 361 | l->pTStr = luaS_newlstr(L->Mbuffbase+1, | 360 | l->pTStr = luaS_newlstr(L->Mbuffbase+1, |
| 362 | L->Mbuffnext-((L->Mbuffbase+1)-L->Mbuffer)); | 361 | L->Mbuffnext-(L->Mbuffbase-L->Mbuffer)-2); |
| 363 | L->Mbuffer[L->Mbuffnext-1] = del; /* restore delimiter */ | ||
| 364 | return STRING; | 362 | return STRING; |
| 365 | } | 363 | } |
| 366 | 364 | ||
