Macro-Micro

 view release on metacpan or  search on metacpan

lib/Macro/Micro.pm  view on Meta::CPAN

#pod
#pod   macro_format - this is the format for macros; see the macro_format method
#pod
#pod =cut

my $DEFAULT_MACRO_FORMAT = qr/(?<!\\)([\[<] (\w+) [>\]])/x;

sub new {
  my ($class, %arg) = @_;

  my $self = bless { } => $class;

  $arg{macro_format} = $DEFAULT_MACRO_FORMAT unless $arg{macro_format};

  $self->macro_format($arg{macro_format});

  return $self;
}

#pod =method macro_format
#pod

lib/Macro/Micro.pm  view on Meta::CPAN

    $pos = pos $text;
  }

  push @total, substr $text, $pos if defined $pos;

  return Macro::Micro::Template->_new(\$text, \@total);
}

{
  package Macro::Micro::Template 0.055;
  sub _new   { bless [ $_[1], $_[2] ] => $_[0] }
  sub _parts { @{ $_[0][1] } }
  sub _text  {    $_[0][0]   }
}

"[MAGIC_TRUE_VALUE]";

__END__

=pod



( run in 0.375 second using v1.01-cache-2.11-cpan-de7293f3b23 )