1MDOM::Token::Comment(3)User Contributed Perl DocumentatioMnDOM::Token::Comment(3)
2
3
4
6 MDOM::Token::Comment - A comment in Makefile source code
7
9 MDOM::Token::Comment
10 isa MDOM::Token
11 isa MDOM::Element
12
14 # This is a MDOM::Token::Comment
15
16 foo: bar # So is this one
17 echo 'hello'
18
20 In MDOM, comments are represented by "MDOM::Token::Comment" objects.
21
22 These come in two flavours, line comment and inline comments.
23
24 A "line comment" is a comment that stands on its own line. These
25 comments hold their own newline and whitespace (both leading and
26 trailing) as part of the one "MDOM::Token::Comment" object.
27
28 An inline comment is a comment that appears after some code, and
29 continues to the end of the line. This does not include whitespace, and
30 the terminating newlines is considered a separate
31 MDOM::Token::Whitespace token.
32
33 This is largely a convenience, simplifying a lot of normal code
34 relating to the common things people do with comments.
35
36 Most commonly, it means when you "prune" or "delete" a comment, a line
37 comment disappears taking the entire line with it, and an inline
38 comment is removed from the inside of the line, allowing the newline to
39 drop back onto the end of the code, as you would expect.
40
41 It also means you can move comments around in blocks much more easily.
42
43 For now, this is a suitably handy way to do things. However, I do
44 reserve the right to change my mind on this one if it gets dangerously
45 anachronistic somewhere down the line.
46
48 Only very limited methods are available, beyond those provided by our
49 parent MDOM::Token and MDOM::Element classes.
50
51 line
52 The "line" accessor returns true if the "MDOM::Token::Comment" is a
53 line comment, or false if it is an inline comment.
54
56 See the support section in the main module.
57
59 Adam Kennedy <adamk@cpan.org>
60
62 Copyright 2001 - 2006 Adam Kennedy.
63
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.
66
67 The full text of the license can be found in the LICENSE file included
68 with this module.
69
70
71
72perl v5.36.0 2023-01-20 MDOM::Token::Comment(3)