Skip to content

Commit 6e5771d

Browse files
committed
ParseXS: refactor: remove cur_xsub/xbody fields
Currently all the Node::FOO::as_code() methods get passed two args, $xsub and xbody, to indicate the current Node::xsub and Node::xbody objects. Conversely, all the Node::FOO::parse() methods access the current two objects via two 'global' fields in the ExtUtils:;ParseXS object: cur_xsub cur_xbody This commit deletes these two fields and instead passes the objects as extra parameters to all the parse() methods. Less action-at-a-distance.
1 parent 80141c2 commit 6e5771d

File tree

2 files changed

+171
-128
lines changed

2 files changed

+171
-128
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ BEGIN {
231231

232232
# Per-XSUB parsing state:
233233

234-
'cur_xsub', # The Node::xsub currently being parsed
235-
236-
'cur_xbody', # The Node::xbody currently being parsed
237-
238234
'file_SCOPE_enabled', # Bool: the current state of the file-scope
239235
# (as opposed to
240236
# XSUB-scope) SCOPE keyword
@@ -631,11 +627,9 @@ EOM
631627

632628
unshift @{$self->{line}}, $_;
633629
my $xsub = ExtUtils::ParseXS::Node::xsub->new();
634-
$self->{cur_xsub} = $xsub;
635630
$xsub->parse($self)
636631
or next PARAGRAPH;
637632
$_ = shift @{$self->{line}};
638-
undef $self->{cur_xsub};
639633

640634
$xsub->as_code($self);
641635
$self->{seen_an_XSUB} = 1; # encountered at least one XSUB

0 commit comments

Comments
 (0)