commit 73be918285f7e2eb0acc02d73effa6a95a8ab08c
parent ca412214cbbeb8f40e9abea534e6171044cc0a57
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 9 Feb 1996 17:35:03 -0200
a backslash followed by a newline allows the newline to go into
a string.
Diffstat:
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/iolib.c b/iolib.c
@@ -3,7 +3,7 @@
** Input/output library to LUA
*/
-char *rcs_iolib="$Id: iolib.c,v 1.33 1996/02/05 21:32:19 roberto Exp roberto $";
+char *rcs_iolib="$Id: iolib.c,v 1.34 1996/02/09 19:02:30 roberto Exp roberto $";
#include <stdio.h>
#include <ctype.h>
@@ -380,14 +380,10 @@ static int write_quoted (int just, int m)
{
switch (*s)
{
- case '"': case '\\':
+ case '"': case '\\': case '\n':
luaI_addchar('\\');
luaI_addchar(*s);
break;
- case '\n':
- luaI_addchar('\\');
- luaI_addchar('n');
- break;
case 0:
goto END_WHILE;
default:
diff --git a/lex.c b/lex.c
@@ -1,4 +1,4 @@
-char *rcs_lex = "$Id: lex.c,v 2.22 1995/12/21 16:14:04 roberto Exp roberto $";
+char *rcs_lex = "$Id: lex.c,v 2.23 1996/02/07 14:14:40 roberto Exp roberto $";
#include <ctype.h>
@@ -254,6 +254,7 @@ int luaY_lex (void)
case 'n': save('\n'); next(); break;
case 't': save('\t'); next(); break;
case 'r': save('\r'); next(); break;
+ case '\n': lua_linenumber++; /* goes through */
default : save(current); next(); break;
}
break;