Changeset 7166 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r7115 r7166 524 524 ( 525 525 ( 526 <GREATER> { type = Selector.ChildOrParentSelectorType.CHILD; } 526 ( 527 <GREATER> { type = Selector.ChildOrParentSelectorType.CHILD; } 528 | 529 <LESS> { type = Selector.ChildOrParentSelectorType.PARENT; } 530 | 531 <PLUS> { type = Selector.ChildOrParentSelectorType.SIBLING; } 532 ) 533 ( ( c=condition(Context.LINK) | c=class_or_pseudoclass(Context.LINK) ) { conditions.add(c); } )* 527 534 | 528 < LESS> { type = Selector.ChildOrParentSelectorType.PARENT; }535 <ELEMENT_OF> { type = Selector.ChildOrParentSelectorType.ELEMENT_OF; } 529 536 | 530 < PLUS> { type = Selector.ChildOrParentSelectorType.SIBLING; }537 <CROSSING> { type = Selector.ChildOrParentSelectorType.CROSSING; } 531 538 ) 532 ( ( c=condition(Context.LINK) | c=class_or_pseudoclass(Context.LINK) ) { conditions.add(c); } )* 533 | 534 <ELEMENT_OF> { type = Selector.ChildOrParentSelectorType.ELEMENT_OF; } 535 | 536 <CROSSING> { type = Selector.ChildOrParentSelectorType.CROSSING; } 539 w() 540 | 541 { /* <GREATER> is optional for child selector */ type = Selector.ChildOrParentSelectorType.CHILD; } 537 542 ) 538 543 { selLink = new LinkSelector(conditions); } 539 w()540 544 selRight=selector() w() 541 545 )? -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r7138 r7166 97 97 */ 98 98 public ChildOrParentSelector(Selector a, LinkSelector link, Selector b, ChildOrParentSelectorType type) { 99 CheckParameterUtil.ensureParameterNotNull(a, "a"); 100 CheckParameterUtil.ensureParameterNotNull(b, "b"); 101 CheckParameterUtil.ensureParameterNotNull(link, "link"); 102 CheckParameterUtil.ensureParameterNotNull(type, "type"); 99 103 this.left = a; 100 104 this.link = link; -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r7165 r7166 257 257 258 258 @Test 259 public void testChildSelectorGreaterThanSignIsOptional() throws Exception { 260 assert getParser("relation[type=route] way[highway]").child_selector().toString() == 261 getParser("relation[type=route] > way[highway]").child_selector().toString() 262 } 263 264 @Test 259 265 public void testSiblingSelector() throws Exception { 260 266 def s1 = (Selector.ChildOrParentSelector) getParser("*[a?][parent_tag(\"highway\")=\"unclassified\"] + *[b?]").child_selector()
Note:
See TracChangeset
for help on using the changeset viewer.