-$Id: Changes,v 1.7 2004-12-22 17:55:24 mike Exp $
+$Id: Changes,v 1.8 2004-12-23 10:24:11 mike Exp $
Revision history for Perl extension Net::Z3950::PQF.
0.03 (IN PROGRESS)
- Net::Z3950::PQF::TermNode and Net::Z3950::PQF::BooleanNode
are now subclasses of Net::Z3950::PQF::BooleanNode as
- documented.
- - Test script "t/1-node.t" now tests subclassness.
- - Support for Rset nodes.
- - Test script "t/1-node.t" now tests Rset nodes.
- - Support for parsing @set.
- - Test script "t/2-parser.t" now tests @set queries.
+ documented. Test script "t/1-node.t" now tests subclass
+ relationships.
+ - Support for Rset nodes. Test script "t/1-node.t" now tests
+ Rset nodes.
+ - Support for parsing @set. Test script "t/2-parser.t" now
+ tests @set queries.
+ - Handle multi-word terms enclosed in {curly brackets}. Test
+ script "t/2-parser.t" tests this.
0.02 Fri Dec 17 17:17:47 GMT 2004
- Write the code! First functional version.
### Still to do:
- Correct handling of double-quoted terms, so that backslash can
- protect embedded double quotes.
- Handle multi-word terms enclosed in {curly brackets}
- Support for creating and rendering ProxNode.
- Support for parsing @prox.
- Support for parsing @term.
+ - Correct handling of double-quoted terms, so that backslash
+ can protect embedded double quotes.
+ - Support for creating and rendering ProxNode.
+ - Support for parsing @prox.
+ - Support for parsing @term.
-# $Id: PQF.pm,v 1.6 2004-12-20 09:46:58 mike Exp $
+# $Id: PQF.pm,v 1.7 2004-12-23 10:24:12 mike Exp $
package Net::Z3950::PQF;
my $this = shift();
my($attrset, $attrhash) = @_;
+ $this->{text} =~ s/^\s+//;
+
### This rather nasty hack for quoted terms doesn't recognised
# backslash-quoted embedded double quotes.
- $this->{text} =~ s/^\s+//;
if ($this->{text} =~ s/^"(.*?)"//) {
return $this->_leaf('term', $1, $attrhash);
}
+ # Also recognise multi-word terms enclosed in {curly braces}
+ if ($this->{text} =~ s/^{(.*?)}//) {
+ return $this->_leaf('term', $1, $attrhash);
+ }
+
my $word = $this->_word();
if ($word eq '@attrset') {
$attrset = $this->_word();
-# $Id: 2-parser.t,v 1.3 2004-12-20 09:46:58 mike Exp $
+# $Id: 2-parser.t,v 1.4 2004-12-23 10:24:12 mike Exp $
use strict;
use warnings;
"term: brian" ],
[ '"brian kernighan"',
"term: brian kernighan" ],
+ [ '{brian kernighan}',
+ "term: brian kernighan" ],
[ '@attr 1=1003 brian',
"term: brian\n\tattr: bib-1 1=1003" ],
[ '@attr 1=1003 "brian"',