Revert "Allow ?IF, ?ELSE and ?ENDIF in copied files"

This reverts commit 29dd342118.
This commit is contained in:
Tom Eastep 2012-03-19 07:23:24 -07:00
parent c7237e5c8e
commit d4a1e7dba9

View File

@ -1601,15 +1601,6 @@ sub copy( $ ) {
} }
} }
unless( $save_ifstack == @ifstack ) {
my $lastref = $ifstack[-1];
$currentlinenumber = 'EOF';
$currentfilename = $file;
fatal_error qq(Missing "?END" to match ?IF at line number $lastref->[2])
}
$ifstack = $save_ifstack;
close IF; close IF;
} }
} }
@ -1624,7 +1615,7 @@ sub copy1( $ ) {
if ( $script || $debug ) { if ( $script || $debug ) {
my ( $do_indent, $here_documents ) = ( 1, ''); my ( $do_indent, $here_documents ) = ( 1, '');
my $save_ifstack = $ifstack;
open_file( $_[0] ); open_file( $_[0] );
while ( $currentfile ) { while ( $currentfile ) {
@ -1633,13 +1624,6 @@ sub copy1( $ ) {
chomp; chomp;
if ( /^\s*\?(IF\s+|ELSE|ENDIF)(.*)$/ ) {
$omitting = process_conditional( $omitting, $1, $2 );
next;
}
next if $omitting;
if ( /^${here_documents}\s*$/ ) { if ( /^${here_documents}\s*$/ ) {
if ( $script ) { if ( $script ) {
print $script $here_documents if $here_documents; print $script $here_documents if $here_documents;
@ -1722,15 +1706,6 @@ sub copy1( $ ) {
} }
} }
unless( $save_ifstack == @ifstack ) {
my $lastref = $ifstack[-1];
$currentlinenumber = 'EOF';
$currentfilename = $_[0];
fatal_error qq(Missing "?END" to match ?IF at line number $lastref->[2])
}
$ifstack = $save_ifstack;
close_file; close_file;
} }
} }
@ -1759,8 +1734,6 @@ sub copy2( $$ ) {
} }
unless ( $empty ) { unless ( $empty ) {
my $save_ifstack = $ifstack;
emit <<EOF; emit <<EOF;
################################################################################ ################################################################################
# Functions imported from $file # Functions imported from $file
@ -1770,15 +1743,7 @@ EOF
emit( $_ ) unless /^\s*$/; emit( $_ ) unless /^\s*$/;
while ( <IF> ) { while ( <IF> ) {
if ( /^\s*\?(IF\s+|ELSE|ENDIF)(.*)$/ ) {
$omitting = process_conditional( $omitting, $1, $2 );
next;
}
next if $omitting;
chomp; chomp;
if ( /^\s*$/ ) { if ( /^\s*$/ ) {
unless ( $lastlineblank ) { unless ( $lastlineblank ) {
print $script "\n" if $script; print $script "\n" if $script;
@ -1806,15 +1771,6 @@ EOF
} }
} }
unless( $save_ifstack == @ifstack ) {
my $lastref = $ifstack[-1];
$currentlinenumber = 'EOF';
$currentfilename = $file;
fatal_error qq(Missing "?END" to match ?IF at line number $lastref->[2])
}
$ifstack = $save_ifstack;
close IF; close IF;
unless ( $lastlineblank ) { unless ( $lastlineblank ) {