@@ -1961,30 +1961,30 @@ sub ST {
1961
1961
1962
1962
sub INPUT_handler {
1963
1963
my ExtUtils::ParseXS $self = shift ;
1964
- $_ = shift ;
1964
+ my $line = shift ;
1965
1965
1966
1966
# In this loop: process each line until the next keyword or end of
1967
1967
# paragraph.
1968
1968
1969
- for (; ! /^$BLOCK_regexp /o; $_ = shift (@{ $self -> {line } })) {
1969
+ for (; $line !~ / ^$BLOCK_regexp /o ; $line = shift (@{ $self -> {line } })) {
1970
1970
# treat NOT_IMPLEMENTED_YET as another block separator, in addition to
1971
1971
# $BLOCK_regexp.
1972
- last if / ^\s *NOT_IMPLEMENTED_YET/ ;
1973
- next unless / \S / ; # skip blank lines
1972
+ last if $line =~ / ^\s *NOT_IMPLEMENTED_YET/ ;
1973
+ next unless $line =~ / \S / ; # skip blank lines
1974
1974
1975
- trim_whitespace($_ );
1976
- my $ln = $_ ; # keep original line for error messages
1975
+ trim_whitespace($line );
1976
+ my $orig_line = $line ; # keep original line for error messages
1977
1977
1978
1978
# remove any trailing semicolon, except for initialisations
1979
- s /\s *;$// g unless / [=;+].*\S / ;
1979
+ $line =~ s /\s *;$// g unless $line =~ / [=;+].*\S / ;
1980
1980
1981
1981
# Extract optional initialisation code (which overrides the
1982
1982
# normal typemap), such as 'int foo = ($type)SvIV($arg)'
1983
1983
my $var_init = ' ' ;
1984
1984
my $init_op ;
1985
- ($init_op , $var_init ) = ($1 , $2 ) if s /\s * ([=;+]) \s * (.*) $// xs ;
1985
+ ($init_op , $var_init ) = ($1 , $2 ) if $line =~ s /\s * ([=;+]) \s * (.*) $// xs ;
1986
1986
1987
- s /\s +/ / g ;
1987
+ $line =~ s /\s +/ / g ;
1988
1988
1989
1989
# Split 'char * &foo' into ('char *', '&', 'foo')
1990
1990
# skip to next INPUT line if not valid.
@@ -2004,15 +2004,15 @@ sub INPUT_handler {
2004
2004
# int a XYZ;
2005
2005
2006
2006
my ($var_type , $var_addr , $var_name ) =
2007
- / ^
2007
+ $line =~ / ^
2008
2008
( .*? [^&\s ] ) # type
2009
2009
\s *
2010
2010
(\& ?) # addr
2011
2011
\s * \b
2012
2012
(\w + | length\(\w +\) ) # name or length(name)
2013
2013
$
2014
2014
/xs
2015
- or $self -> blurt(" Error: invalid parameter declaration '$ln '" ), next ;
2015
+ or $self -> blurt(" Error: invalid parameter declaration '$orig_line '" ), next ;
2016
2016
2017
2017
# length(s) is only allowed in the XSUB's signature.
2018
2018
if ($var_name =~ / ^length\( (\w +)\) $ / ) {
@@ -2143,6 +2143,8 @@ sub INPUT_handler {
2143
2143
$param -> as_code($self );
2144
2144
2145
2145
} # foreach line in INPUT block
2146
+
2147
+ $_ = $line ;
2146
2148
}
2147
2149
2148
2150
0 commit comments