template allows $ instead of @
V version: ArchLinux OS: 0.2.4 e031096
What did you do?
https://github.com/vlang/v/blob/master/doc/docs.md#tmpl-for-embedding-and-parsing-v-template-files
I get the same result when I change 1.txt as follows although this is intentional or a bug.
name: $name
age: $age
numbers: $numbers
@for number in numbers
$number
@end
What did you expect to see?
The part where @ is changed to $ is ignored.
What did you see instead? No error.
I'm not familiar with this part of v, but I'm assuming in here is why the bug occurs; it uses '$' as a special keyword, as it turns '@' into '$', but if you already have $ initially, it'll just go straight to being processed. The simplest solution would be to perhaps disallow the '$' character in the template code? I wouldn't mind attempting it.
Hmm.. If V tries to parse $, there will be a conflict with the javascript template and will not compile.
I see it works just like is expected to work. Confirm @medvednikov ?
No, I think it should only allow @. One way and everything. I didn't intend for $ to work, it's an unintended bug, since templates are compiled into V code, and $ is used for string interpolation.