MDOM::...omment(3pm)

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

πŸ’¬ MDOM::Token::Comment πŸ’¬

ok bestie, so this is MDOM::...omment(3pm) β€” a User Contributed Perl Documentation page, and it's literally all about MDOM::Token::Comment, aka A comment in Makefile source code. yes. a whole module. for comments. and honestly? iconic. πŸ’…


🌸 INHERITANCE 🌸

the family tree goes like this, no cap:

MDOM::Token::Comment
isa MDOM::Token
    isa MDOM::Element

so it inherits from MDOM::Token, which itself inherits from MDOM::Element. generational excellence fr fr 🫢


✨ SYNOPSIS ✨

peep this:

# This is a MDOM::Token::Comment

foo: bar # So is this one
      echo 'hello'

two comments, two whole vibes, one module. slay. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

so in MDOM, comments get represented by MDOM::Token::Comment objects. that's the whole thing. comments are objects now. we love an object-oriented comment era. 🌈

these come in two flavours, and you will be picking a side:

  • a line comment is a comment that stands on its own line. these comments hold their own newline and their own whitespace β€” both leading and trailing β€” as part of the one single MDOM::Token::Comment object. it's self-sufficient. it's giving main character energy. πŸ‘‘
  • an inline comment is a comment that appears after some code, and continues to the end of the line. this one does not include whitespace, and the terminating newline is considered a separate MDOM::Token::Whitespace token. it's a lil guy that doesn't carry its own baggage. πŸ™ˆ

this is largely a convenience, bestie β€” it simplifies a lot of normal code relating to the common things people do with comments.

most commonly, it means when you "prune" or "delete" a comment:

  • a line comment disappears taking the entire line with it (dramatic exit, honestly valid πŸ’€)
  • an inline comment is removed from the inside of the line, which lets the newline drop back onto the end of the code, exactly as you would expect ✨

it also means you can move comments around in blocks much more easily. chef's kiss.

for now, this is a suitably handy way to do things. however, the author does reserve the right to change their mind on this one if it gets dangerously anachronistic somewhere down the line. so like… noted. don't get too attached. 😭


πŸŽ€ METHODS πŸŽ€

only very limited methods are available here, beyond those provided by our parent MDOM::Token and MDOM::Element classes. it's a small menu. but it's a good menu.

πŸ¦‹ line

the line accessor returns true if the MDOM::Token::Comment is a line comment, or false if it is an inline comment. one method, one job, and it ate. πŸ”₯


🫢 SUPPORT 🫢

see the support section in the main module. (go check it out, bestie, the answers are there i promise)


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>


Copyright 2001 - 2006 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

the full text of the license can be found in the LICENSE file included with this module.


ok that's the whole page!! periodt. πŸ’…

and a lil sign-off for the footer, since you deserve the deets: this was rendered by perl v5.34.0 on 2022-06-15, and yeah, the manual page is literally named MDOM::...omment(3pm) because apparently even the filename wanted to keep it cute and abbreviated. anyway love u, go read your comments bestie πŸŒΈπŸ’–

πŸ“¦ where this page comes from