pike.git / lib / modules / Search.pmod / Grammar.pmod / DefaultParser.pike

version» Context lines:

pike.git/lib/modules/Search.pmod/Grammar.pmod/DefaultParser.pike:1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: DefaultParser.pike,v 1.7 2001/06/22 01:28:35 nilsson Exp $ + // $Id: DefaultParser.pike,v 1.8 2002/05/15 14:28:53 mattias Exp $      static inherit Search.Grammar.AbstractParser;   static inherit Search.Grammar.Lexer;   static private inherit "./module.pmod";   //static constant ParseNode = Search.Grammar.ParseNode;   //static constant OrNode = Search.Grammar.OrNode;   //static constant AndNode = Search.Grammar.AndNode;   //static constant TextNode = Search.Grammar.TextNode;      #include "debug.h"
pike.git/lib/modules/Search.pmod/Grammar.pmod/DefaultParser.pike:255:       if (!prefix && options["implicit"] == "and")    prefix = '+';       while (!(< TOKEN_TEXT, TOKEN_END >) [ peek()[0] ])    advance(); // ... ????????? or something smarter ?????       if (peek()[0] == TOKEN_TEXT) {    string text = peek()[1];    advance(); +  string star = "86196759014593256"; +  string questionmark = "76196758925470133"; +  text=replace(text,({"*","?"}), ({star, questionmark}));    array(string) words = Unicode.split_words_and_normalize(text); -  +  for(int i=0; i<sizeof(words); i++) +  words[i]=replace(words[i], ({star, questionmark}), ({"*","?"})); +  // End of abominable kludge    if (!words || !sizeof(words))    return;    if (sizeof(words) == 1)    switch (prefix) {    case '+': node->plusWords += words; break;    case '-': node->minusWords += words; break;    default: node->words += words; break;    }    else if (sizeof(words) > 1)    switch (prefix) {