summaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-03-07 09:49:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-03-07 09:49:37 -0300
commitf81b8adb3f2738d2895511082793af622e8581d8 (patch)
tree035bcb1cf293e5ef63e35327665c5c316c1d0b6a /llex.c
parent2b2267069bcd2f214fa47786364653f5522d9529 (diff)
downloadlua-github-f81b8adb3f2738d2895511082793af622e8581d8.tar.gz
string [[...]] ignores initial \n
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/llex.c b/llex.c
index ab722b54..3dc87470 100644
--- 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) {