Pegex:...e::Wrap(3pm)

πŸ“¦
version 0.75 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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::Receiver
  • Pegex::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 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