Skip to content

Commit df71d29

Browse files
committed
ParseXS: refactor: remove print_section()
This method is no longer used anywhere
1 parent 4ccada0 commit df71d29

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

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

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,7 @@ EOF
833833
EOF
834834
}
835835

836-
# Emit any lines derived from BOOT: sections. By putting the lines back
837-
# into $self->{line} and passing them through print_section(),
838-
# a trailing '#line' may be emitted to effect the change back to the
839-
# current foo.c line from the foo.xs part where the BOOT: code was.
836+
# Emit any lines derived from BOOT: sections
840837

841838
if (@{ $self->{bootcode_later} }) {
842839
print "\n /* Initialisation Section */\n\n";
@@ -909,41 +906,6 @@ sub check_keyword {
909906
}
910907

911908

912-
# Emit, verbatim(ish), all the lines up till the next directive.
913-
# Typically used for sections that have blocks of code, like CODE. Return
914-
# a string which contains all the lines of code emitted except for the
915-
# extra '#line' type stuff.
916-
917-
sub print_section {
918-
my ExtUtils::ParseXS $self = shift;
919-
920-
# Strip leading blank lines. The "do" is required for the right semantics
921-
do { $_ = shift(@{ $self->{line} }) } while !/\S/ && @{ $self->{line} };
922-
923-
my $consumed_code = '';
924-
925-
# Add a '#line' if needed. The XSubPPtmp test is a bit of a hack - it
926-
# skips synthetic blocks added to boot etc which may not have line
927-
# numbers.
928-
print("#line ", $self->{line_no}->[@{ $self->{line_no} } - @{ $self->{line} } -1], " \"",
929-
escape_file_for_line_directive($self->{in_pathname}), "\"\n")
930-
if $self->{config_WantLineNumbers}
931-
&& !/^\s*#\s*line\b/ && !/^#if XSubPPtmp/;
932-
933-
# Emit lines until the next directive
934-
for (; defined($_) && !/^$BLOCK_regexp/o; $_ = shift(@{ $self->{line} })) {
935-
print "$_\n";
936-
$consumed_code .= "$_\n";
937-
}
938-
939-
# Emit a "restoring" '#line'
940-
print 'ExtUtils::ParseXS::CountLines'->end_marker, "\n"
941-
if $self->{config_WantLineNumbers};
942-
943-
return $consumed_code;
944-
}
945-
946-
947909
# Handle BOOT: keyword.
948910
# Save all the remaining lines in the paragraph to the bootcode_later
949911
# array, and prepend a '#line' if necessary.

0 commit comments

Comments
 (0)