Ignore:
Timestamp:
2015-10-14T22:56:14+02:00 (6 years ago)
Author:
simon04
Message:

fix #10467 - MapCSS: allow comparisons in regexp key conditions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r8822 r8874  
    755755    float f;
    756756    int i;
     757    Condition.KeyMatchType matchType = null;;
    757758    Condition.Op op;
    758759    boolean considerValAsKey = false;
    759760}
    760761{
    761     key=tag_key() s()
     762    (
     763        key = regex() s() { matchType = Condition.KeyMatchType.REGEX; }
     764    |
     765        key=tag_key() s()
     766    )
    762767    (
    763768        LOOKAHEAD(3)
     
    807812            f=float_() { val=Float.toString(f); }
    808813    )
    809     { return Condition.createKeyValueCondition(key, val, op, context, considerValAsKey); }
     814    { return Condition.KeyMatchType.REGEX == matchType
     815            ? Condition.createRegexpKeyRegexpValueCondition(key, val, op)
     816            : Condition.createKeyValueCondition(key, val, op, context, considerValAsKey); }
    810817}
    811818
Note: See TracChangeset for help on using the changeset viewer.