1PPIx::Regexp::Token::CoUdsee(r3)Contributed Perl DocumenPtPaItxi:o:nRegexp::Token::Code(3)
2
3
4
6 PPIx::Regexp::Token::Code - Represent a chunk of Perl embedded in a
7 regular expression.
8
10 use PPIx::Regexp::Dumper;
11 PPIx::Regexp::Dumper->new(
12 'qr{(?{print "hello sailor\n"})}smx')->print;
13
15 "PPIx::Regexp::Token::Code" is a PPIx::Regexp::Token.
16
17 "PPIx::Regexp::Token::Code" is the parent of
18 PPIx::Regexp::Token::Interpolation.
19
21 This class represents a chunk of Perl code embedded in a regular
22 expression. Specifically, it results from parsing things like
23
24 (?{ code })
25 (??{ code })
26
27 or from the replacement side of an s///e. Technically, interpolations
28 are also code, but they parse differently and therefore end up in a
29 different token.
30
31 This token may not appear inside a regex set (i.e. "(?[ ... ])". If
32 found, it will become a "PPIx::Regexp::Token::Unknown".
33
35 This class provides the following public methods. Methods not
36 documented here are private, and unsupported in the sense that the
37 author reserves the right to change or remove them without notice.
38
39 is_matcher
40 This method returns "undef" because a static analysis can not in
41 general tell whether an interpolated value matches anything.
42
43 ppi
44 This convenience method returns the PPI::Document representing the
45 content. This document should be considered read only.
46
47 Note that if the location of the invocant is available the PPI document
48 will have stuff prefixed to it to make the location of the tokens in
49 the new document consistent with the location. This "stuff" will
50 include at least a "#line" directive, and maybe leading white space.
51
53 Support is by the author. Please file bug reports at
54 <https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-Regexp>,
55 <https://github.com/trwyant/perl-PPIx-Regexp/issues>, or in electronic
56 mail to the author.
57
59 Thomas R. Wyant, III wyant at cpan dot org
60
62 Copyright (C) 2009-2021 by Thomas R. Wyant, III
63
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl 5.10.0. For more details, see the full
66 text of the licenses in the directory LICENSES.
67
68 This program is distributed in the hope that it will be useful, but
69 without any warranty; without even the implied warranty of
70 merchantability or fitness for a particular purpose.
71
72
73
74perl v5.34.0 2021-10-25 PPIx::Regexp::Token::Code(3)