NAME
Parrot::SearchOps - functions used in tools/dev/search-ops.pl
SYNOPSIS
use Parrot::SearchOps qw(
search_all_ops_files
usage
help
);
$total_identified = search_all_ops_files(
$pattern, $wrap_width, $opsdir
);
usage();
help();
DESCRIPTION
This package provides functionality for the Perl 5 program tools/dev/search-ops.pl, designed to replace the Python program tools/docs/search-ops.py. It exports two subroutines on demand.
search_all_ops_files()
Purpose: Searches all .ops files in src/ops/ for ops codes and their descriptions. Those that match the specified pattern are printed to STDOUT.
Arguments: Three scalars.
$pattern
Perl 5 regular expression. So
concat
will be matched by bothconcat
andn_concat
.$wrap_width
In tools/dev/search-ops.pl, this is set to
70
characters. Can be varied during testing or development.$opsdir
In tools/dev/search-ops.pl, this is set to src/ops/. Can be varied during testing or development.
Return Value: Number of times the pattern was matched by ops codes in all files.
usage()
Purpose: Display usage statement for tools/dev/search-ops.pl.
Arguments: None.
Return Value:
Implicitly returns true upon success.
help()
Purpose: Display usage statement and more complete help message for tools/dev/search-ops.pl.
Arguments: None.
Return Value:
Implicitly returns true upon success.
AUTHOR
James E Keenan, adapting Python program written by Bernhard Schmalhofer.