line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
6
|
use Moops; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# PODNAME: MarpaX::Languages::M4::Impl::Macro |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: M4 Macro generic implementation |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
2665
|
class MarpaX::Languages::M4::Impl::Macro { |
|
1
|
|
|
1
|
|
26
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
47
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
239
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
56
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
74
|
|
|
1
|
|
|
|
|
30
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4386
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
320
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
115
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
61
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
168
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
722
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
1807
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
|
1
|
|
|
|
|
5846
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
|
|
11
|
our $VERSION = '0.018'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
3
|
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
267
|
use MarpaX::Languages::M4::Role::Macro; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
14
|
1
|
|
|
1
|
|
39
|
use MarpaX::Languages::M4::Type::Macro -all; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
15
|
1
|
|
|
1
|
|
762
|
use MooX::HandlesVia; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
16
|
1
|
|
|
1
|
|
93
|
use Types::Common::Numeric -all; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
4
|
has name => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => Str, |
21
|
|
|
|
|
|
|
required => 1 |
22
|
|
|
|
|
|
|
); |
23
|
1
|
|
|
|
|
1794
|
has stub => ( |
24
|
|
|
|
|
|
|
is => 'rw', |
25
|
|
|
|
|
|
|
isa => CodeRef, |
26
|
|
|
|
|
|
|
required => 1, |
27
|
|
|
|
|
|
|
handles_via => 'Code', |
28
|
|
|
|
|
|
|
handles => { macro_execute => 'execute' } |
29
|
|
|
|
|
|
|
); |
30
|
1
|
|
|
|
|
3717
|
has expansion => ( |
31
|
|
|
|
|
|
|
is => 'rw', |
32
|
|
|
|
|
|
|
isa => Undef | Str, |
33
|
|
|
|
|
|
|
required => 1 |
34
|
|
|
|
|
|
|
); |
35
|
1
|
|
|
|
|
1901
|
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
|
|
|
|
|
531324
|
{}; |
45
|
|
|
|
|
|
|
}, |
46
|
1
|
|
|
|
|
1299
|
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
|
|
|
|
|
100818
|
sub { return 0; } |
62
|
6843
|
|
|
|
|
269211
|
}, |
63
|
1
|
|
|
|
|
11584
|
handles_via => 'Code', |
64
|
|
|
|
|
|
|
handles => { macro_postMatchLengthExecute => 'execute' } |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
1
|
50
|
|
1
|
|
7114
|
method macro_name (--> Str) { |
|
1
|
50
|
|
4
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
|
1
|
|
|
|
|
2101
|
|
|
4
|
|
|
|
|
41
|
|
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
7
|
|
68
|
4
|
|
|
|
|
57
|
return $self->name; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
1
|
50
|
|
1
|
|
2696
|
method macro_expansion (--> Undef | Str) { |
|
1
|
50
|
|
62
|
|
2
|
|
|
1
|
|
|
|
|
76
|
|
|
1
|
|
|
|
|
2095
|
|
|
62
|
|
|
|
|
916
|
|
|
62
|
|
|
|
|
193
|
|
|
62
|
|
|
|
|
372
|
|
72
|
62
|
|
|
|
|
836
|
return $self->expansion; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
1
|
50
|
|
1
|
|
1367
|
method macro_needParams (--> Bool ) { |
|
1
|
50
|
|
589
|
|
2
|
|
|
1
|
|
|
|
|
83
|
|
|
1
|
|
|
|
|
3004
|
|
|
589
|
|
|
|
|
5888
|
|
|
589
|
|
|
|
|
1710
|
|
|
589
|
|
|
|
|
972
|
|
76
|
589
|
|
|
|
|
8962
|
return $self->needParams; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
1
|
50
|
|
1
|
|
1378
|
method macro_isBuiltin (--> Bool) { |
|
1
|
50
|
|
81
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
|
1
|
|
|
|
|
1861
|
|
|
81
|
|
|
|
|
1357
|
|
|
81
|
|
|
|
|
271
|
|
|
81
|
|
|
|
|
120
|
|
80
|
81
|
|
|
|
|
254
|
return Undef->check( $self->expansion ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
1
|
50
|
|
1
|
|
2284
|
method macro_paramCanBeMacro (PositiveOrZeroInt $paramPos --> Bool) { |
|
1
|
50
|
|
17
|
|
2
|
|
|
1
|
50
|
|
|
|
121
|
|
|
1
|
50
|
|
|
|
5
|
|
|
1
|
50
|
|
|
|
3
|
|
|
1
|
|
|
|
|
151
|
|
|
1
|
|
|
|
|
1783
|
|
|
17
|
|
|
|
|
878
|
|
|
17
|
|
|
|
|
64
|
|
|
17
|
|
|
|
|
53
|
|
|
17
|
|
|
|
|
52
|
|
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
62
|
|
|
17
|
|
|
|
|
31
|
|
84
|
17
|
100
|
66
|
|
|
273
|
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
|
|
|
|
|
2085
|
return true; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
else { |
94
|
3
|
|
|
|
|
274
|
return false; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
1
|
50
|
|
1
|
|
2121
|
method macro_clone (Str $name --> M4Macro) { |
|
1
|
50
|
|
8
|
|
1
|
|
|
1
|
50
|
|
|
|
117
|
|
|
1
|
50
|
|
|
|
5
|
|
|
1
|
50
|
|
|
|
2
|
|
|
1
|
|
|
|
|
158
|
|
|
1
|
|
|
|
|
1851
|
|
|
8
|
|
|
|
|
92
|
|
|
8
|
|
|
|
|
34
|
|
|
8
|
|
|
|
|
33
|
|
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
32
|
|
|
8
|
|
|
|
|
15
|
|
99
|
8
|
|
|
|
|
124
|
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
|
|
|
|
|
2446
|
return $macro; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
1
|
|
|
|
|
1922
|
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.018 |
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 |