Pegex:...e::Wrap(3pm)
π Pegex::Tree::Wrap π
okay bestie, so you know the manual page for Pegex::Tree::Wrap β that's the Perl module doc we're vibing with here, part of the User Contributed Perl Documentation collection β¨
β¨ NAME β¨
Pegex::Tree::Wrap β it's giving Pegex Wrapper Parse Tree Receiver π
πΈ SYNOPSIS πΈ
use Pegex;
$tree = pegex($grammar, 'Pegex::Tree::Wrap')->parse($input);
like, that's the whole vibe. three lines. iconic. π
π¦ DESCRIPTION π¦
okay so listen. Pegex::Tree::Wrap is a receiver class β and what it does is it takes the captured data from a Pegex parse operation and shapes it into a tree made out of hashes. π
the keys of those hashes? they're the rule names that matched. and the values? arrays of captured data. so it's just likeβ¦ { rule_name => [stuff, stuff, stuff] } all the way down, and honestly? obsessed. π
ngl, this module is not often used as a receiver base class β but here's the tea: it is the default receiver for a Pegex parse. periodt. π
and the reason why is lowkey so cute β it's because the tree is very readable with all the rule keys sitting right there in it. you can just look at it and know what happened. main character energy fr fr. π
β SEE ALSO β
Pegex::ReceiverPegex::Tree
go read those too bestie, they're the supporting cast π«Ά
π AUTHOR π
Ingy dΓΆt Net <ingy@cpan.org> β the actual legend behind this π
π COPYRIGHT AND LICENSE π
Copyright 2010-2020. Ingy dΓΆt Net.
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>
okay so real talk β that license bit means it's free software, you can redistribute it and/or modify it, but you gotta keep the same terms as Perl itself. and there's a link there if you wanna read the whole Artistic thing. do it. iykyk. π
and that's a wrap on the wrap module bestie!! πβ¨ this page was served up by perl v5.36.0 on 2022-11-19, and the whole thing is filed under Pegex:...e::Wrap(3pm) β slay, bye!! ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: libpegex-perl 0.75-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpegex-perl 0.75-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpegex-perl 0.75-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpegex-perl 0.75-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpegex-perl 0.75-2 Β· 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