$tok_is_blank = 1;
+ # note: an id with a leading '&' does not actually come this way
if ( $identifier =~ /^[\$\%\*\&\@]/ ) {
if ( length($identifier) > 1 ) {
}
else {
+ # fix c139: trim line-ending type 't'
+ if ( $i == $max_token_index ) {
+ $i = $i_save;
+ $type = 't';
+ last;
+ }
+
# spaces after $'s are common, and space after @
# is harmless, so only complain about space
# after other type characters. Space after $ and
}
}
- # else:
- # space after '->' is ok
+ elsif ( $identifier eq '->' ) {
+
+ # space after '->' is ok except at line end ..
+ # so trim line-ending in type '->' (fixes c139)
+ if ( $i == $max_token_index ) {
+ $i = $i_save;
+ $type = '->';
+ last;
+ }
+ }
}
elsif ( $tok eq '^' ) {
}
elsif ( $tok =~ /^\s*$/ ) { # allow space
$tok_is_blank = 1;
+
+ # fix c139: trim line-ending type 't'
+ if ( length($identifier) == 1 && $i == $max_token_index ) {
+ $i = $i_save;
+ $type = 't';
+ last;
+ }
}
elsif ( $tok eq '::' ) { # leading ::
$id_scan_state = 'A'; # accept alpha next
--- /dev/null
+# The '&' has trailing spaces
+@l = &
+_
+( -49, -71 );
+
+# This '$' has trailing spaces
+my $
+b = 40;
+
+# this arrow has trailing spaces
+$r = $c->
+sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
+
+# spaces and blank line
+@l = &
+
+_
+( -49, -71 );
+
+# spaces and blank line
+$r = $c->
+
+sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
--- /dev/null
+# The '&' has trailing spaces
+@l = &_( -49, -71 );
+
+# This '$' has trailing spaces
+my $b = 40;
+
+# this arrow has trailing spaces
+$r = $c->sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
+
+# spaces and blank line
+@l = &
+
+ _( -49, -71 );
+
+# spaces and blank line
+$r = $c->
+
+ sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
+../snippets26.t c139.def
#5 c133.def
#6 git93.def
#7 git93.git93
+#8 c139.def
# To locate test #13 you can search for its name or the string '#13'
$x * sin($a) + $y * cos($a);
----------
+ 'c139' => <<'----------',
+# The '&' has trailing spaces
+@l = &
+_
+( -49, -71 );
+
+# This '$' has trailing spaces
+my $
+b = 40;
+
+# this arrow has trailing spaces
+$r = $c->
+sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
+
+# spaces and blank line
+@l = &
+
+_
+( -49, -71 );
+
+# spaces and blank line
+$r = $c->
+
+sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
+----------
+
'git93' => <<'----------',
use Cwd qw[cwd];
use Carp qw(carp);
no strict qw(vars);
#7...........
},
+
+ 'c139.def' => {
+ source => "c139",
+ params => "def",
+ expect => <<'#8...........',
+# The '&' has trailing spaces
+@l = &_( -49, -71 );
+
+# This '$' has trailing spaces
+my $b = 40;
+
+# this arrow has trailing spaces
+$r = $c->sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
+
+# spaces and blank line
+@l = &
+
+ _( -49, -71 );
+
+# spaces and blank line
+$r = $c->
+
+ sql_set_env_attr( $evh, $SQL_ATTR_ODBC_VERSION, $SQL_OV_ODBC2, 0 );
+#8...........
+ },
};
my $ntests = 0 + keys %{$rtests};