public function assertExpression(ExpressionInterface $expression) { foreach ($this->expression_flattener->flattenExpression($expression) as $expr) { try { $this->potentially_empty_checker->isPotentiallyEmpty($expr); } catch (CircularDependencyException $e) { throw new InvalidExpressionException("Contains left recursion"); } } }
public function assertExpression(ExpressionInterface $expression) { foreach ($this->expression_flattener->flattenExpression($expression) as $expr) { if ($expr instanceof RepeaterExpression === true) { /** @var \PeterVanDommelen\Parser\Expression\Repeater\RepeaterExpression $expr */ if ($this->is_potentially_empty->isPotentiallyEmpty($expr->getExpression()) === true) { throw new InvalidExpressionException("Contains a repeater expression that can be empty"); } } } }