MDOM::Token(3pm)

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

πŸ’– MDOM::Token β€” a whole manual page, bestie πŸ’–

Part of the User Contributed Perl Documentation collection, no cap ✨


🌸 NAME 🌸

MDOM::Token β€” literally just one single token of Makefile source code πŸ’…


πŸ¦‹ INHERITANCE πŸ¦‹

Okay so the family tree goes like this, bestie:

MDOM::Token
isa MDOM::Element

So yeah, MDOM::Token is a MDOM::Element. That's the vibe. 🫢


✨ DESCRIPTION ✨

So MDOM::Token is the abstract base class for all the Tokens. Abstract, meaning you don't just go around instantiating it yourself, bestie, it's the blueprint πŸ‘‘

In MDOM terms (iykyk), a Token is a MDOM::Element that directly represents bytes of source code. Like, it is the bytes. Main character energy fr fr. πŸ”₯

And a lil credit where credit is due: the implementation and the POD are borrowed directly from PPI::Token. We love an homage πŸ’–


πŸŽ€ METHODS πŸŽ€

πŸ’… set_class

Set a specific class for a token. That's it, that's the whole thing. Slay. ✨

πŸ“ set_content $string

The set_content method lets you set/change the string that the MDOM::Token object represents. Glow-up for your token, essentially. πŸ’–

Returns the string you set the Token to. 🫢

🌈 add_content $string

The add_content method lets you add additional bytes of code to the end of the Token. Like it's growing. Iconic. 🌱

Returns the new full string after the bytes have been added. Periodt. πŸ’…

πŸ¦‹ length

The length method returns the length of the string in a Token. Just the number, bestie. No drama. ⭐

πŸ‘‘ source

Returns the makefile source for the current token. The receipts. The origin story. πŸŽ€


Okay that's the whole page!! Mwah πŸ’‹ This one's from perl v5.34.0, dated 2022-06-15, and it lives in the MDOM::Token(3pm) section of the manual. Go forth and tokenize responsibly, bestie πŸ§šπŸ’œ

πŸ“¦ where this page comes from