Changeset 6665
- Timestamp:
- 03/07/10 01:57:57 (3 years ago)
- Location:
- trunk/core/lib/Foswiki
- Files:
-
- 3 edited
-
Infix/Parser.pm (modified) (3 diffs)
-
Search.pm (modified) (4 diffs)
-
Search/Parser.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/lib/Foswiki/Infix/Parser.pm
r5809 r6665 87 87 88 88 return $this; 89 } 90 91 =begin TML 92 93 ---++ ObjectMethod finish() 94 Break circular references. 95 96 =cut 97 98 sub finish { 99 my $self = shift; 100 89 101 } 90 102 … … 218 230 print STDERR "Tok: qs '$1'\n" if MONITOR_PARSER; 219 231 my $val = $2; 232 220 233 # Handle escaped characters in the string 221 234 $val =~ s/(?<!\\)\\(.)/$1/g; … … 310 323 Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/, http://Foswiki.org/ 311 324 312 # Copyright (C) 2008-20 09Foswiki Contributors. All Rights Reserved.325 # Copyright (C) 2008-2010 Foswiki Contributors. All Rights Reserved. 313 326 # Foswiki Contributors are listed in the AUTHORS file in the root 314 327 # of this distribution. NOTE: Please extend that file, not this notice. -
trunk/core/lib/Foswiki/Search.pm
r6595 r6665 21 21 use Foswiki::WebFilter (); 22 22 23 #TODO: move these into a more appropriate place - they are function objects so can persist for a _long_ time24 my $queryParser;25 my $searchParser;26 27 23 BEGIN { 28 24 … … 64 60 my $this = shift; 65 61 undef $this->{session}; 62 63 # these may well be function objects, but if (a setting changes, it needs to be picked up again. 64 if ( defined($this->{queryParser}) ) { 65 $this->{queryParser}->finish(); 66 undef $this->{queryParser}; 67 } 68 if ( defined($this->{searchParser}) ) { 69 $this->{searchParser}->finish(); 70 undef $this->{searchParser}; 71 } 66 72 } 67 73 … … 355 361 my $theParser; 356 362 if ( $params{type} eq 'query' ) { 357 unless ( defined($ queryParser) ) {363 unless ( defined($this->{queryParser}) ) { 358 364 require Foswiki::Query::Parser; 359 $ queryParser= new Foswiki::Query::Parser();360 } 361 $theParser = $ queryParser;365 $this->{queryParser} = new Foswiki::Query::Parser(); 366 } 367 $theParser = $this->{queryParser}; 362 368 } 363 369 else { 364 unless ( defined($ searchParser) ) {370 unless ( defined($this->{searchParser}) ) { 365 371 require Foswiki::Search::Parser; 366 $ searchParser= new Foswiki::Search::Parser($session);367 } 368 $theParser = $ searchParser;372 $this->{searchParser} = new Foswiki::Search::Parser($session); 373 } 374 $theParser = $this->{searchParser}; 369 375 } 370 376 try { … … 710 716 711 717 #TODO: i wonder if this shoudl be a HoistRE.. 718 #TODO: well, um, and how does this work for query search? 712 719 my @tokens = @{ $query->{tokens} }; 713 720 my $pattern = $tokens[$#tokens]; # last token in an AND search -
trunk/core/lib/Foswiki/Search/Parser.pm
r6582 r6665 48 48 # Build pattern of stop words 49 49 my $prefs = $this->{session}->{prefs}; 50 ASSERT($prefs) if DEBUG; 50 51 $this->{stopwords} = $prefs->getPreference('SEARCHSTOPWORDS') || ''; 51 52 $this->{stopwords} =~ s/[\s\,]+/\|/go; … … 53 54 54 55 $this->{initialised} = 1; 56 } 57 58 =begin TML 59 60 ---++ ObjectMethod finish() 61 Break circular references. 62 63 =cut 64 65 sub finish { 66 my $self = shift; 67 68 undef $self->{stopwords}; 69 undef $self->{initialised}; 55 70 } 56 71
Note: See TracChangeset
for help on using the changeset viewer.
