v
v copied to clipboard
Template: Replace `@` intelligently
Fixes #14104.
Added a function which receives a line of template code and replaces all @
symbols based on if it conforms to
-@ident
[email protected]
-@{code}
Added tests in v_parser_test.v
New to open source so please let me know how to improve this.
@spytheman
Tests are not passing since there are workarounds in vlib/v/tests/inout/tmpl_parse_html.vv
for @
replacements that are no longer necessary. @ was written as @@ when you wanted the literal symbol.
Shall I change it?
@spytheman Tests are not passing since there are workarounds in
vlib/v/tests/inout/tmpl_parse_html.vv
for@
replacements that are no longer necessary. @ was written as @@ when you wanted the literal symbol. Shall I change it?
@medvednikov what do you think?
(I do not know, and can not decide, since V_TEMPLATE support was removed in b42c824)
Note that I did put tmpl_parse_html.vv in an explicit skip list in vlib/v/tests/inout/compiler_test.v
in c70e18e, so another option may be to just rebase the code, instead of fixing tmpl_parse_html.vv
🤔 .