Add more closure tests.

This commit is contained in:
Stephen Chung
2020-08-09 22:12:50 +08:00
parent dbf5cd13c8
commit 564d3bc339
2 changed files with 43 additions and 12 deletions

View File

@@ -1639,7 +1639,8 @@ fn parse_primary(
// Function call
Token::Identifier(s) if *next_token == Token::LeftParen || *next_token == Token::Bang => {
// Once the identifier consumed we must enable next variables capturing
#[cfg(not(feature = "no_closure"))] {
#[cfg(not(feature = "no_closure"))]
{
state.allow_capture = true;
}
Expr::Variable(Box::new(((s, settings.pos), None, 0, None)))