);
};
- function semicolon() {
+ function semicolon(optional) {
if (is("punc", ";")) next();
- else if (!can_insert_semicolon()) unexpected();
+ else if (!optional && !can_insert_semicolon()) unexpected();
};
function parenthesised() {
case "do":
return new AST_Do({
body : in_loop(statement),
- condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
+ condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(true), tmp)
});
case "while":