Resolve recoursive template dependencies

Hello! I'd like to thank you for this plugin. My usage of nunjucks is rather uncommon, I have created a custom extension that allows to do this:

File 'block.nunj'

    <div class="block">{% block items %}default{% endblock %}</div>

File 'test.nunj'

    {% bem 'block.nunj' %}{% block items %}override items{% endblock %}{% endbem %}  

File 'test.nunj' will be compiled into `<div class="block">override items</div>`

It does so by introducing new type of node, that captures raw contents during parse, adds `{% extends %}` and compiles itself as a new template from captured contents. The problem appears when I want to use such tag inside itself and pass it the same template name:

    {% bem 'block.nunj' %}
        {% block items %}
            {% bem 'block.nunj' %}{% block items %}override items{% endblock %}{% endbem %}
        {% endblock %}
    {% endbem %}

I need this to be compiled into `<div class="block"><div class="block">override items</div></div>` but I get an error that browserify could not find module with the name 'block.nunj'.

Contents of nested `{% bem 'block.nunj' %}` are compiled inside the scope of 'block.nunj', so this block tries to require itself by using overridden `env.getTemplate` and causes browserify error.

Is there any workaround for this problem?