From: Robin Edwards Date: Sun, 20 Dec 2009 21:36:53 +0000 (+0000) Subject: added some docs to declare X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61b97664401284397af9e1265736aa4ab73ebb53;p=p5sagit%2FDevel-Declare-Keyword.git added some docs to declare --- diff --git a/lib/Keyword/Declare.pm b/lib/Keyword/Declare.pm index beb206d..bbc4cef 100644 --- a/lib/Keyword/Declare.pm +++ b/lib/Keyword/Declare.pm @@ -4,7 +4,6 @@ use warnings; use Carp; use Devel::Declare; -# maybe subclass Devel::Declare::Context::Simple? sub new { my ($class, $self) = @_; @@ -15,12 +14,24 @@ sub new { bless($self,__PACKAGE__); } +=head1 METHODS + +=head2 offset + +for setting and retrieving the offset + +=cut + sub offset { my ($self, $offset) = @_; ${$self->{offset}} = $offset if $offset; return ${$self->{offset}}; } +=head2 inc_offset + +=cut + sub inc_offset { my ($self, $offset) = @_; if($offset) { @@ -31,11 +42,24 @@ sub inc_offset { } return ${$self->{offset}}; } + +=head2 next_token + +skips to the next token + +=cut + sub next_token { my ($self) = @_; ${$self->{offset}} += Devel::Declare::toke_move_past_token($self->offset); } +=head2 skip_to + +skips along until it finds a token matching + +=cut + sub skip_to { my ($self, $name) = @_; my $toke = ""; @@ -50,6 +74,7 @@ sub skip_to { return $toke; } + sub strip_to_char { my ($self, $char) = @_; my $str = "";