lua

A copy of the Lua development repository
Log | Files | Refs | README

commit f81b8adb3f2738d2895511082793af622e8581d8
parent 2b2267069bcd2f214fa47786364653f5522d9529
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed,  7 Mar 2001 09:49:15 -0300

string [[...]] ignores initial \n

Diffstat:
Mllex.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llex.c b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 1.81 2001/02/23 20:32:16 roberto Exp roberto $ +** $Id: llex.c,v 1.82 2001/03/06 14:46:54 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -194,6 +194,8 @@ static void read_long_string (LexState *LS, SemInfo *seminfo) { checkbuffer(L, 10, l); save(L, l_c('['), l); /* save first `[' */ save_and_next(L, LS, l); /* pass the second `[' */ + if (LS->current == l_c('\n')) /* string starts with a newline? */ + inclinenumber(LS); /* skip it */ for (;;) { checkbuffer(L, 10, l); switch (LS->current) {