From c3fcebe55ba525d59e556db9a4202f2ef13874d0 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 2 May 2015 15:13:25 -0400 Subject: [PATCH 01/14] s/Mouse/Moo/ --- lib/Text/Xslate.pm | 4 ++-- lib/Text/Xslate/Compiler.pm | 10 +++++----- lib/Text/Xslate/PP/Opcode.pm | 4 ++-- lib/Text/Xslate/PP/State.pm | 4 ++-- lib/Text/Xslate/PP/Type/Macro.pm | 4 ++-- lib/Text/Xslate/PP/Type/Pair.pm | 4 ++-- lib/Text/Xslate/Parser.pm | 4 ++-- lib/Text/Xslate/Runner.pm | 14 +++++++------- lib/Text/Xslate/Symbol.pm | 6 +++--- lib/Text/Xslate/Syntax/Kolon.pm | 4 ++-- lib/Text/Xslate/Syntax/Metakolon.pm | 4 ++-- lib/Text/Xslate/Syntax/TTerse.pm | 4 ++-- t/lib/Text/Xslate/Syntax/Foo.pm | 4 ++-- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lib/Text/Xslate.pm b/lib/Text/Xslate.pm index 017ee08d..b59b8c88 100644 --- a/lib/Text/Xslate.pm +++ b/lib/Text/Xslate.pm @@ -621,8 +621,8 @@ sub _compiler { my $compiler = $self->{compiler}; if(!ref $compiler){ - require Mouse; - Mouse::load_class($compiler); + require Moo; + Moo::load_class($compiler); my $input_layer = $self->input_layer; $compiler = $compiler->new( diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index a40efb65..46830646 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -1,6 +1,6 @@ package Text::Xslate::Compiler; -use Mouse; -use Mouse::Util::TypeConstraints; +use Moo; +use Moo::Util::TypeConstraints; use Scalar::Util (); use Carp (); @@ -208,7 +208,7 @@ sub _build_parser { return $syntax; } else { - my $parser_class = Mouse::Util::load_first_existing_class( + my $parser_class = Moo::Util::load_first_existing_class( "Text::Xslate::Syntax::" . $syntax, $syntax, ); @@ -1594,8 +1594,8 @@ sub _error { die $self->make_error($message, $self->file, $line); } -no Mouse; -no Mouse::Util::TypeConstraints; +no Moo; +no Moo::Util::TypeConstraints; __PACKAGE__->meta->make_immutable; __END__ diff --git a/lib/Text/Xslate/PP/Opcode.pm b/lib/Text/Xslate/PP/Opcode.pm index 5598e538..567fbfb3 100644 --- a/lib/Text/Xslate/PP/Opcode.pm +++ b/lib/Text/Xslate/PP/Opcode.pm @@ -1,5 +1,5 @@ package Text::Xslate::PP::Opcode; -use Mouse; +use Moo; extends qw(Text::Xslate::PP::State); our $VERSION = '3.3.4'; @@ -635,7 +635,7 @@ sub proccall { } } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable(); __END__ diff --git a/lib/Text/Xslate/PP/State.pm b/lib/Text/Xslate/PP/State.pm index 43d4b609..5ab7e80f 100644 --- a/lib/Text/Xslate/PP/State.pm +++ b/lib/Text/Xslate/PP/State.pm @@ -1,5 +1,5 @@ package Text::Xslate::PP::State; # implement tx_state_t -use Mouse; +use Moo; use Text::Xslate::Util qw(neat p $DEBUG); use Text::Xslate::PP; @@ -234,7 +234,7 @@ sub bad_arg { return $st->error($context, "Wrong number of arguments for %s", $name); } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable; 1; __END__ diff --git a/lib/Text/Xslate/PP/Type/Macro.pm b/lib/Text/Xslate/PP/Type/Macro.pm index 5c42d7b5..4496de31 100644 --- a/lib/Text/Xslate/PP/Type/Macro.pm +++ b/lib/Text/Xslate/PP/Type/Macro.pm @@ -1,5 +1,5 @@ package Text::Xslate::PP::Type::Macro; -use Mouse; +use Moo; use warnings FATAL => 'recursion'; use overload @@ -53,7 +53,7 @@ sub as_code_ref { }; } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable; __END__ diff --git a/lib/Text/Xslate/PP/Type/Pair.pm b/lib/Text/Xslate/PP/Type/Pair.pm index 04856737..92aa9da1 100644 --- a/lib/Text/Xslate/PP/Type/Pair.pm +++ b/lib/Text/Xslate/PP/Type/Pair.pm @@ -1,12 +1,12 @@ package Text::Xslate::PP::Type::Pair; -use Mouse; +use Moo; has [qw(key value)] => ( is => 'rw', required => 1, ); -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable(); __END__ diff --git a/lib/Text/Xslate/Parser.pm b/lib/Text/Xslate/Parser.pm index d79c540b..a67b9cd0 100644 --- a/lib/Text/Xslate/Parser.pm +++ b/lib/Text/Xslate/Parser.pm @@ -1,5 +1,5 @@ package Text::Xslate::Parser; -use Mouse; +use Moo; use Scalar::Util (); @@ -1995,7 +1995,7 @@ sub _error { $parser->file, $line || $parser->line); } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable; __END__ diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index 1e30f8b3..ab490ed8 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -1,6 +1,6 @@ package Text::Xslate::Runner; -use Mouse; -use Mouse::Util::TypeConstraints; +use Moo; +use Moo::Util::TypeConstraints; use List::Util (); use File::Spec (); @@ -10,7 +10,7 @@ use Getopt::Long (); { package Text::Xslate::Runner::Getopt; - use Mouse::Role; + use Moo::Role; has cmd_aliases => ( is => 'ro', @@ -19,7 +19,7 @@ use Getopt::Long (); auto_deref => 1, ); - no Mouse::Role; + no Moo::Role; } my $getopt = Getopt::Long::Parser->new( @@ -293,7 +293,7 @@ sub run { return; } - Mouse::load_class($self->engine); + Moo::load_class($self->engine); my $xslate = $self->engine->new(%args); if($self->has_eval) { @@ -446,8 +446,8 @@ sub _encode { } } -no Mouse; -no Mouse::Util::TypeConstraints; +no Moo; +no Moo::Util::TypeConstraints; __PACKAGE__->meta->make_immutable; __END__ diff --git a/lib/Text/Xslate/Symbol.pm b/lib/Text/Xslate/Symbol.pm index effd264b..6f5e71a3 100644 --- a/lib/Text/Xslate/Symbol.pm +++ b/lib/Text/Xslate/Symbol.pm @@ -1,5 +1,5 @@ package Text::Xslate::Symbol; -use Mouse; +use Moo; use Text::Xslate::Util qw(p $DEBUG); @@ -45,7 +45,7 @@ has value => ( return; }, # default => sub{ -# if(!defined $_[0]) { #XXX: Mouse::XS's bug +# if(!defined $_[0]) { #XXX: Moo::XS's bug # my(undef, $file, $line) = caller; # warn "[bug] no invocant at $file line $line.\n"; # return '(null)'; @@ -240,7 +240,7 @@ sub _dump_denote { ; } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable; __END__ diff --git a/lib/Text/Xslate/Syntax/Kolon.pm b/lib/Text/Xslate/Syntax/Kolon.pm index 5f265905..0510a807 100644 --- a/lib/Text/Xslate/Syntax/Kolon.pm +++ b/lib/Text/Xslate/Syntax/Kolon.pm @@ -1,9 +1,9 @@ package Text::Xslate::Syntax::Kolon; -use Mouse; +use Moo; extends qw(Text::Xslate::Parser); -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable(); __END__ diff --git a/lib/Text/Xslate/Syntax/Metakolon.pm b/lib/Text/Xslate/Syntax/Metakolon.pm index 19268c11..c309eb97 100644 --- a/lib/Text/Xslate/Syntax/Metakolon.pm +++ b/lib/Text/Xslate/Syntax/Metakolon.pm @@ -1,5 +1,5 @@ package Text::Xslate::Syntax::Metakolon; -use Mouse; +use Moo; extends qw(Text::Xslate::Parser); @@ -8,7 +8,7 @@ sub _build_line_start { '%%' } sub _build_tag_start { '[%' } sub _build_tag_end { '%]' } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable(); __END__ diff --git a/lib/Text/Xslate/Syntax/TTerse.pm b/lib/Text/Xslate/Syntax/TTerse.pm index 2488e308..ba36f295 100644 --- a/lib/Text/Xslate/Syntax/TTerse.pm +++ b/lib/Text/Xslate/Syntax/TTerse.pm @@ -1,5 +1,5 @@ package Text::Xslate::Syntax::TTerse; -use Mouse; +use Moo; use Text::Xslate::Util qw(p any_in); use Scalar::Util (); @@ -602,7 +602,7 @@ sub std_filter { return( $proc, $parser->print($callfilter) ); } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable(); __END__ diff --git a/t/lib/Text/Xslate/Syntax/Foo.pm b/t/lib/Text/Xslate/Syntax/Foo.pm index 7a4ff3b1..53a1e6fa 100644 --- a/t/lib/Text/Xslate/Syntax/Foo.pm +++ b/t/lib/Text/Xslate/Syntax/Foo.pm @@ -1,5 +1,5 @@ package Text::Xslate::Syntax::Foo; -use Mouse; +use Moo; extends qw(Text::Xslate::Parser); @@ -7,6 +7,6 @@ sub _build_line_start { undef } sub _build_tag_start { '<%' } sub _build_tag_end { '%>' } -no Mouse; +no Moo; __PACKAGE__->meta->make_immutable(); From 44786060b9b27b9df8d9bfa4a2a50e1bf5014325 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 2 May 2015 15:27:58 -0400 Subject: [PATCH 02/14] so it begins... --- lib/Text/Xslate/Parser.pm | 5 ++++- lib/Text/Xslate/Symbol.pm | 28 +++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/Text/Xslate/Parser.pm b/lib/Text/Xslate/Parser.pm index a67b9cd0..918194d8 100644 --- a/lib/Text/Xslate/Parser.pm +++ b/lib/Text/Xslate/Parser.pm @@ -2,6 +2,9 @@ package Text::Xslate::Parser; use Moo; use Scalar::Util (); +use Carp qw/ confess /; + +use MooX::Types::MooseLike::Base qw(:all); use Text::Xslate::Symbol; use Text::Xslate::Util qw( @@ -49,7 +52,7 @@ my $CHOMP_FLAGS = qr/-/xms; has identity_pattern => ( is => 'ro', - isa => 'RegexpRef', + isa => RegexpRef, builder => '_build_identity_pattern', init_arg => undef, diff --git a/lib/Text/Xslate/Symbol.pm b/lib/Text/Xslate/Symbol.pm index 6f5e71a3..a75baf33 100644 --- a/lib/Text/Xslate/Symbol.pm +++ b/lib/Text/Xslate/Symbol.pm @@ -3,6 +3,8 @@ use Moo; use Text::Xslate::Util qw(p $DEBUG); +use MooX::Types::MooseLike::Base qw(:all); + use overload bool => sub() { 1 }, '""' => sub { $_[0]->id }, @@ -14,14 +16,14 @@ our @CARP_NOT = qw(Text::Xslate::Parser); use constant _DUMP_DENOTE => scalar($DEBUG =~ /\b dump=denote \b/xmsi); has id => ( - is => 'rw', - isa => 'Str', + is => 'rw', + isa => Str, required => 1, ); has lbp => ( # left binding power is => 'rw', - isa => 'Int', + isa => Int, lazy => 1, default => 0, @@ -29,7 +31,7 @@ has lbp => ( # left binding power has ubp => ( # unary binding power is => 'rw', - isa => 'Int', + isa => Int, required => 0, ); @@ -57,7 +59,7 @@ has value => ( # some tokens have the counterpart token (e.g. '{' to '}') has counterpart => ( is => 'rw', - isa => 'Str', + isa => Str, required => 0, ); @@ -74,13 +76,13 @@ has [ 'can_be_modifier', # statement modifiers (e.g. expr if cond) ] => ( is => 'rw', - isa => 'Bool', + isa => Bool, required => 0, ); has nud => ( # null denotation is => 'bare', - isa => 'CodeRef', + isa => CodeRef, writer => 'set_nud', reader => 'get_nud', @@ -100,7 +102,7 @@ has nud => ( # null denotation has led => ( # left denotation is => 'bare', - isa => 'CodeRef', + isa => CodeRef, writer => 'set_led', reader => 'get_led', @@ -114,7 +116,7 @@ has led => ( # left denotation has std => ( # statement denotation is => 'bare', - isa => 'CodeRef', + isa => CodeRef, writer => 'set_std', reader => 'get_std', @@ -135,14 +137,14 @@ has [qw(first second third)] => ( has type => ( is => 'rw', - isa => 'Str', + isa => Str, required => 0, ); has arity => ( is => 'rw', - isa => 'Str', + isa => Str, lazy => 1, default => 'name', @@ -152,7 +154,7 @@ has arity => ( has assignment => ( is => 'rw', - isa => 'Bool', + isa => Bool, required => 0, ); @@ -166,7 +168,7 @@ has assignment => ( has line => ( is => 'rw', - isa => 'Int', + isa => Int, lazy => 1, default => 0, From 9f06a6ee91f1f9cf80d25adc3723ce691cf2dd93 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 2 May 2015 15:40:13 -0400 Subject: [PATCH 03/14] converting --- lib/Text/Xslate/Compiler.pm | 6 +++--- lib/Text/Xslate/Parser.pm | 4 ++-- lib/Text/Xslate/Runner.pm | 6 +++--- lib/Text/Xslate/Symbol.pm | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index 46830646..4068d3f3 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -147,7 +147,7 @@ has const => ( has macro_table => ( is => 'rw', - isa => 'HashRef', + isa => HashRef, predicate => 'has_macro_table', init_arg => undef, @@ -180,7 +180,7 @@ has syntax => ( has parser_option => ( is => 'rw', - isa => 'HashRef', + isa => HashRef, default => sub { {} }, ); @@ -244,7 +244,7 @@ has file => ( has overridden_builtin => ( is => 'ro', - isa => 'HashRef', + isa => HashRef, default => sub { +{} }, ); diff --git a/lib/Text/Xslate/Parser.pm b/lib/Text/Xslate/Parser.pm index 918194d8..0050c47f 100644 --- a/lib/Text/Xslate/Parser.pm +++ b/lib/Text/Xslate/Parser.pm @@ -70,7 +70,7 @@ has [qw(compiler engine)] => ( has symbol_table => ( # the global symbol table is => 'ro', - isa => 'HashRef', + isa => HashRef, default => sub{ {} }, @@ -79,7 +79,7 @@ has symbol_table => ( # the global symbol table has iterator_element => ( is => 'ro', - isa => 'HashRef', + isa => HashRef, lazy => 1, builder => '_build_iterator_element', diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index ab490ed8..64461717 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -135,7 +135,7 @@ has suffix => ( documentation => 'Output suffix mapping (e.g. tx=html)', cmd_aliases => [qw(x)], is => 'ro', - isa => 'HashRef', + isa => HashRef, default => sub { +{} }, traits => $getopt_traits, ); @@ -153,7 +153,7 @@ has define => ( documentation => 'Define template variables (e.g. foo=bar)', cmd_aliases => [qw(D)], is => 'ro', - isa => 'HashRef', + isa => HashRef, predicate => 'has_define', traits => $getopt_traits, ); @@ -231,7 +231,7 @@ sub _build_getopt_spec { elsif($isa->is_a_type_of('ArrayRef')) { $type = '=s@'; } - elsif($isa->is_a_type_of('HashRef')) { + elsif($isa->is_a_type_of(HashRef)) { $type = '=s%'; } else { diff --git a/lib/Text/Xslate/Symbol.pm b/lib/Text/Xslate/Symbol.pm index a75baf33..138cce3f 100644 --- a/lib/Text/Xslate/Symbol.pm +++ b/lib/Text/Xslate/Symbol.pm @@ -161,7 +161,7 @@ has assignment => ( #has scope => ( # is => 'rw', -# isa => 'HashRef', +# isa => HashRef, # # required => 0, #); From 19e2fd522bab21e37e4a4f41b170248bfb7b4248 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 2 May 2015 15:57:42 -0400 Subject: [PATCH 04/14] progressing --- lib/Text/Xslate/Compiler.pm | 2 +- lib/Text/Xslate/PP/Type/Macro.pm | 8 ++++---- lib/Text/Xslate/Parser.pm | 22 ++++++++++----------- lib/Text/Xslate/Runner.pm | 34 ++++++++++++++++---------------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index 4068d3f3..4a3e7fa6 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -126,7 +126,7 @@ my %builtin = ( has lvar_id => ( # local variable id is => 'rw', - isa => 'Int', + isa => Int, init_arg => undef, ); diff --git a/lib/Text/Xslate/PP/Type/Macro.pm b/lib/Text/Xslate/PP/Type/Macro.pm index 4496de31..58e7f9c1 100644 --- a/lib/Text/Xslate/PP/Type/Macro.pm +++ b/lib/Text/Xslate/PP/Type/Macro.pm @@ -9,28 +9,28 @@ use overload has name => ( is => 'ro', - isa => 'Str', + isa => Str, required => 1, ); has addr => ( is => 'ro', - isa => 'Int', + isa => Int, required => 1, ); has nargs => ( is => 'rw', - isa => 'Int', + isa => Int, default => 0, ); has outer => ( is => 'rw', - isa => 'Int', + isa => Int, default => 0, ); diff --git a/lib/Text/Xslate/Parser.pm b/lib/Text/Xslate/Parser.pm index 0050c47f..0a1f3025 100644 --- a/lib/Text/Xslate/Parser.pm +++ b/lib/Text/Xslate/Parser.pm @@ -89,7 +89,7 @@ has iterator_element => ( has scope => ( is => 'rw', - isa => 'ArrayRef[HashRef]', + isa => ArrayRef[HashRef], clearer => 'init_scope', @@ -101,28 +101,28 @@ has scope => ( has token => ( is => 'rw', - isa => 'Maybe[Object]', + isa => Maybe[Object], init_arg => undef, ); has next_token => ( # to peek the next token is => 'rw', - isa => 'Maybe[ArrayRef]', + isa => Maybe[ArrayRef], init_arg => undef, ); has statement_is_finished => ( is => 'rw', - isa => 'Bool', + isa => Bool, init_arg => undef, ); has following_newline => ( is => 'rw', - isa => 'Int', + isa => Int, default => 0, init_arg => undef, @@ -130,35 +130,35 @@ has following_newline => ( has input => ( is => 'rw', - isa => 'Str', + isa => Str, init_arg => undef, ); has line_start => ( is => 'ro', - isa => 'Maybe[Str]', + isa => Maybe[Str], builder => '_build_line_start', ); sub _build_line_start { ':' } has tag_start => ( is => 'ro', - isa => 'Str', + isa => Str, builder => '_build_tag_start', ); sub _build_tag_start { '<:' } has tag_end => ( is => 'ro', - isa => 'Str', + isa => Str, builder => '_build_tag_end', ); sub _build_tag_end { ':>' } has comment_pattern => ( is => 'ro', - isa => 'RegexpRef', + isa => RegexpRef, builder => '_build_comment_pattern', ); sub _build_comment_pattern { $COMMENT } @@ -172,7 +172,7 @@ sub _build_shortcut_table { \%shortcut_table } has in_given => ( is => 'rw', - isa => 'Bool', + isa => Bool, init_arg => undef, ); diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index 64461717..0bf36b43 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -30,8 +30,8 @@ my $getopt = Getopt::Long::Parser->new( )], ); -my $Pattern = subtype __PACKAGE__ . '.Pattern', as 'RegexpRef'; -coerce $Pattern => from 'Str' => via { qr/$_/ }; +my $Pattern = subtype __PACKAGE__ . '.Pattern', as RegexpRef; +coerce $Pattern => from Str => via { qr/$_/ }; my $getopt_traits = ['Text::Xslate::Runner::Getopt']; @@ -39,7 +39,7 @@ has cache_dir => ( documentation => 'Directory the cache files will be saved in', cmd_aliases => [qw(c)], is => 'ro', - isa => 'Str', + isa => Str, predicate => 'has_cache_dir', traits => $getopt_traits, ); @@ -48,7 +48,7 @@ has cache => ( documentation => 'Cache level', cmd_aliases => [qw(a)], is => 'ro', - isa => 'Int', + isa => Int, predicate => 'has_cache', traits => $getopt_traits, ); @@ -66,7 +66,7 @@ has input_encoding => ( documentation => 'Input encoding (default: UTF-8)', cmd_aliases => [qw(ie)], is => 'rw', - isa => 'Str', + isa => Str, default => 'UTF-8', predicate => 'has_input_encoding', traits => $getopt_traits, @@ -76,7 +76,7 @@ has output_encoding => ( documentation => 'Output encoding (default: UTF-8)', cmd_aliases => [qw(oe)], is => 'rw', - isa => 'Str', + isa => Str, default => 'UTF-8', predicate => 'has_output_encoding', traits => $getopt_traits, @@ -96,7 +96,7 @@ has syntax => ( documentation => 'Template syntax (e.g. TTerse)', cmd_aliases => [qw(s)], is => 'ro', - isa => 'Str', + isa => Str, predicate => 'has_syntax', traits => $getopt_traits, ); @@ -105,7 +105,7 @@ has type => ( documentation => 'Output content type (html | xml | text)', cmd_aliases => [qw(t)], is => 'ro', - isa => 'Str', + isa => Str, predicate => 'has_type', traits => $getopt_traits, ); @@ -114,7 +114,7 @@ has verbose => ( documentation => 'Warning level (default: 2)', cmd_aliases => [qw(w)], is => 'ro', - isa => 'Str', + isa => Str, default => 2, predicate => 'has_verbose', traits => $getopt_traits, @@ -144,7 +144,7 @@ has dest => ( documentation => 'Destination directry', cmd_aliases => [qw(o)], is => 'ro', - isa => 'Str', # Maybe[Str] + isa => Str, # Maybe[Str] required => 0, traits => $getopt_traits, ); @@ -162,7 +162,7 @@ has eval => ( documentation => 'One line of template code', cmd_aliases => [qw(e)], is => 'ro', - isa => 'Str', + isa => Str, predicate => 'has_eval', traits => $getopt_traits, ); @@ -171,7 +171,7 @@ has engine => ( documentation => 'Template engine', cmd_aliases => [qw(E)], is => 'ro', - isa => 'Str', + isa => Str, default => 'Text::Xslate', traits => $getopt_traits, ); @@ -180,7 +180,7 @@ has debug => ( documentation => 'Debugging flags', cmd_aliases => ['d'], is => 'ro', - isa => 'Str', + isa => Str, predicate => 'has_debug', traits => $getopt_traits, ); @@ -188,14 +188,14 @@ has debug => ( has version => ( documentation => 'Print version information', is => 'ro', - isa => 'Bool', + isa => Bool, traits => $getopt_traits, ); has help => ( documentation => 'Print this help', is => 'ro', - isa => 'Bool', + isa => Bool, traits => $getopt_traits, ); @@ -219,10 +219,10 @@ sub _build_getopt_spec { my $isa = $attr->type_constraint; my $type; - if($isa->is_a_type_of('Bool')) { + if($isa->is_a_type_of(Bool)) { $type = ''; } - elsif($isa->is_a_type_of('Int')) { + elsif($isa->is_a_type_of(Int)) { $type = '=i'; } elsif($isa->is_a_type_of('Num')) { From 5694a08f6a99c64d025ba82c4fe9adf4d86effa3 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 2 May 2015 15:58:53 -0400 Subject: [PATCH 05/14] done with Text::Xslate::Parser? --- lib/Text/Xslate/Compiler.pm | 2 +- lib/Text/Xslate/Parser.pm | 2 +- lib/Text/Xslate/Runner.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index 4a3e7fa6..ae23019c 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -133,7 +133,7 @@ has lvar_id => ( # local variable id has lvar => ( # local variable id table is => 'rw', - isa => 'HashRef[Int]', + isa => HashRef[Int], init_arg => undef, ); diff --git a/lib/Text/Xslate/Parser.pm b/lib/Text/Xslate/Parser.pm index 0a1f3025..200039c3 100644 --- a/lib/Text/Xslate/Parser.pm +++ b/lib/Text/Xslate/Parser.pm @@ -165,7 +165,7 @@ sub _build_comment_pattern { $COMMENT } has shortcut_table => ( is => 'ro', - isa => 'HashRef[Str]', + isa => HashRef[Str], builder => '_build_shortcut_table', ); sub _build_shortcut_table { \%shortcut_table } diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index 0bf36b43..67969127 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -57,7 +57,7 @@ has module => ( documentation => 'Modules templates will use (e.g. name=sub1,sub2)', cmd_aliases => [qw(M)], is => 'ro', - isa => 'HashRef[Str]', + isa => HashRef[Str], predicate => 'has_module', traits => $getopt_traits, ); From 606ddd364d47dba9b52451959c4963cfeda9d34d Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 2 May 2015 16:06:05 -0400 Subject: [PATCH 06/14] continuing... --- lib/Text/Xslate/Compiler.pm | 14 +++++++------- lib/Text/Xslate/PP/Type/Macro.pm | 2 +- lib/Text/Xslate/Runner.pm | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index ae23019c..267f4d21 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -1,10 +1,11 @@ package Text::Xslate::Compiler; use Moo; -use Moo::Util::TypeConstraints; use Scalar::Util (); use Carp (); +use MooX::Types::MooseLike::Base qw(:all); + use Text::Xslate::Parser; use Text::Xslate::Util qw( $DEBUG @@ -140,7 +141,7 @@ has lvar => ( # local variable id table has const => ( is => 'rw', - isa => 'ArrayRef', + isa => ArrayRef, init_arg => undef, ); @@ -155,14 +156,14 @@ has macro_table => ( has engine => ( # Xslate engine is => 'ro', - isa => 'Object', + isa => Object, required => 0, weak_ref => 1, ); has dependencies => ( is => 'ro', - isa => 'ArrayRef', + isa => ArrayRef, init_arg => undef, ); @@ -187,7 +188,7 @@ has parser_option => ( has parser => ( is => 'rw', - isa => 'Object', # Text::Xslate::Parser + isa => Object, # Text::Xslate::Parser handles => [qw(define_function)], @@ -227,7 +228,7 @@ has cascade => ( has [qw(header footer macro)] => ( is => 'rw', - isa => 'ArrayRef', + isa => ArrayRef, ); has current_file => ( @@ -1595,7 +1596,6 @@ sub _error { } no Moo; -no Moo::Util::TypeConstraints; __PACKAGE__->meta->make_immutable; __END__ diff --git a/lib/Text/Xslate/PP/Type/Macro.pm b/lib/Text/Xslate/PP/Type/Macro.pm index 58e7f9c1..e24c4d9c 100644 --- a/lib/Text/Xslate/PP/Type/Macro.pm +++ b/lib/Text/Xslate/PP/Type/Macro.pm @@ -37,7 +37,7 @@ has outer => ( has state => ( is => 'rw', - isa => 'Object', + isa => Object, required => 1, weak_ref => 1, diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index 67969127..e0c6a691 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -14,7 +14,7 @@ use Getopt::Long (); has cmd_aliases => ( is => 'ro', - isa => 'ArrayRef[Str]', + isa => ArrayRef[Str], default => sub { [] }, auto_deref => 1, ); @@ -87,7 +87,7 @@ has path => ( documentation => 'Include paths', cmd_aliases => [qw(I)], is => 'ro', - isa => 'ArrayRef[Str]', + isa => ArrayRef[Str], predicate => 'has_path', traits => $getopt_traits, ); @@ -201,7 +201,7 @@ has help => ( has targets => ( is => 'ro', - isa => 'ArrayRef[Str]', + isa => ArrayRef[Str], default => sub { [] }, auto_deref => 1, ); @@ -228,7 +228,7 @@ sub _build_getopt_spec { elsif($isa->is_a_type_of('Num')) { $type = '=f'; } - elsif($isa->is_a_type_of('ArrayRef')) { + elsif($isa->is_a_type_of(ArrayRef)) { $type = '=s@'; } elsif($isa->is_a_type_of(HashRef)) { From e7635675f40409fd7d4f8f2bb248b0a1b11f28b7 Mon Sep 17 00:00:00 2001 From: Charlie Gonzalez Date: Mon, 4 May 2015 21:37:05 -0400 Subject: [PATCH 07/14] More moo changes.. Moo is now included in one of the test files. --- lib/Text/Xslate.pm | 4 ++-- lib/Text/Xslate/Compiler.pm | 8 +++++--- t/020_interface/014_customize_option.t | 12 ++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/Text/Xslate.pm b/lib/Text/Xslate.pm index b59b8c88..83c7d6c8 100644 --- a/lib/Text/Xslate.pm +++ b/lib/Text/Xslate.pm @@ -621,8 +621,8 @@ sub _compiler { my $compiler = $self->{compiler}; if(!ref $compiler){ - require Moo; - Moo::load_class($compiler); + require Class::Load; + Class::Load::load_class($compiler); my $input_layer = $self->input_layer; $compiler = $compiler->new( diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index 267f4d21..4ba140c6 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -169,14 +169,14 @@ has dependencies => ( has type => ( is => 'rw', - isa => enum([qw(html xml text)]), + isa => Enum(qw(html xml text)), default => 'html', ); has syntax => ( is => 'rw', - default => 'Kolon', + default => sub{'Kolon'}, ); has parser_option => ( @@ -205,11 +205,13 @@ has input_layer => ( sub _build_parser { my($self) = @_; my $syntax = $self->syntax; + if(ref($syntax)) { return $syntax; } else { - my $parser_class = Moo::Util::load_first_existing_class( + require Class::Load; + my $parser_class = Class::Load::load_first_existing_class( "Text::Xslate::Syntax::" . $syntax, $syntax, ); diff --git a/t/020_interface/014_customize_option.t b/t/020_interface/014_customize_option.t index 2d0d89d6..20c88ec7 100755 --- a/t/020_interface/014_customize_option.t +++ b/t/020_interface/014_customize_option.t @@ -13,7 +13,7 @@ use t::lib::Util; package MyXslate; { - use Mouse; + use Moo; extends qw(Text::Xslate); @@ -41,11 +41,11 @@ package MyXslate; return $value; } - no Mouse; + no Moo; package MyCompiler; - use Mouse; + use Moo; extends qw(Text::Xslate::Compiler); @@ -53,12 +53,12 @@ package MyXslate; is => 'rw', ); - no Mouse; + no Moo; __PACKAGE__->meta->make_immutable(); } package MySyntax; { - use Mouse; + use Moo; extends qw(Text::Xslate::Parser); @@ -66,7 +66,7 @@ package MySyntax; is => 'rw', ); - no Mouse; + no Moo; __PACKAGE__->meta->make_immutable(); } package main; From 77a61568637304eb4856ae4891dc59151bdf8668 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Mon, 4 May 2015 23:08:37 -0400 Subject: [PATCH 08/14] Enum[] --- lib/Text/Xslate/Compiler.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index 4ba140c6..69322806 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -169,7 +169,7 @@ has dependencies => ( has type => ( is => 'rw', - isa => Enum(qw(html xml text)), + isa => Enum[qw(html xml text)], default => 'html', ); From 64c10f3702bb47524367e5b844e7dd6c7f81cafd Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Tue, 12 May 2015 09:53:27 -0400 Subject: [PATCH 09/14] add the types --- lib/Text/Xslate/PP/Type/Macro.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Text/Xslate/PP/Type/Macro.pm b/lib/Text/Xslate/PP/Type/Macro.pm index e24c4d9c..33e6c49c 100644 --- a/lib/Text/Xslate/PP/Type/Macro.pm +++ b/lib/Text/Xslate/PP/Type/Macro.pm @@ -1,7 +1,10 @@ package Text::Xslate::PP::Type::Macro; -use Moo; + use warnings FATAL => 'recursion'; +use Moo; +use MooX::Types::MooseLike::Base qw(:all); + use overload '&{}' => \&as_code_ref, fallback => 1, From 425c4682b2c8027221b3d4d000586e572ea2f26f Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Tue, 12 May 2015 09:53:42 -0400 Subject: [PATCH 10/14] Moo don't do lazy_build --- lib/Text/Xslate/Symbol.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Text/Xslate/Symbol.pm b/lib/Text/Xslate/Symbol.pm index 138cce3f..3337de00 100644 --- a/lib/Text/Xslate/Symbol.pm +++ b/lib/Text/Xslate/Symbol.pm @@ -95,7 +95,8 @@ has nud => ( # null denotation return; }, - lazy_build => 1, + lazy => 1, + builder => '_build_nud', required => 0, ); @@ -109,7 +110,8 @@ has led => ( # left denotation predicate => 'has_led', clearer => 'remove_led', - lazy_build => 1, + lazy => 1, + builder => '_build_led', required => 0, ); From c5ccd189beeeadb2aac5efdd87385e2189e0bccf Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Wed, 20 May 2015 19:31:14 -0400 Subject: [PATCH 11/14] more changes --- lib/Text/Xslate/Runner.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index e0c6a691..b29459db 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -1,16 +1,22 @@ package Text::Xslate::Runner; + use Moo; -use Moo::Util::TypeConstraints; + +use MooX::Types::MooseLike::Base qw(:all); use List::Util (); use File::Spec (); use File::Basename (); use Getopt::Long (); +use Class::Load; + { package Text::Xslate::Runner::Getopt; + use Moo::Role; + use MooX::Types::MooseLike::Base qw(:all); has cmd_aliases => ( is => 'ro', @@ -30,9 +36,6 @@ my $getopt = Getopt::Long::Parser->new( )], ); -my $Pattern = subtype __PACKAGE__ . '.Pattern', as RegexpRef; -coerce $Pattern => from Str => via { qr/$_/ }; - my $getopt_traits = ['Text::Xslate::Runner::Getopt']; has cache_dir => ( @@ -125,8 +128,8 @@ has ignore => ( documentation => 'Regular expression the process will ignore', cmd_aliases => [qw(i)], is => 'ro', - isa => $Pattern, - coerce => 1, + isa => RegexpRef, + coerce => sub { ref $_[0] ? $_[0] : qr/$_[0]/ }, traits => $getopt_traits, ); @@ -293,7 +296,7 @@ sub run { return; } - Moo::load_class($self->engine); + Class::Load::load_class($self->engine); my $xslate = $self->engine->new(%args); if($self->has_eval) { @@ -447,7 +450,6 @@ sub _encode { } no Moo; -no Moo::Util::TypeConstraints; __PACKAGE__->meta->make_immutable; __END__ From 2ca47271fc20c1e7416dfc1167f279031b5ddd38 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Wed, 20 May 2015 19:50:20 -0400 Subject: [PATCH 12/14] more tests passing --- lib/Text/Xslate/Runner.pm | 18 +++++++++--------- script/xslate | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index b29459db..f14022d6 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -22,7 +22,6 @@ use Class::Load; is => 'ro', isa => ArrayRef[Str], default => sub { [] }, - auto_deref => 1, ); no Moo::Role; @@ -206,7 +205,6 @@ has targets => ( is => 'ro', isa => ArrayRef[Str], default => sub { [] }, - auto_deref => 1, ); my @Spec = __PACKAGE__->_build_getopt_spec(); @@ -215,33 +213,35 @@ sub getopt_spec { @Spec } sub _build_getopt_spec { my($self) = @_; + $DB::single = 1; + my @spec; foreach my $attr($self->meta->get_all_attributes) { next unless $attr->does('Text::Xslate::Runner::Getopt'); my $isa = $attr->type_constraint; - + my $type; - if($isa->is_a_type_of(Bool)) { + if($isa->is_a_type_of('Bool')) { $type = ''; } - elsif($isa->is_a_type_of(Int)) { + elsif($isa->is_a_type_of('Int')) { $type = '=i'; } elsif($isa->is_a_type_of('Num')) { $type = '=f'; } - elsif($isa->is_a_type_of(ArrayRef)) { + elsif($isa->is_a_type_of('ArrayRef')) { $type = '=s@'; } - elsif($isa->is_a_type_of(HashRef)) { + elsif($isa->is_a_type_of('HashRef')) { $type = '=s%'; } else { $type = '=s'; } - my @names = ($attr->name, $attr->cmd_aliases); + my @names = ($attr->name, @{ $attr->cmd_aliases} ); push @spec, join('|', @names) . $type; } return @spec; @@ -413,7 +413,7 @@ sub help_message { next unless $attr->does('Text::Xslate::Runner::Getopt'); my $name = join ' ', map { length($_) == 1 ? "-$_": "--$_" } - ($attr->cmd_aliases, $attr->name); + (@{ $attr->cmd_aliases }, $attr->name); push @options, [ $name => $attr->documentation ]; } diff --git a/script/xslate b/script/xslate index bc94e907..21bac68e 100755 --- a/script/xslate +++ b/script/xslate @@ -3,7 +3,7 @@ use strict; use Text::Xslate::Runner; my $app = Text::Xslate::Runner->new_from(@ARGV); -$app->run( $app->targets ); +$app->run( @{$app->targets} ); __END__ From 962f541965fe6ae1086d6236c8a85239138b436f Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Wed, 20 May 2015 20:12:28 -0400 Subject: [PATCH 13/14] Need Moo > 2.00 for non-strictness --- lib/Text/Xslate/Parser.pm | 2 +- t/010_internals/019_runtime_error.t | 57 +++++++++++++++++------------ 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/lib/Text/Xslate/Parser.pm b/lib/Text/Xslate/Parser.pm index 200039c3..329df97a 100644 --- a/lib/Text/Xslate/Parser.pm +++ b/lib/Text/Xslate/Parser.pm @@ -1,5 +1,5 @@ package Text::Xslate::Parser; -use Moo; +use Moo 2.000001; use Scalar::Util (); use Carp qw/ confess /; diff --git a/t/010_internals/019_runtime_error.t b/t/010_internals/019_runtime_error.t index 96e849a5..c868ac1c 100644 --- a/t/010_internals/019_runtime_error.t +++ b/t/010_internals/019_runtime_error.t @@ -35,30 +35,36 @@ foreach my $code( q{ 1 ? html(nil) : "UNLIKELY" }, q{ $empty x 10 }, ) { + + subtest $code => sub { + $warn = ''; + + my $out = eval { + $tx->render_string("<: $code :>", { h => {'' => 'foo' }, a => [42] }); + }; + + is $out, '', $code; + is $warn, ''; + is $@, ''; + } +} + + +subtest 'f()' => sub { $warn = ''; my $out = eval { - $tx->render_string("<: $code :>", { h => {'' => 'foo' }, a => [42] }); + $tx->render_string("<: f() :>"); }; - is $out, '', $code; - is $warn, ''; + is $out, '', 'no output' or die "Oops: [$warn][$@]"; + like $warn, qr/DIE/, 'warn contains DIE'; + like $warn, qr/at $FILE line \d+/, 'warns come from the file'; is $@, ''; -} - - -$warn = ''; -my $out = eval { - $tx->render_string("<: f() :>"); }; -is $out, '', 'nothing' or die "Oops: [$warn][$@]"; -like $warn, qr/DIE/, $warn; -like $warn, qr/at $FILE line \d+/, 'warns come from the file'; -is $@, ''; - $warn = ''; -$out = eval { +my $out = eval { $tx->render_string('<: constant FOO = 42; FOO[0] :>'); }; @@ -67,17 +73,20 @@ like $warn, qr/not a container/; like $warn, qr/at $FILE line \d+/, 'warns come from the file'; is $@, ''; +subtest '$a + $b' => sub { -$warn = ''; -$out = eval { - $tx->render_string('<: $a + $b :>', { a => 'foo', b => 'bar' }); -}; + $warn = ''; + $out = eval { + $tx->render_string('<: $a + $b :>', { a => 'foo', b => 'bar' }); + }; -is $out, '0', 'warn in render_string()'; -like $warn, qr/"foo" isn't numeric/; -like $warn, qr/"bar" isn't numeric/; -like $warn, qr/at $FILE line \d+/, 'warns come from the file'; -is $@, ''; + is $out, '0', 'warn in render_string()'; + like $warn, qr/"foo" isn't numeric/; + like $warn, qr/"bar" isn't numeric/; + like $warn, qr/at $FILE line \d+/, 'warns come from the file'; + is $@, ''; + +}; $warn = ''; $out = eval { From 71d9f574ebce617daa9c4b978c89ccc7d750b7f5 Mon Sep 17 00:00:00 2001 From: Charlie Gonzalez Date: Tue, 26 May 2015 19:30:51 -0400 Subject: [PATCH 14/14] Update makefile and modules with Moo version --- Makefile.PL | 2 +- lib/Text/Xslate/Compiler.pm | 2 +- lib/Text/Xslate/PP/Opcode.pm | 2 +- lib/Text/Xslate/PP/State.pm | 2 +- lib/Text/Xslate/PP/Type/Macro.pm | 2 +- lib/Text/Xslate/PP/Type/Pair.pm | 2 +- lib/Text/Xslate/Runner.pm | 2 +- lib/Text/Xslate/Symbol.pm | 2 +- lib/Text/Xslate/Syntax/Kolon.pm | 2 +- lib/Text/Xslate/Syntax/Metakolon.pm | 2 +- lib/Text/Xslate/Syntax/TTerse.pm | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 2ed928b3..a0216494 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -29,7 +29,7 @@ use inc::Module::Install; all_from 'lib/Text/Xslate.pm'; -requires 'Mouse' => '0.61'; +requires 'Moo' => '2.000001'; requires 'Data::MessagePack' => '0.38'; requires 'parent' => '0.221'; requires 'Scalar::Util' => '1.14'; diff --git a/lib/Text/Xslate/Compiler.pm b/lib/Text/Xslate/Compiler.pm index 69322806..be84cce1 100644 --- a/lib/Text/Xslate/Compiler.pm +++ b/lib/Text/Xslate/Compiler.pm @@ -1,5 +1,5 @@ package Text::Xslate::Compiler; -use Moo; +use Moo 2.000001; use Scalar::Util (); use Carp (); diff --git a/lib/Text/Xslate/PP/Opcode.pm b/lib/Text/Xslate/PP/Opcode.pm index 567fbfb3..8475914e 100644 --- a/lib/Text/Xslate/PP/Opcode.pm +++ b/lib/Text/Xslate/PP/Opcode.pm @@ -1,5 +1,5 @@ package Text::Xslate::PP::Opcode; -use Moo; +use Moo 2.000001; extends qw(Text::Xslate::PP::State); our $VERSION = '3.3.4'; diff --git a/lib/Text/Xslate/PP/State.pm b/lib/Text/Xslate/PP/State.pm index 5ab7e80f..1234dcf3 100644 --- a/lib/Text/Xslate/PP/State.pm +++ b/lib/Text/Xslate/PP/State.pm @@ -1,5 +1,5 @@ package Text::Xslate::PP::State; # implement tx_state_t -use Moo; +use Moo 2.000001; use Text::Xslate::Util qw(neat p $DEBUG); use Text::Xslate::PP; diff --git a/lib/Text/Xslate/PP/Type/Macro.pm b/lib/Text/Xslate/PP/Type/Macro.pm index 33e6c49c..5fcb4358 100644 --- a/lib/Text/Xslate/PP/Type/Macro.pm +++ b/lib/Text/Xslate/PP/Type/Macro.pm @@ -2,7 +2,7 @@ package Text::Xslate::PP::Type::Macro; use warnings FATAL => 'recursion'; -use Moo; +use Moo 2.000001; use MooX::Types::MooseLike::Base qw(:all); use overload diff --git a/lib/Text/Xslate/PP/Type/Pair.pm b/lib/Text/Xslate/PP/Type/Pair.pm index 92aa9da1..bdf3ab84 100644 --- a/lib/Text/Xslate/PP/Type/Pair.pm +++ b/lib/Text/Xslate/PP/Type/Pair.pm @@ -1,5 +1,5 @@ package Text::Xslate::PP::Type::Pair; -use Moo; +use Moo 2.000001; has [qw(key value)] => ( is => 'rw', diff --git a/lib/Text/Xslate/Runner.pm b/lib/Text/Xslate/Runner.pm index f14022d6..f00cf8b8 100644 --- a/lib/Text/Xslate/Runner.pm +++ b/lib/Text/Xslate/Runner.pm @@ -1,6 +1,6 @@ package Text::Xslate::Runner; -use Moo; +use Moo 2.000001; use MooX::Types::MooseLike::Base qw(:all); diff --git a/lib/Text/Xslate/Symbol.pm b/lib/Text/Xslate/Symbol.pm index 3337de00..a1a4284b 100644 --- a/lib/Text/Xslate/Symbol.pm +++ b/lib/Text/Xslate/Symbol.pm @@ -1,5 +1,5 @@ package Text::Xslate::Symbol; -use Moo; +use Moo 2.000001; use Text::Xslate::Util qw(p $DEBUG); diff --git a/lib/Text/Xslate/Syntax/Kolon.pm b/lib/Text/Xslate/Syntax/Kolon.pm index 0510a807..cfa33fab 100644 --- a/lib/Text/Xslate/Syntax/Kolon.pm +++ b/lib/Text/Xslate/Syntax/Kolon.pm @@ -1,5 +1,5 @@ package Text::Xslate::Syntax::Kolon; -use Moo; +use Moo 2.000001; extends qw(Text::Xslate::Parser); diff --git a/lib/Text/Xslate/Syntax/Metakolon.pm b/lib/Text/Xslate/Syntax/Metakolon.pm index c309eb97..7568eada 100644 --- a/lib/Text/Xslate/Syntax/Metakolon.pm +++ b/lib/Text/Xslate/Syntax/Metakolon.pm @@ -1,5 +1,5 @@ package Text::Xslate::Syntax::Metakolon; -use Moo; +use Moo 2.000001; extends qw(Text::Xslate::Parser); diff --git a/lib/Text/Xslate/Syntax/TTerse.pm b/lib/Text/Xslate/Syntax/TTerse.pm index ba36f295..9438080b 100644 --- a/lib/Text/Xslate/Syntax/TTerse.pm +++ b/lib/Text/Xslate/Syntax/TTerse.pm @@ -1,5 +1,5 @@ package Text::Xslate::Syntax::TTerse; -use Moo; +use Moo 2.000001; use Text::Xslate::Util qw(p any_in); use Scalar::Util ();