Do not parse closures when allow_anonymous_fn is false.
This commit is contained in:
@@ -1862,7 +1862,7 @@ fn parse_unary(
|
||||
}
|
||||
// | ...
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
Token::Pipe | Token::Or => {
|
||||
Token::Pipe | Token::Or if settings.allow_anonymous_fn => {
|
||||
let mut new_state = ParseState::new(
|
||||
state.engine,
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
@@ -3353,6 +3353,8 @@ impl Engine {
|
||||
};
|
||||
let expr = parse_expr(input, &mut state, &mut functions, settings)?;
|
||||
|
||||
assert!(functions.is_empty());
|
||||
|
||||
match input.peek().unwrap() {
|
||||
(Token::EOF, _) => (),
|
||||
// Return error if the expression doesn't end
|
||||
|
Reference in New Issue
Block a user