Add {{ comment }} Statement Support
Closed this issue · 7 comments
Add support for the {{ comment }} statement.
Example:
{{comment}}Inline Comment{{/comment}}
{{comment}}
Multiline Comment
{{/comment}}
that's one way of doing comments.
another way would be to include them using a special char like:
{{# This is comment #}}
The advantage is that you don't have to type so much
Also, I'm not sure if we want to include the comments into the AST (abstract syntax tree), as they don't need to be rendered. We can just skip them in the lexer. For a {{comment}}, a scala class needs to be created and then memory consumed while storing the comments in the AST.
I don't think a comment should make it into the AST. This only encourages bad ideas like magic comments, that actually do things... Throw them out as early as possible...
Doesn't beard already kind of has comments like so?:
{{if false}}
This is basically a comment
{{/if}}
I added a similar request to the ticket...
On Mon, Jan 18, 2016 at 5:55 PM, Moritz Grauel notifications@github.com
wrote:
Doesn't beard already kind of has comments like so?:
{{if false}}
This is basically a comment
{{/if}}—
Reply to this email directly or view it on GitHub
#13 (comment).
I prefer the symbols here: comment is quite a common variable name on frontend scenarios... having it reserved could introduce a lot of confusion for newcomers.
We just have to check if a multiline like
{{#
foo
bar {{ qux }}
}}
#}}
would work 😄
so we need an unit test for this :)
Merged!