enthus1ast/nimja

lexer breaks when a single `#` is encountered in comment

enthus1ast opened this issue · 0 comments

eg:

import nimja/parser


let nwtNodes = compile("""{#
{% var idx = 0 %}
{%while true%}
  <div class="row m-4">
    {% for title in @["foo", "baa", "baz", "asdf", "afsdfasdfkl" , "asdfasdf"] %}
      <div class="col-4">
        <div class="card" style="width: 18rem;">
          <img src="..." class="card-img-top" alt="...">
          <div class="card-body">
            <h5 class="card-title">{{title}}</h5>
            <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
            <a href="#" class="btn btn-primary">Go somewhere</a>
          </div>
        </div>
      </div>
    {% endfor %}
  </div>
  {% idx.inc %}
  {% if idx > 2 %}{% break %}{% endif %}
{% endwhile %}
#}""")

echo nwtNodes
assert nwtNodes.len == 0