kirbysayshi/vash

Exception when dividing

Closed this issue · 2 comments

vash template:

@{
 var test = 100/3;
}
<span>@test</span>

UnmatchedCharacterError: Unmatched FORWARD_SLASH at line 4, character 14. Value: /
+PROGRAM
| +BLOCK
| | [NEWLINE (3,2): ]
| | [KEYWORD (4,0): var]
| | [WHITESPACE (4,3): ]
| | [IDENTIFIER (4,4): test]
| | [WHITESPACE (4,8): ]
| | [ASSIGN_OPERATOR (4,9): =]
| | [WHITESPACE (4,10): ]
| | [NUMERIC_CONTENT (4,11): 100]
| -BLOCK
-PROGRAM

That is absolutely a bug. I don't have a work around at the moment, but thank you very much for the simple, reproducible test case! Vash is confusing the / for a regular expression.

This should be implemented as of >= 0.8.0!