Add more lax newline handling
This commit is contained in:
13
parser.y
13
parser.y
@@ -107,11 +107,16 @@ stmts
|
|||||||
| stmt { $$ = $1; }
|
| stmt { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
newlines
|
||||||
|
: newlines NEWLINE
|
||||||
|
|
|
||||||
|
;
|
||||||
|
|
||||||
stmt
|
stmt
|
||||||
: expr NEWLINE { $$ = concatenate($1, ";"); }
|
: expr newlines { $$ = concatenate($1, ";"); }
|
||||||
| if { $$ = $1; }
|
| if newlines { $$ = $1; }
|
||||||
| while { $$ = $1; }
|
| while newlines { $$ = $1; }
|
||||||
| BREAK NEWLINE { $$ = new std::string("break;"); }
|
| BREAK newlines { $$ = new std::string("break;"); }
|
||||||
;
|
;
|
||||||
|
|
||||||
expr
|
expr
|
||||||
|
|||||||
Reference in New Issue
Block a user