Kasago::Token - A search result for a token


Kasago documentation Contained in the Kasago distribution.

Index


Code Index:

NAME

Top

Kasago::Token - A search result for a token

SYNOPSIS

Top

  # search for a token
  foreach my $token ($kasago->search('orange')){
    print $token->source . "/"
      . $token->file . "@"
      . $token->col . ","
      . $token->row . ": "
      . $token->line . "\n";
  }

 # search for tokens
  foreach my $token ($kasago->search_more($search)) {
    print $token->source . "/"
      . $token->file . "@"
      . $token->col . ","
      . $token->row . ": "
      . $token->line . "\n";
  }

DESCRIPTION

Top

Kasago::Token represents a search result for a token.

AUTHOR

Top

Leon Brocard <acme@astray.com>.

COPYRIGHT

Top


Kasago documentation Contained in the Kasago distribution.

package Kasago::Token;
use strict;
use base qw( Class::Accessor::Chained::Fast );
__PACKAGE__->mk_accessors(qw( row col value source file line ));

sub _new_from_node {
  my($class, $node, $value, $location) = @_;
  $location ||= $node->location;
  my $self  = $class->SUPER::new({
    row   => $location->[0],
    col   => $location->[1],
    value => $value,
  });
  return $self;
}

1;

__END__