Changeset 7115 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r7064 r7115 134 134 | < STRING: "\"" ( [" ","!","#"-"[","]"-"~","\u0080"-"\uFFFF"] | "\\\"" | "\\\\" )* "\"" > 135 135 | < #PREDEFINED: "\\" ["d","D","s","S","w","W"] > 136 | < #REGEX_CHAR_WITHOUT_STAR: [" "-")","+"-".","0"-"[","]"-"~","\u0080"-"\uFFFF"] | "\\/" | "\\\\" | "\\[" | "\\]" | "\\+" | "\\." | "\\'" | "\\\"" | <PREDEFINED> > 136 | < #REGEX_CHAR_WITHOUT_STAR: [" "-")","+"-".","0"-"[","]"-"~","\u0080"-"\uFFFF"] | "\\/" | "\\\\" | "\\[" | "\\]" | "\\+" | "\\." | "\\'" | "\\\"" | "\\(" | "\\)" |<PREDEFINED> > 137 137 | < REGEX: "/" <REGEX_CHAR_WITHOUT_STAR> ( <REGEX_CHAR_WITHOUT_STAR> | "*" )* "/" > 138 138 | < LBRACE: "{" > -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r7081 r7115 113 113 114 114 @Test 115 public void testRegexConditionParenthesis() throws Exception { 116 def condition = (Condition.KeyValueCondition) getParser("[name =~ /^\\(foo\\)/]").condition(Condition.Context.PRIMITIVE) 117 assert condition.applies(getEnvironment("name", "(foo)")) 118 assert !condition.applies(getEnvironment("name", "foo")) 119 assert !condition.applies(getEnvironment("name", "((foo))")) 120 } 121 122 @Test 115 123 public void testNegatedRegexCondition() throws Exception { 116 124 def condition = (Condition.KeyValueCondition) getParser("[surface!~/paved|unpaved/]").condition(Condition.Context.PRIMITIVE)
Note:
See TracChangeset
for help on using the changeset viewer.