diff options
| author | Teddy Wing | 2021-08-23 21:17:49 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-08-23 21:17:49 +0200 | 
| commit | 326a01a6bd43cb50b29ed49f9f08c6cbb6ff3be3 (patch) | |
| tree | a6f0af148de86bff129f160830174c281b2b15de /incdec.pl | |
| parent | 6fb6965372d71676d3d8246204f82bd91391123a (diff) | |
| download | readline-incdec-326a01a6bd43cb50b29ed49f9f08c6cbb6ff3be3.tar.bz2 | |
Remove incdec.pl
I created this file for testing. We no longer need it.
Diffstat (limited to 'incdec.pl')
| -rwxr-xr-x | incdec.pl | 56 | 
1 files changed, 0 insertions, 56 deletions
| diff --git a/incdec.pl b/incdec.pl deleted file mode 100755 index e60922e..0000000 --- a/incdec.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env perl -s -# -use strict; -use warnings; - -sub incdec { -	my ($line, $increment_by, $point_position, $is_backward) = @_; - -	$point_position ||= 0; -	$is_backward ||= 0; - -	my $start_position = 0; -	my $previous_match_start = 0; -	while ($line =~ /\b(-?\d+)\b/g) { -		if ($is_backward) { -			if ($point_position < $-[0]) { -				$start_position = $previous_match_start; - -				last; -			} - -			$previous_match_start = $-[0]; -		} -		else { -			if ($point_position < $+[0]) { -				$start_position = $-[0]; - -				last; -			} -		} -	} - -	if ($is_backward && $point_position == length $line) { -		$start_position = $previous_match_start; -	} - -	pos($line) = $start_position; -	$line =~ s/\G([^-\d]*)(-?\d+)/$1 . ($2 + $increment_by)/e; - -	return $line; -} - -# my $line = 'test 1 0'; -# my ${"increment-by"} = -1; -# my ${"point-position"} = 8; -# my $backward = 1; - -my $line = 'test 1 -2'; -my $increment_by = -1; -my $point_position = 9; -my $backward = 1; - -print "$line, $increment_by, $point_position, $backward\n"; -my $output = incdec($line, $increment_by, $point_position, $backward); -print $output; -print "\n"; | 
