diff options
| author | fukachan <fukachan> | 2002-12-18 04:46:21 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-12-18 04:46:21 +0000 |
| commit | 1f8cef8cc30dc332a480028e497fb31168f5536a (patch) | |
| tree | 0a4efdcc579729fc4ccbd2a14068c5a0821d8ae0 /fml/lib/FML/Command/DataCheck.pm | |
| parent | 4bc5864a9468da9e0874a826575c54e6114c0583 (diff) | |
| download | fml8-1f8cef8cc30dc332a480028e497fb31168f5536a.tar.gz fml8-1f8cef8cc30dc332a480028e497fb31168f5536a.tar.bz2 fml8-1f8cef8cc30dc332a480028e497fb31168f5536a.zip | |
clean up comments
Diffstat (limited to 'fml/lib/FML/Command/DataCheck.pm')
| -rw-r--r-- | fml/lib/FML/Command/DataCheck.pm | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/fml/lib/FML/Command/DataCheck.pm b/fml/lib/FML/Command/DataCheck.pm index bc077e17..87961e7f 100644 --- a/fml/lib/FML/Command/DataCheck.pm +++ b/fml/lib/FML/Command/DataCheck.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: DataCheck.pm,v 1.5 2002/09/11 23:18:05 fukachan Exp $ +# $FML: DataCheck.pm,v 1.6 2002/09/22 14:56:42 fukachan Exp $ # package FML::Command::DataCheck; @@ -16,7 +16,7 @@ use FML::Log qw(Log LogWarn LogError); =head1 NAME -FML::Command::DataCheck - check data as command(s) +FML::Command::DataCheck - parse, clean up et.al. for command buffer =head1 SYNOPSIS @@ -42,7 +42,7 @@ sub new } -# Descriptions: return command name ( ^\S+ in $command ). +# Descriptions: return command name ( ^\S+ in $command ) and the sub name. # remove the prepending strings such as \s, #, ... # Arguments: OBJ($self) STR($command) # Side Effects: none @@ -57,8 +57,7 @@ sub parse_command_buffer } -# Descriptions: parse command buffer to make -# argument vector after command name +# Descriptions: return arguments after command name $comname in $command. # Arguments: OBJ($self) STR($command) STR($comname) # Side Effects: none # Return Value: ARRAY_REF @@ -68,6 +67,14 @@ sub parse_command_arguments my $found = 0; my (@options) = (); + # XXX-TODO: $comname matches exactly. + # XXX-TODO: so, you need lower/uppercase before this routine. + + # pick up arguments into @options after $comname. + # Example: + # $comname = "subscribe"; + # $command = "subscribe rudo von schmit"; + # @options = [ 'rudo', 'von', 'shmit' ]; for my $buf (split(/\s+/, $command)) { push(@options, $buf) if $found; $found = 1 if $buf eq $comname; @@ -77,8 +84,8 @@ sub parse_command_arguments } -# Descriptions: check message of the current process -# whether it contais keyword e.g. "confirm". +# Descriptions: check the message of the current process to find +# whether it contais some special keyword e.g. "confirm". # Arguments: OBJ($self) OBJ($curproc) ARRAY_REF($ra_data) # Side Effects: none # Return Value: HASH_REF @@ -95,6 +102,8 @@ sub find_special_keyword $confirm_prefix = $self->clean_up($confirm_prefix); $admin_prefix = $self->clean_up($admin_prefix); + # XXX $ra_data is not whole body but already parsed and prepared buffer. + # XXX See below and FML::Process::Command module, for example. for my $buf (@$ra_data) { if ($buf =~ /$confirm_prefix\s+\w+\s+([\w\d]+)/) { $confirm_found = $1; @@ -112,9 +121,9 @@ sub find_special_keyword } -# Descriptions: check message of the current process -# whether it contais keyword e.g. "confirm". -# Arguments: OBJ($self) OBJ($curproc) ARRAY_REF($ra_data) +# Descriptions: check the message of the current process to find +# whether it contais special keyword e.g. "confirm". +# Arguments: OBJ($self) OBJ($curproc) # Side Effects: none # Return Value: NUM( 1 or ) sub find_commands_for_stranger @@ -133,6 +142,8 @@ sub find_commands_for_stranger next LINE unless defined($comname) && $comname; # $comname matches one of $commands_for_stranger ? + # XXX-TODO: we need to care for lowercase/uppercase mismtach ? + # XXX-TODO: need to define macro EQUAL_CASE_INSENSITIVE(a,b) ? COMMAND: for my $proc (@$commands) { next COMMAND unless defined($proc) && $proc; @@ -168,10 +179,6 @@ sub clean_up See C<http://www.fml.org/software/FNF/> on fml coding style guide. -=head1 CODING STYLE - -See C<http://www.fml.org/software/FNF/> on fml coding style guide. - =head1 AUTHOR Ken'ichi Fukamachi |
