Commit 36b97117 authored by Jack's avatar Jack
Browse files

additional fixes for inline if

parent 5718a105
......@@ -1430,17 +1430,13 @@ static int test_then_block (LexState *ls, int *escapelist) {
int maybeInline = ls->t.token == '(';
if (maybeInline) /* consume '(' */
checknext(ls, '(');
expr(ls, &v); /* read condition */
/* if we have a closing paren and there is no then, it's an inline */
maybeInline = maybeInline & ls->t.token == ')' && luaX_lookahead != TK_THEN;
/* if we had parenthesis and there is no then, it's an inline */
maybeInline = maybeInline && ls->t.token != TK_THEN;
if (maybeInline) /* surely inline inline, consume ')' */
{
checknext(ls, ')');
inline_if(ls, &v);
return 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment