diff --git a/parser.y b/parser.y index ad92ce7..d836b9f 100644 --- a/parser.y +++ b/parser.y @@ -107,11 +107,16 @@ stmts | stmt { $$ = $1; } ; +newlines + : newlines NEWLINE + | + ; + stmt - : expr NEWLINE { $$ = concatenate($1, ";"); } - | if { $$ = $1; } - | while { $$ = $1; } - | BREAK NEWLINE { $$ = new std::string("break;"); } + : expr newlines { $$ = concatenate($1, ";"); } + | if newlines { $$ = $1; } + | while newlines { $$ = $1; } + | BREAK newlines { $$ = new std::string("break;"); } ; expr