Created
June 10, 2011 06:19
-
-
Save ktat/1018320 to your computer and use it in GitHub Desktop.
Text::Xslate bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Text::Xslate; | |
my $t = Text::Xslate->new(syntax => 'TTerse'); | |
print $t->render_string(<<__END__); | |
[% | |
# | |
# | |
# | |
# | |
# | |
# | |
FOREACH x IN [1,2,3]; | |
x; | |
END; | |
%] | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
未定義の x を FOREACH で受ける変数で使うとエラーになるっぽい。先に x に値を入れておけば、エラーにはなりません。
x が演算子なのだろうけど、 それだと、 x に代入できるのも変な感じ。
また、エラー表示の際に、コメント行数を足し忘れているようです。コメント行を増やしても、常に、(:2)となる。
ちなみに、"数値" x 100 のようにクォートしても文字列として評価されない模様("10" x 100 とかやると、18446744073709551615)。
◎エラー内容
Text::Xslate::Syntax::TTerse: Expected a variable name, but got 'x', near FOREACH, while parsing templates (:2) at - line 3
[%