Created
January 10, 2012 05:37
-
-
Save walf443/1587228 to your computer and use it in GitHub Desktop.
xslate not work?
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 strict; | |
use warnings; | |
use Text::Xslate; | |
use Data::Section::Simple qw/get_data_section/; | |
my $xslate = Text::Xslate->new(syntax => 'TTerse'); | |
render('simple_if'); | |
render('declare_if'); | |
render('problem_case'); | |
sub render { | |
my $section = shift; | |
warn $section; | |
warn $xslate->render_string(get_data_section($section)); | |
} | |
__DATA__ | |
@@ declare_if | |
[% IF hoge %] | |
[% ELSE %] | |
[% IF fuga %] | |
[% ELSE %] | |
[% END %] | |
[% SET hoge = fuga %] | |
[% END %] | |
@@ simple_if | |
%% IF hoge | |
%% ELSE | |
%% IF fuga | |
%% ELSE | |
%% END | |
%% END | |
@@ problem_case | |
%% IF hoge | |
%% ELSE | |
%% IF fuga | |
%% ELSE | |
%% END | |
%% SET hoge = fuga; | |
%% END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment