Text::Xslateã«ãã³ãã¬ã¼ãã®Syntaxããã§ãã¯ããã¡ã½ããã追å ããã¦ä¾¿å©
Text::Xslateã®ãã¼ã¸ã§ã³3.1.0ããï¼ãã³ãã¬ã¼ãã®Syntaxãæ£ãããããã§ãªããããã§ãã¯ããã¡ã½ããã追å ããã¦ãã¦ä¾¿å©ã§ãï¼
以ä¸ã®ããã«ï¼ãã¹ãããã対象ã®ãã³ãã¬ã¼ããã¡ã¤ã«ãvalidate()
ã¡ã½ããã®å¼æ°ã¨ãã¦é£ã¹ããã¦ãããã¨ï¼ãã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®Syntaxããã§ãã¯ãã¦ããã¾ã (@files
ã®ä¸èº«ã¯ãã¹ã対象ã¨ãªããã³ãã¬ã¼ããã¡ã¤ã«ã®ãã¹ã®ãªã¹ã)ï¼
use Text::Xslate; my $tx = Text::Xslate->new; for my $file (@files) { $tx->validate($file); }
Syntaxãæ£ããæã«ã¯ä½ãèµ·ããï¼Syntaxã誤ã£ã¦ããæã¯ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ã¨å ±ã«ä¾å¤ãéåºããã¾ãï¼
Text::Xslate::Syntax::Kolon: Expected a semicolon or block end, but got 'content', near verride, while parsing templates (/Users/owner/MyApp/tmpl/index.tx:3) at bin/check_tmpl.pl line 16. ---------------------------------------------------------------------------- : verride content -> { ----------------------------------------------------------------------------
以ä¸ã®ããã«æ¸ãã¨ï¼ç°¡åã«ãã³ãã¬ã¼ããã¡ã¤ã«ã®Syntaxã®Testãä¸æ¬ã§åºæ¥ã¦ä¾¿å©ã§ã¯ç¡ããã¨æã£ã次第ã§ãï¼
use Test::More; use Text::Xslate; my $tx = Text::Xslate->new; for my $file (@files) { eval { $tx->validate($file) }; ok !$@, qq/Xslate Syntax OK: "$file"/; } done_testing;
大å¤ä¾¿å©ãªæ©è½ã§gfx++ã¨ããæãã§ããï¼ãªããundocumentedãªæ©è½ã ã£ãã®ã§ãã£ãããã¥ã¡ã³ãæ¸ãã¦Pull Requestãã¾ããï¼
[2014/01/08 22:44 追è¨]
gfxããã«ãã¼ã¸ãã¦ããã£ãã®ã§æ¬¡ã®ãã¼ã¸ã§ã³ãããããå½è©²æ©è½ã¯ããã¥ã¡ã³ãåããã¦ããã¨æãã¾ãï¼
ãããã¨ããããã¾ãï¼