Skip to content

Commit 8202bd1

Browse files
gh-69: Ban newline between IF and ELSEIF|ELSE.
1 parent 312bc5e commit 8202bd1

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/parser.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ static Stmt* parse_if(Parser* parser) {
543543
Stmt* then_block = parse_block(parser);
544544
Stmt* stmt = stmt_if(cond, then_block, if_tok.line, if_tok.column);
545545

546-
skip_newlines(parser);
547546
while (parser->current_token.type == TOKEN_ELSEIF) {
548547
advance(parser);
549548
consume(parser, TOKEN_LPAREN, "Expected '(' after ELSEIF");
@@ -553,7 +552,6 @@ static Stmt* parse_if(Parser* parser) {
553552
Stmt* elif_block = parse_block(parser);
554553
expr_list_add(&stmt->as.if_stmt.elif_conditions, elif_cond);
555554
stmt_list_add(&stmt->as.if_stmt.elif_blocks, elif_block);
556-
skip_newlines(parser);
557555
}
558556

559557
if (parser->current_token.type == TOKEN_ELSE) {

0 commit comments

Comments
 (0)