Text::Snippet::TabStop::Basic - Basic TabStop


Text-Snippet documentation Contained in the Text-Snippet distribution.

Index


Code Index:

NAME

Top

Text::Snippet::TabStop::Basic - Basic TabStop

VERSION

Top

version 0.04

SYNOPSIS

Top

This class provides basic tab stop functionality and inherits from Text::Snippet::TabStop.

CLASS METHODS

Top

parse

The main entry point into this class. It takes a single argument which consists of the source of the tab stop within the snippet.

AUTHOR

Top

  Brian Phillips <bphillips@cpan.org>

COPYRIGHT AND LICENSE

Top


Text-Snippet documentation Contained in the Text-Snippet distribution.

package Text::Snippet::TabStop::Basic;
BEGIN {
  $Text::Snippet::TabStop::Basic::VERSION = '0.04';
}

# ABSTRACT: Basic TabStop

use strict;
use warnings;

use base qw(Text::Snippet::TabStop);


sub parse {
	my $class = shift;
	my $src = shift;
	if($src =~ m/^\$(\d+)$/ || $src =~ m/^\$\{(\d+)\}$/){
		return $class->_new( index => $1, src => $src );
	}
	return;
}

1;

__END__