PPIx::...edBrace(3pm)

πŸ“¦
version 0.21 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute

✨ NAME ✨

ok so bestie, welcome to the manual page for PPIx::...edBrace(3pm) πŸ’… β€” the super cute <pink>User Contributed Perl Documentation</pink> page all about PPIx::EditorTools::FindUnmatchedBrace, aka your personal PPI-based unmatched-brace-finder. it literally finds the braces you forgot to close. iconic behaviour tbh πŸŽ€


🌸 VERSION 🌸

this is version 0.21 ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the vibe, copy-paste girlies:

  my $brace = PPIx::EditorTools::FindUnmatchedBrace->new->find(
        code => "package TestPackage;\nsub x { 1;\n"
      );
  my $location = $brace->element->location;

like. look at her go. πŸ’–


πŸ’œ DESCRIPTION πŸ’œ

she finds the location of unmatched braces in a PPI::Document. that's it. that's the whole job. and she eats every single time πŸ”₯


πŸŽ€ METHODS πŸŽ€

new()

the constructor, bestie. the birth of the whole operation ✨

Generally shouldn't be called with any arguments. like, please don't. she doesn't need your baggage. πŸ™ˆ

find( ppi => PPI::Document $ppi )

find( code => Str $code )

ok so this one accepts either:

  • a PPI::Document to process, passed as ppi β€” or
  • a string containing the code, passed as code (which gets converted into a PPI::Document for you, no extra work required, we love a helpful queen πŸ‘‘)

and then? she finds the location of unmatched braces. fr fr. 🧚

she returns a PPIx::EditorTools::ReturnObject with the unmatched brace β€” which is a PPI::Structure::Block β€” available via the element accessor. so $thing->element and you're living your main character moment. 🌈

and if there is no unmatched brace? she returns undef. nothing. silence. a peaceful, balanced, brace-having file πŸ’€βœ¨


πŸ’– SEE ALSO πŸ’–

  • this class inherits from PPIx::EditorTools β€” she got it from her mama 🫢
  • also go check out App::EditorTools, Padre, and PPI β€” the whole friend group, no cap ⭐

πŸ‘‘ AUTHORS πŸ‘‘

the legends themselves, in order:

  • Steffen Mueller "smueller@cpan.org"
  • Mark Grimes "mgrimes@cpan.org"
  • Ahmad M. Zawawi <ahmad.zawawi@gmail.com>
  • Gabor Szabo <gabor@szabgab.com>
  • Yanick Champoux <yanick@cpan.org>

we stan every single one πŸ’…πŸŒΈ


This software is copyright (c) 2017, 2014, 2012 by The Padre development team as listed in Padre.pm..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go off, remix her, just keep the same energy periodt πŸ’–


and that's the whole page, bestie πŸŽ€ this lil masterpiece is from perl v5.34.0, dated 2022-06-17, and it lives in the <rainbow>PPIx::...edBrace(3pm)</rainbow> corner of your man pages. mwah. go close those braces. πŸ’‹βœ¨

πŸ“¦ where this page comes from