line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
6
|
use Moops; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# PODNAME: MarpaX::Languages::M4::Impl::Macro |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: M4 Macro generic implementation |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
3136
|
class MarpaX::Languages::M4::Impl::Macro { |
|
1
|
|
|
1
|
|
44
|
|
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
76
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
306
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
61
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
82
|
|
|
1
|
|
|
|
|
32
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4837
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
467
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
195
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
80
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
203
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
941
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
2029
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
133
|
|
|
1
|
|
|
|
|
6652
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
|
|
14
|
our $VERSION = '0.019'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
3
|
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
480
|
use MarpaX::Languages::M4::Role::Macro; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
14
|
1
|
|
|
1
|
|
61
|
use MarpaX::Languages::M4::Type::Macro -all; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
15
|
1
|
|
|
1
|
|
885
|
use MooX::HandlesVia; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
16
|
1
|
|
|
1
|
|
140
|
use Types::Common::Numeric -all; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
5
|
has name => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => Str, |
21
|
|
|
|
|
|
|
required => 1 |
22
|
|
|
|
|
|
|
); |
23
|
1
|
|
|
|
|
2488
|
has stub => ( |
24
|
|
|
|
|
|
|
is => 'rw', |
25
|
|
|
|
|
|
|
isa => CodeRef, |
26
|
|
|
|
|
|
|
required => 1, |
27
|
|
|
|
|
|
|
handles_via => 'Code', |
28
|
|
|
|
|
|
|
handles => { macro_execute => 'execute' } |
29
|
|
|
|
|
|
|
); |
30
|
1
|
|
|
|
|
4901
|
has expansion => ( |
31
|
|
|
|
|
|
|
is => 'rw', |
32
|
|
|
|
|
|
|
isa => Undef | Str, |
33
|
|
|
|
|
|
|
required => 1 |
34
|
|
|
|
|
|
|
); |
35
|
1
|
|
|
|
|
1938
|
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
|
|
|
|
|
574244
|
{}; |
45
|
|
|
|
|
|
|
}, |
46
|
1
|
|
|
|
|
1390
|
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
|
|
|
|
|
114188
|
sub { return 0; } |
62
|
6843
|
|
|
|
|
295349
|
}, |
63
|
1
|
|
|
|
|
15006
|
handles_via => 'Code', |
64
|
|
|
|
|
|
|
handles => { macro_postMatchLengthExecute => 'execute' } |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
1
|
50
|
|
1
|
|
8509
|
method macro_name (--> Str) { |
|
1
|
50
|
|
4
|
|
4
|
|
|
1
|
|
|
|
|
191
|
|
|
1
|
|
|
|
|
2594
|
|
|
4
|
|
|
|
|
51
|
|
|
4
|
|
|
|
|
18
|
|
|
4
|
|
|
|
|
10
|
|
68
|
4
|
|
|
|
|
69
|
return $self->name; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
1
|
50
|
|
1
|
|
5223
|
method macro_expansion (--> Undef | Str) { |
|
1
|
50
|
|
62
|
|
4
|
|
|
1
|
|
|
|
|
170
|
|
|
1
|
|
|
|
|
2706
|
|
|
62
|
|
|
|
|
1083
|
|
|
62
|
|
|
|
|
180
|
|
|
62
|
|
|
|
|
122
|
|
72
|
62
|
|
|
|
|
918
|
return $self->expansion; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
1
|
50
|
|
1
|
|
2420
|
method macro_needParams (--> Bool ) { |
|
1
|
50
|
|
589
|
|
3
|
|
|
1
|
|
|
|
|
110
|
|
|
1
|
|
|
|
|
3440
|
|
|
589
|
|
|
|
|
6783
|
|
|
589
|
|
|
|
|
2170
|
|
|
589
|
|
|
|
|
940
|
|
76
|
589
|
|
|
|
|
10041
|
return $self->needParams; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
1
|
50
|
|
1
|
|
1524
|
method macro_isBuiltin (--> Bool) { |
|
1
|
50
|
|
81
|
|
3
|
|
|
1
|
|
|
|
|
134
|
|
|
1
|
|
|
|
|
2014
|
|
|
81
|
|
|
|
|
1749
|
|
|
81
|
|
|
|
|
278
|
|
|
81
|
|
|
|
|
132
|
|
80
|
81
|
|
|
|
|
278
|
return Undef->check( $self->expansion ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
1
|
50
|
|
1
|
|
2551
|
method macro_paramCanBeMacro (PositiveOrZeroInt $paramPos --> Bool) { |
|
1
|
50
|
|
17
|
|
2
|
|
|
1
|
50
|
|
|
|
156
|
|
|
1
|
50
|
|
|
|
7
|
|
|
1
|
50
|
|
|
|
2
|
|
|
1
|
|
|
|
|
149
|
|
|
1
|
|
|
|
|
1911
|
|
|
17
|
|
|
|
|
956
|
|
|
17
|
|
|
|
|
65
|
|
|
17
|
|
|
|
|
68
|
|
|
17
|
|
|
|
|
66
|
|
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
69
|
|
|
17
|
|
|
|
|
38
|
|
84
|
17
|
100
|
66
|
|
|
302
|
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
|
|
|
|
|
2421
|
return true; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
else { |
94
|
3
|
|
|
|
|
300
|
return false; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
1
|
50
|
|
1
|
|
2464
|
method macro_clone (Str $name --> M4Macro) { |
|
1
|
50
|
|
8
|
|
2
|
|
|
1
|
50
|
|
|
|
148
|
|
|
1
|
50
|
|
|
|
7
|
|
|
1
|
50
|
|
|
|
2
|
|
|
1
|
|
|
|
|
189
|
|
|
1
|
|
|
|
|
1904
|
|
|
8
|
|
|
|
|
103
|
|
|
8
|
|
|
|
|
42
|
|
|
8
|
|
|
|
|
40
|
|
|
8
|
|
|
|
|
37
|
|
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
38
|
|
|
8
|
|
|
|
|
22
|
|
99
|
8
|
|
|
|
|
150
|
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
|
|
|
|
|
2411
|
return $macro; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
1
|
|
|
|
|
2135
|
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.019 |
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 |