Ignore:
Timestamp:
2010-01-15T21:58:46+01:00 (14 years ago)
Author:
jttt
Message:

Fixed #4377 routes plugin search for user names defect, added boolean search operator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java

    r2777 r2863  
    11// License: GPL. Copyright 2007 by Immanuel Scholz and others
    22package org.openstreetmap.josm.actions.search;
     3
     4import static org.openstreetmap.josm.tools.I18n.marktr;
     5import static org.openstreetmap.josm.tools.I18n.tr;
    36
    47import java.io.IOException;
     
    1922    }
    2023
    21     public enum Token {NOT, OR, LEFT_PARENT, RIGHT_PARENT, COLON, EQUALS, KEY, EOF}
     24    public enum Token {
     25        NOT(marktr("<not>")), OR(marktr("<or>")), LEFT_PARENT(marktr("<left parent>")),
     26        RIGHT_PARENT(marktr("<right parent>")), COLON(marktr("<colon>")), EQUALS(marktr("<equals>")),
     27        KEY(marktr("<key>")), QUESTION_MARK(marktr("<question mark>")), EOF(marktr("<end-of-file>"));
     28
     29        private Token(String name) {
     30            this.name = name;
     31        }
     32
     33        private final String name;
     34
     35        @Override
     36        public String toString() {
     37            return tr(name);
     38        }
     39    }
     40
    2241
    2342    private void getChar() {
     
    6988            getChar();
    7089            return Token.OR;
     90        case '?':
     91            getChar();
     92            return Token.QUESTION_MARK;
    7193        case '"':
    7294        {
     
    90112        {
    91113            StringBuilder s = new StringBuilder();
    92             while (!(c == -1 || Character.isWhitespace(c) || c == '"'|| c == ':' || c == '(' || c == ')' || c == '|' || c == '=')) {
     114            while (!(c == -1 || Character.isWhitespace(c) || c == '"'|| c == ':' || c == '(' || c == ')' || c == '|' || c == '=' || c == '?')) {
    93115                s.append((char)c);
    94116                getChar();
Note: See TracChangeset for help on using the changeset viewer.