Rechercher une page de manuel
PPI::Token::DashedWord.3pm
Langue: en
Version: 2008-05-14 (debian - 07/07/09)
Section: 3 (Bibliothèques de fonctions)
NAME
PPI::Token::DashedWord - A dashed bareword tokenINHERITANCE
PPI::Token::DashedWord isa PPI::Token isa PPI::Element
DESCRIPTION
The ``dashed bareword'' token represents literal values like "-foo".NOTE: this class is currently unused. All tokens that should be PPI::Token::DashedWords are just normal PPI::Token::Word instead. That actually makes sense, since there really is nothing special about this class except that dashed words cannot subroutine names or keywords. As such, this class may be removed from PPI in the future.
METHODS
literal
Returns the value of the dashed word as a string. This differs from "content" because "-Foo'Bar" expands to "-Foo::Bar".
my @pairs = ( ``-foo'', '-foo',
``-Foo::Bar'', '-Foo::Bar',
``-Foo'Bar'', '-Foo::Bar',
); while ( @pairs ) { my $from = shift @pairs;
my $to = shift @pairs;
my $doc = PPI::Document->new( \``(<$from => 1);'' );
isa_ok( $doc, 'PPI::Document' );
my $word = $doc->find_first('Token::DashedWord');
local $TODO = 'PPI::Token::DashedWord is currently deactivated';
isa_ok( $word, 'PPI::Token::DashedWord' );
is( $word && $word->literal, $to, ``The source $from becomes $to ok'' );
}
SUPPORT
See the support section in the main module.AUTHOR
Adam Kennedy <adamk@cpan.org>COPYRIGHT
Copyright 2001 - 2008 Adam Kennedy.This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
POD ERRORS
Hey! The above document had some coding errors, which are explained below:- Around line 42:
- '=begin' only takes one parameter, not several as in '=begin testing literal 9'
- Around line 60:
- =end testing without matching =begin. (Stack: [empty])
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre