From e723c75c02a48d0c766f1f30f7a321f7fdb239dc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 28 Mar 2015 16:14:47 -0300 Subject: details (avoid 'lint' warnings) --- llex.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 8a6ac108..0c3eb4dd 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.89 2014/11/14 16:06:09 roberto Exp roberto $ +** $Id: llex.c,v 2.90 2015/03/03 18:17:04 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -283,8 +283,9 @@ static int read_numeral (LexState *ls, SemInfo *seminfo) { /* -** skip a sequence '[=*[' or ']=*]' and return its number of '='s or -** -1 if sequence is malformed +** skip a sequence '[=*[' or ']=*]'; if sequence is wellformed, return +** its number of '='s; otherwise, return a negative number (-1 iff there +** are no '='s after initial bracket) */ static int skip_sep (LexState *ls) { int count = 0; @@ -501,8 +502,9 @@ static int llex (LexState *ls, SemInfo *seminfo) { read_long_string(ls, seminfo, sep); return TK_STRING; } - else if (sep == -1) return '['; - else lexerror(ls, "invalid long string delimiter", TK_STRING); + else if (sep != -1) /* '[=...' missing second bracket */ + lexerror(ls, "invalid long string delimiter", TK_STRING); + return '['; } case '=': { next(ls); -- cgit v1.2.3-55-g6feb