PPIx::...tement(3pm)
β¨ NAME β¨
PPIx::Utilities::Statement β it's giving Extensions to PPI::Statement π (this is the PPIx::...tement page from the perl manual, bestie, we're doing it)
πΈ VERSION πΈ
This document describes PPIx::Utilities::Statement version 1.1.0. iconic, we stan a versioned doc π
π¦ SYNOPSIS π¦
okay so like, here's the whole vibe in code form:
use PPI::Document qw< >;
use PPIx::Utilities::Statement qw<
get_constant_name_elements_from_declaring_statement
>;
my $document = PPI::Document->new(\'Readonly::Scalar my $THINGY => 47.2;');
# Returns the PPI::Token::Symbol for "$THINGY".
my ($constant) = get_constant_name_elements_from_declaring_statement(
$document->schild(0)
);
yes bestie, that comment says it returns the PPI::Token::Symbol for "$THINGY" β no cap, it's right there in the source π«Ά
π DESCRIPTION π
So basically this module is a collection of functions for dealing with PPI::Statement objects. that's it, that's the whole assignment. PPI::Statements and the girls who love them π
β¨ INTERFACE β¨
β οΈ heads up: Nothing is exported by default. you have to ask nicely (aka import it yourself, iykyk).
π "get_constant_name_elements_from_declaring_statement($statement)"
okay so picture this: you hand it a PPI::Statement. if that statement is a Readonly or Const::Fast declaration statement, or a "use constant", then boom β it hands you back the names of the things being defined. β¨
Given this:
use constant 1.16 FOO => 'bar';
this will return the PPI::Token::Word containing 'FOO'. π
Given this:
use constant 1.16 { FOO => 'bar', 'BAZ' => 'burfle' };
this will return a list of the PPI::Tokens containing 'FOO' and 'BAZ'. two of them. a little squad. π«Ά
Similarly, given:
Readonly::Hash my %FOO => ( bar => 'baz' );
or:
const my %FOO => ( bar => 'baz' );
this will return the PPI::Token::Symbol containing '%FOO'. slay.
π BUGS AND LIMITATIONS π
not me having bugs π please report any bugs or feature requests to "bug-ppix-utilities@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. (no tables, no links, just vibes and a URL, bestie β that's the manpage way.)
π AUTHOR π
Thomas R. Wyant, III "<wyant at cpan dot org>" β the main character who wrote this fr fr π
π COPYRIGHT π
Copyright (c) 2009-2010 Thomas R. Wyant, III. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. periodt. π§
and that's the whole page bestie, brought to you by perl v5.36.0, dated 2022-11-27, from the PPIx::...tement(3pm) manual β go forth and parse some statements, you absolute icon πβ¨π
π¦ where this page comes from
- debian bookworm: libppix-utilities-perl 1.001000-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libppix-utilities-perl 1.001000-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libppix-utilities-perl 1.001000-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libppix-utilities-perl 1.001000-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libppix-utilities-perl 1.001000-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms