support for strings with '\0'

This commit is contained in:
Roberto Ierusalimschy
1998-03-06 13:54:42 -03:00
parent 5ef1989c4b
commit 88a2023c32
14 changed files with 238 additions and 158 deletions

6
llex.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 1.14 1998/01/19 20:18:02 roberto Exp roberto $
** $Id: llex.c,v 1.15 1998/02/11 20:56:46 roberto Exp roberto $
** Lexical Analizer
** See Copyright Notice in lua.h
*/
@@ -358,8 +358,8 @@ int luaY_lex (YYSTYPE *l)
}
}
next(LS); /* skip delimiter */
save(0);
l->pTStr = luaS_new(L->Mbuffbase+1);
l->pTStr = luaS_newlstr(L->Mbuffbase+1,
L->Mbuffnext-((L->Mbuffbase+1)-L->Mbuffer));
L->Mbuffer[L->Mbuffnext-1] = del; /* restore delimiter */
return STRING;
}