First line comment crashes erlydtl #31

Closed
jeanparpaillon opened this Issue Jun 14, 2012 · 2 comments

Projects

None yet

3 participants

Hi,
Given the following template:
<!-- comment -->
<html>
...
</html>

Then this one:
<!-- other comment -->
{% extend "path/to/first/template.html" %}

Compilation of second template fails with:
=ERROR REPORT==== 14-Jun-2012::13:25:59 ===
{{case_clause,{extends,{string_literal,{2,12},""greeting/list.html""}}},
[{erlydtl_compiler,value_ast,4,
[{file,"src/erlydtl_compiler.erl"},{line,634}]},
{erlydtl_compiler,'-body_ast/3-fun-2-',3,
[{file,"src/erlydtl_compiler.erl"},{line,601}]},
{lists,mapfoldl,3,[{file,"lists.erl"},{line,1278}]},
{lists,mapfoldl,3,[{file,"lists.erl"},{line,1279}]},
{erlydtl_compiler,body_ast,3,[{file,"src/erlydtl_compiler.erl"},{line,509}]},
{erlydtl_compiler,compile_to_binary,4,
[{file,"src/erlydtl_compiler.erl"},{line,189}]},
{erlydtl_compiler,compile,3,[{file,"src/erlydtl_compiler.erl"},{line,104}]},
{boss_load,compile_view_erlydtl,4,
[{file,"src/boss/boss_load.erl"},{line,205}]}]}

If I remove the comment in 2nd template, it compiles fine. Comment in the first template cause no problem. Using DTL style comment for 2nd template also leads to crash.

Regards,
Jean

I found that it does not have to be a comment above the extend. I left an empty line where Jean has the comment and I got the same error.

Owner
kaos commented Nov 28, 2013

I can confirm that a leading blank line before the extends tag results in a compiler crash.

It's on my todo list..

@kaos kaos was assigned Nov 28, 2013
@kaos kaos added a commit that referenced this issue Nov 28, 2013
@kaos kaos Add failing test for issue #31. 98f89cb
@kaos kaos closed this in e976f07 Nov 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment