- Timestamp:
- 2015-10-04T17:53:14+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r8812 r8822 11 11 import java.util.Collection; 12 12 import java.util.HashMap; 13 import java.util.List; 13 14 import java.util.Locale; 14 15 import java.util.Map; … … 29 30 import org.openstreetmap.josm.data.osm.Way; 30 31 import org.openstreetmap.josm.gui.mappaint.Environment; 31 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;32 32 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector; 33 33 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser; … … 1440 1440 static Match compileMapCSS(String mapCSS) throws ParseError { 1441 1441 try { 1442 final Selector selector = new MapCSSParser(new StringReader(mapCSS)).selector();1442 final List<Selector> selectors = new MapCSSParser(new StringReader(mapCSS)).selectors(); 1443 1443 return new Match() { 1444 1444 @Override 1445 1445 public boolean match(OsmPrimitive osm) { 1446 return selector.matches(new Environment(osm)); 1446 for (Selector selector : selectors) { 1447 if (selector.matches(new Environment(osm))) { 1448 return true; 1449 } 1450 } 1451 return false; 1447 1452 } 1448 1453 }; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r8791 r8822 604 604 void rule(): 605 605 { 606 List<Selector> selectors = new ArrayList<Selector>(); 607 Selector sel; 606 List<Selector> selectors; 608 607 Declaration decl; 609 608 } 610 609 { 611 sel=child_selector() { selectors.add(sel); } 612 ( 613 <COMMA> w() 614 sel=child_selector() { selectors.add(sel); } 615 )* 610 selectors=selectors() 616 611 decl=declaration() 617 612 { … … 620 615 } 621 616 } 617 } 618 619 List<Selector> selectors(): 620 { 621 List<Selector> selectors = new ArrayList<Selector>(); 622 Selector sel; 623 } 624 { 625 sel=child_selector() { selectors.add(sel); } 626 ( 627 <COMMA> w() 628 sel=child_selector() { selectors.add(sel); } 629 )* 630 { return selectors; } 622 631 } 623 632
Note:
See TracChangeset
for help on using the changeset viewer.