private function compileVariableNode(AstNode $astNode): RouteVariable
    {
        $rules = [];

        foreach ($astNode->children as $childAstNode) {
            if ($childAstNode->type !== AstNodeTypes::VARIABLE_RULE) {
                throw new InvalidArgumentException("Unexpected node type {$childAstNode->type}");
            }

            $ruleParams = $childAstNode->hasChildren() ? $childAstNode->children[0]->value : [];
            $rules[] = $this->ruleFactory->createRule($childAstNode->value, $ruleParams);
        }

        return new RouteVariable($astNode->value, $rules);
    }