| 1 | use v5; | ||
| 2 | |||
| 3 | package Perlito5::Match; | ||
| 4 | use strict; | ||
| 5 | |||
| 6 | sub flat { | ||
| 7 | my $self = $_[0]; | ||
| 8 | return $self->{capture} if defined( $self->{capture} ); | ||
| 9 | return join( "", | ||
| 10 | @{ $self->{str} }[ $self->{from} .. $self->{to} - 1 ] | ||
| 11 | ); | ||
| 12 | } | ||
| 13 | |||
| 14 | 1; | ||
| 15 | |||
| 16 | =begin | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Perlito5::Match - Runtime for Perlito Perl5-in-JavaScript grammars | ||
| 21 | |||
| 22 | =head1 AUTHORS | ||
| 23 | |||
| 24 | Flavio Soibelmann Glock <fglock@gmail.com>. | ||
| 25 | |||
| 26 | =head1 COPYRIGHT | ||
| 27 | |||
| 28 | Copyright 2009, 2011, 2012 by Flavio Soibelmann Glock. | ||
| 29 | |||
| 30 | This program is free software; you can redistribute it and/or modify it | ||
| 31 | under the same terms as Perl itself. | ||
| 32 | |||
| 33 | See L<http://www.perl.com/perl/misc/Artistic.html> | ||
| 34 | |||
| 35 | =end |