private function add_directives($blade)
    {
        $blade->directive(
            'simplemenu',
            function ($expression) {
                \preg_match('/\( *(.*) * as *([^\)]*)/', $expression, $matches);
                
                $iteratee = \trim($matches[1]);
                
                $iteration = \trim($matches[2]);
                
                $init_loop = "\$__currentLoopData = \Snap\Utils\Menu_Utils::get_nav_menu($iteratee); 
                    \$this->addLoop(\$__currentLoopData);";
               
                $iterate_loop = '$this->incrementLoopIndices(); 
                    $loop = $this->getFirstLoop();';

                return "<?php {$init_loop} foreach(\$__currentLoopData as {$iteration}): {$iterate_loop} ?>";
            }
        );

        $blade->directive(
            'endsimplemenu',
            function () {
                return '<?php endforeach; $this->popLoop(); $loop = $this->getFirstLoop(); ?>';
            }
        );

        $blade->directive(
            'partial',
            function ($input) {
                $input = $this->trim_input($input);
                $input = \str_replace('partials.\'', 'partials.', '\'partials.' . $input);
                return '<?php echo $this->runChild('.$input.'); ?>';
            }
        );

        $blade->directive(
            'posttypepartial',
            function () {
                return '<?php global $post; echo $this->runChild(\'partials.post-type.\' . \get_post_type(), [\'post\' => $post]); ?>';
            }
        );

        $blade->directive(
            'paginate',
            function ($input = []) {
                $input = $input ?? '[]';

                return '
			<?php
			$pagination = \Snap\Services\Container::resolve(
	            \Snap\Templating\Pagination::class,
	            [
	                \'args\' => ' . $this->trim_input($input) .',
	            ]
	        );

	        echo $pagination->get();
	        ?>';
            }
        );

        $blade->directive(
            'loop',
            function ($input) {
                $input = $this->trim_input($input);

                $init_loop = '$__loop_query = $wp_query;';

                if (! empty($input)) {
                    $init_loop = '$__loop_query = ' . $input . ';';
                }

                $init_loop .= '$__currentLoopData = $__loop_query->posts; 
                    $this->addLoop($__currentLoopData); 
                    global $post;';

                $iterate_loop = '$this->incrementLoopIndices(); $loop = $this->getFirstLoop();';

                return "<?php {$init_loop} while (\$__loop_query->have_posts()): 
                    \$__loop_query->the_post(); {$iterate_loop} ?>";
            }
        );

        $blade->directive(
            'endloop',
            function () {
                return '<?php endwhile;  ?>';
            }
        );
    }