line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
7
|
use Moops; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# PODNAME: MarpaX::Languages::M4::Impl::Macro |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: M4 Macro generic implementation |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
2922
|
class MarpaX::Languages::M4::Impl::Macro { |
|
1
|
|
|
1
|
|
25
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
296
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
65
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
|
1
|
|
|
|
|
30
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4620
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
407
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
142
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
75
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
212
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
|
1
|
|
|
|
|
965
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2019
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
131
|
|
|
1
|
|
|
|
|
6045
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
|
|
11
|
our $VERSION = '0.020'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
3
|
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
424
|
use MarpaX::Languages::M4::Role::Macro; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
14
|
1
|
|
|
1
|
|
47
|
use MarpaX::Languages::M4::Type::Macro -all; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
15
|
1
|
|
|
1
|
|
776
|
use MooX::HandlesVia; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
16
|
1
|
|
|
1
|
|
115
|
use Types::Common::Numeric -all; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
5
|
has name => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => Str, |
21
|
|
|
|
|
|
|
required => 1 |
22
|
|
|
|
|
|
|
); |
23
|
1
|
|
|
|
|
2157
|
has stub => ( |
24
|
|
|
|
|
|
|
is => 'rw', |
25
|
|
|
|
|
|
|
isa => CodeRef, |
26
|
|
|
|
|
|
|
required => 1, |
27
|
|
|
|
|
|
|
handles_via => 'Code', |
28
|
|
|
|
|
|
|
handles => { macro_execute => 'execute' } |
29
|
|
|
|
|
|
|
); |
30
|
1
|
|
|
|
|
4178
|
has expansion => ( |
31
|
|
|
|
|
|
|
is => 'rw', |
32
|
|
|
|
|
|
|
isa => Undef | Str, |
33
|
|
|
|
|
|
|
required => 1 |
34
|
|
|
|
|
|
|
); |
35
|
1
|
|
|
|
|
1719
|
has needParams => ( |
36
|
|
|
|
|
|
|
is => 'rw', |
37
|
|
|
|
|
|
|
isa => Bool, |
38
|
|
|
|
|
|
|
default => false |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
has paramCanBeMacro => ( |
41
|
|
|
|
|
|
|
is => 'rw', |
42
|
|
|
|
|
|
|
isa => HashRef [ PositiveOrZeroInt | Enum [qw/*/] ], |
43
|
|
|
|
|
|
|
default => sub { |
44
|
6843
|
|
|
|
|
579395
|
{}; |
45
|
|
|
|
|
|
|
}, |
46
|
1
|
|
|
|
|
1281
|
handles_via => 'Hash', |
47
|
|
|
|
|
|
|
handles => { |
48
|
|
|
|
|
|
|
_paramCanBeMacro_get => 'get', |
49
|
|
|
|
|
|
|
_paramCanBeMacro_exists => 'exists', |
50
|
|
|
|
|
|
|
# |
51
|
|
|
|
|
|
|
# We do not hold references in values, so shallow_clone |
52
|
|
|
|
|
|
|
# is a real clone |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
_paramCanBeMacro_clone => 'shallow_clone' |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
has postMatchLength => ( |
58
|
|
|
|
|
|
|
is => 'rw', |
59
|
|
|
|
|
|
|
isa => CodeRef, |
60
|
|
|
|
|
|
|
default => sub { |
61
|
2310
|
|
|
|
|
118482
|
sub { return 0; } |
62
|
6843
|
|
|
|
|
291733
|
}, |
63
|
1
|
|
|
|
|
12249
|
handles_via => 'Code', |
64
|
|
|
|
|
|
|
handles => { macro_postMatchLengthExecute => 'execute' } |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
1
|
50
|
|
1
|
|
7339
|
method macro_name (--> Str) { |
|
1
|
50
|
|
4
|
|
3
|
|
|
1
|
|
|
|
|
100
|
|
|
1
|
|
|
|
|
2199
|
|
|
4
|
|
|
|
|
57
|
|
|
4
|
|
|
|
|
21
|
|
|
4
|
|
|
|
|
10
|
|
68
|
4
|
|
|
|
|
88
|
return $self->name; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
1
|
50
|
|
1
|
|
2764
|
method macro_expansion (--> Undef | Str) { |
|
1
|
50
|
|
62
|
|
2
|
|
|
1
|
|
|
|
|
82
|
|
|
1
|
|
|
|
|
2168
|
|
|
62
|
|
|
|
|
1127
|
|
|
62
|
|
|
|
|
241
|
|
|
62
|
|
|
|
|
146
|
|
72
|
62
|
|
|
|
|
1018
|
return $self->expansion; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
1
|
50
|
|
1
|
|
1374
|
method macro_needParams (--> Bool ) { |
|
1
|
50
|
|
589
|
|
5
|
|
|
1
|
|
|
|
|
83
|
|
|
1
|
|
|
|
|
3255
|
|
|
589
|
|
|
|
|
7550
|
|
|
589
|
|
|
|
|
2153
|
|
|
589
|
|
|
|
|
1411
|
|
76
|
589
|
|
|
|
|
10329
|
return $self->needParams; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
1
|
50
|
|
1
|
|
1388
|
method macro_isBuiltin (--> Bool) { |
|
1
|
50
|
|
81
|
|
1
|
|
|
1
|
|
|
|
|
92
|
|
|
1
|
|
|
|
|
1927
|
|
|
81
|
|
|
|
|
1870
|
|
|
81
|
|
|
|
|
362
|
|
|
81
|
|
|
|
|
157
|
|
80
|
81
|
|
|
|
|
390
|
return Undef->check( $self->expansion ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
1
|
50
|
|
1
|
|
2367
|
method macro_paramCanBeMacro (PositiveOrZeroInt $paramPos --> Bool) { |
|
1
|
50
|
|
17
|
|
5
|
|
|
1
|
50
|
|
|
|
129
|
|
|
1
|
50
|
|
|
|
6
|
|
|
1
|
50
|
|
|
|
2
|
|
|
1
|
|
|
|
|
139
|
|
|
1
|
|
|
|
|
1860
|
|
|
17
|
|
|
|
|
1008
|
|
|
17
|
|
|
|
|
95
|
|
|
17
|
|
|
|
|
71
|
|
|
17
|
|
|
|
|
65
|
|
|
17
|
|
|
|
|
40
|
|
|
17
|
|
|
|
|
68
|
|
|
17
|
|
|
|
|
35
|
|
84
|
17
|
100
|
66
|
|
|
362
|
if (( $self->_paramCanBeMacro_exists($paramPos) |
|
|
|
66
|
|
|
|
|
|
|
|
100
|
|
|
|
|
85
|
|
|
|
|
|
|
&& $self->_paramCanBeMacro_get($paramPos) |
86
|
|
|
|
|
|
|
) |
87
|
|
|
|
|
|
|
|| ( $self->_paramCanBeMacro_exists('*') |
88
|
|
|
|
|
|
|
&& $self->_paramCanBeMacro_get('*') ) |
89
|
|
|
|
|
|
|
) |
90
|
|
|
|
|
|
|
{ |
91
|
14
|
|
|
|
|
2521
|
return true; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
else { |
94
|
3
|
|
|
|
|
296
|
return false; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
1
|
50
|
|
1
|
|
2265
|
method macro_clone (Str $name --> M4Macro) { |
|
1
|
50
|
|
8
|
|
3
|
|
|
1
|
50
|
|
|
|
136
|
|
|
1
|
50
|
|
|
|
6
|
|
|
1
|
50
|
|
|
|
2
|
|
|
1
|
|
|
|
|
184
|
|
|
1
|
|
|
|
|
1853
|
|
|
8
|
|
|
|
|
109
|
|
|
8
|
|
|
|
|
33
|
|
|
8
|
|
|
|
|
34
|
|
|
8
|
|
|
|
|
37
|
|
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
35
|
|
|
8
|
|
|
|
|
17
|
|
99
|
8
|
|
|
|
|
139
|
my $macro = __PACKAGE__->new( |
100
|
|
|
|
|
|
|
name => $name, |
101
|
|
|
|
|
|
|
stub => $self->stub, |
102
|
|
|
|
|
|
|
needParams => $self->needParams, |
103
|
|
|
|
|
|
|
# |
104
|
|
|
|
|
|
|
# Cloning a builtin is a builtin |
105
|
|
|
|
|
|
|
# |
106
|
|
|
|
|
|
|
expansion => $self->expansion, |
107
|
|
|
|
|
|
|
# |
108
|
|
|
|
|
|
|
# No need of clone: the hash is ro once created |
109
|
|
|
|
|
|
|
# |
110
|
|
|
|
|
|
|
paramCanBeMacro => $self->_paramCanBeMacro_clone, |
111
|
|
|
|
|
|
|
postMatchLength => $self->postMatchLength |
112
|
|
|
|
|
|
|
); |
113
|
|
|
|
|
|
|
|
114
|
8
|
|
|
|
|
2666
|
return $macro; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
1
|
|
|
|
|
2054
|
with 'MarpaX::Languages::M4::Role::Macro'; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
1; |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
__END__ |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=pod |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=encoding UTF-8 |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 NAME |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
MarpaX::Languages::M4::Impl::Macro - M4 Macro generic implementation |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 VERSION |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
version 0.020 |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 AUTHOR |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Jean-Damien Durand <jeandamiendurand@free.fr> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jean-Damien Durand. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
145
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=cut |