| 1 | package Translate::Fluent::Elements; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use Translate::Fluent::Elements::Message; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use Translate::Fluent::Elements::Pattern; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use Translate::Fluent::Elements::PatternElement; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 6 | ▶ | use Translate::Fluent::Elements::InlinePlaceable; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 6 | ▶ | use Translate::Fluent::Elements::InlineText; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 6 | ▶ | use Translate::Fluent::Elements::InlineExpression; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 6 | ▶ | use Translate::Fluent::Elements::BlockText; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 6 | ▶ | use Translate::Fluent::Elements::BlockPlaceable; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 6 | ▶ | use Translate::Fluent::Elements::FunctionReference; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 6 | ▶ | use Translate::Fluent::Elements::VariableReference; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 6 | ▶ | use Translate::Fluent::Elements::CallArguments; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 6 | ▶ | use Translate::Fluent::Elements::ArgumentList; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 6 | ▶ | use Translate::Fluent::Elements::Argument; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 6 | ▶ | use Translate::Fluent::Elements::NamedArgument; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 6 | ▶ | use Translate::Fluent::Elements::MessageReference; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 6 | ▶ | use Translate::Fluent::Elements::TermReference; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 6 | ▶ | use Translate::Fluent::Elements::AttributeAccessor; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 6 | ▶ | use Translate::Fluent::Elements::StringLiteral; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 6 | ▶ | use Translate::Fluent::Elements::Term; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 6 | ▶ | use Translate::Fluent::Elements::SelectExpression; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 6 | ▶ | use Translate::Fluent::Elements::Variant; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 6 | ▶ | use Translate::Fluent::Elements::DefaultVariant; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 6 | ▶ | use Translate::Fluent::Elements::Attribute; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | |||||||||||
| 27 | 708 | ▶ | sub create { | ||||||||
|
Subroutine
create: called CC=4 SCAR=17.4
Pod
documented
| |||||||||||
| 28 | 708 | my (undef, $type, $args) = @_; | |||||||||
| 29 | |||||||||||
| 30 | 708 | $type = "\u$type"; | |||||||||
| 31 | 708 | $type =~ s/_(.)/\u$1/g; | |||||||||
| 32 | |||||||||||
| 33 | 708 | my $class = "Translate::Fluent::Elements::$type"; | |||||||||
| 34 | |||||||||||
| 35 | 708 | my $res; | |||||||||
| 36 | eval { | ||||||||||
| 37 | 708 | $res = $class->new( %$args ); | |||||||||
| 38 | |||||||||||
| 39 | 708 | 1; | |||||||||
| 40 | 708 | ▶ | } or do { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | 0 | my ($err) = $@; | |||||||||
| 42 | 0 | ▶ | print STDERR "err: $err\n" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | unless $err =~ m{Can't locate object method "new"}; | ||||||||||
| 44 | 0 | ▶ | unless ($type eq 'Text') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 0 | print STDERR "FLT: Missing $class\n"; | |||||||||
| 46 | } | ||||||||||
| 47 | }; | ||||||||||
| 48 | |||||||||||
| 49 | 708 | return $res; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 6 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||