Changeset 14489 in josm for trunk/src


Ignore:
Timestamp:
2018-12-02T15:30:24+01:00 (6 years ago)
Author:
Don-vip
Message:

see #17053 - fix parsing regression involving the - operator

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r14486 r14489  
    469469                    try {
    470470                        final String val = ai.val instanceof Expression
    471                                 ? Optional.of(((Expression) ai.val).evaluate(new Environment())).map(Object::toString).orElse(null)
     471                                ? Optional.ofNullable(((Expression) ai.val).evaluate(new Environment())).map(Object::toString).orElse(null)
    472472                                : ai.val instanceof String
    473473                                ? (String) ai.val
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r14481 r14489  
    166166{
    167167    < IDENT: ["a"-"z","A"-"Z","_"] ( ["a"-"z","A"-"Z","_","-","0"-"9"] )* >
    168 |   < EXTIDENT: <MINUS> <IDENT> >
    169168|   < UINT: ( ["0"-"9"] )+ >
    170169|   < STRING: "\"" ( [" ","!","#"-"[","]"-"~","\u0080"-"\uFFFF"] | "\\\"" | "\\\\" )*  "\"" >
     
    284283{
    285284    (
    286         (t=<PP_AND> | t=<PP_OR> | t=<PP_NOT> | t=<UINT> | t=<STRING> | t=<REGEX> | t=<LPAR> | t=<RPAR> | t=<COMMA> | t=<COLON> | t=<IDENT> | t=<EXTIDENT> | t=<PP_SOMETHING_ELSE>) { if (write) sb.append(t.image); }
     285        (t=<PP_AND> | t=<PP_OR> | t=<PP_NOT> | t=<UINT> | t=<STRING> | t=<REGEX> | t=<LPAR> | t=<RPAR> | t=<COMMA> | t=<COLON> | t=<IDENT> | t=<PP_SOMETHING_ELSE>) { if (write) sb.append(t.image); }
    287286        |
    288287            pp_w1()
     
    907906        )
    908907    |
    909         <EXTIDENT> w() <COLON> w() expression() <SEMICOLON> w()
     908        <MINUS> <IDENT> w() <COLON> w() expression() <SEMICOLON> w()
    910909    |
    911910        key=<IDENT> w() <COLON> w()
Note: See TracChangeset for help on using the changeset viewer.