Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -3015,6 +3015,17 @@ class parser
next();
return {};
}
if (
peek(-1) && peek(-1)->type() != lexeme::RightBrace // it is short function syntax
&& curr().type() != lexeme::LeftParen // not imediatelly called
&& curr().type() != lexeme::RightParen // not as a last argument to function
&& curr().type() != lexeme::Comma // not as first or in-the-middle, function argument
) {
// this is a fix for a short function syntax that should have double semicolon used
// (check comment in expression_statement(bool semicolon_required))
// We simulate double semicolon by moving back to single semicolon.
next(-1);
}
}
else {
error("(temporary alpha limitation) an unnamed declaration at expression scope must be a function or an object");
Expand Down