Pugs::Runtime::StrPos - Represent a position inside a string
* YAML::Syck
- in order to support 'yaml()'
* new({ str => "...", codes => $n });
create a new StrPos object.
'str' must be utf-8.
'codes' can be undef, meaning "nowhere in this string".
* from_str( $str )
create a new StrPos object, using the perl5-string internal 'pos'.
* from_str_graphs( $str, $graphs ) * from_str_codes( $str, $codes )
create a new StrPos object using grapheme or codepoint units.
* bytes() * codes() * graphs()
- return the position as an integer, counting in bytes, codepoints, or graphemes.
* langs()
- TODO - return the position as an integer, counting in language dependent chars.
* bool()
- test whether a position is defined.
* add_codes($n) * add_graphs($n)
- return a new StrPos with the new position
* clone
- return a new StrPos with the same position
* numeric
- return the count of graphemes, or undef.
* boolean
- test whether a position is defined. The position 'zero' is true.
* perl
- return the internal representation as Perl source code.
* yaml
- return the internal representation as YAML. Requires the YAML::Syck module.
YAML::Syck
* dump_hs
- for Pugs interoperability
v6 on CPAN
v6
The Pugs Team <perl6-compiler@perl.org>.
Copyright 2007 by Flavio Soibelmann Glock and others.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Pugs::Compiler::Rule, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pugs::Compiler::Rule
CPAN shell
perl -MCPAN -e shell install Pugs::Compiler::Rule
For more information on module installation, please visit the detailed CPAN module installation guide.