diff --git a/resources/data/validator/numeric.mapcss b/resources/data/validator/numeric.mapcss
index ff190dd326..04052d55ec 100644
a
|
b
|
|
39 | 39 | assertMatch: "node building:levels=-foo"; |
40 | 40 | assertNoMatch: "node level=-1"; |
41 | 41 | } |
| 42 | *[building:levels][building:levels !~ /^(([0-9]|[1-9][0-9]*)(\.5)?)$/]!.negative_value { |
| 43 | throwWarning: tr("{0} should have numbers only with optional .5 increments", "{0.key}"); |
| 44 | assertNoMatch: "node building:levels=1.5"; |
| 45 | assertNoMatch: "node building:levels=-1"; /* excluded here via !.negative_value in selector */ |
| 46 | assertMatch: "node building:levels=1A"; |
| 47 | assertNoMatch: "node building:levels=0"; /* valid because there can be building:levels:underground > 0 or roof:levels > 0 */ |
| 48 | } |
42 | 49 | |
43 | | *[building:levels][building:levels !~ /^(([0-9]|[1-9][0-9]*)(\.5)?)$/]!.negative_value, |
44 | | *[level][level !~ /^((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5)(;((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5))*$/] { /* all numbers from -∞ to ∞ in 0.5 steps, optional multiple values separated by a ; */ |
| 50 | /* level values: all numbers from -∞ to ∞ in 0.5 steps, optional multiple values separated by a ;, optional second value separated by a - */ |
| 51 | *[level][level !~ /^((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5)(?:(;((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5))*|(-((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5)))$/] { |
45 | 52 | throwWarning: tr("{0} should have numbers only with optional .5 increments", "{0.key}"); |
46 | 53 | assertMatch: "node level=one"; |
47 | 54 | assertMatch: "node level=01"; |
… |
… |
|
49 | 56 | assertMatch: "node level=-01.5"; |
50 | 57 | assertMatch: "node level=2.3"; |
51 | 58 | assertMatch: "node level=-0"; |
| 59 | assertMatch: "node level=1-2-3"; |
52 | 60 | assertNoMatch: "node level=0"; |
53 | 61 | assertNoMatch: "node level=1"; |
54 | 62 | assertNoMatch: "node level=-1"; |
… |
… |
|
61 | 69 | assertNoMatch: "node level=0;-0.5"; |
62 | 70 | assertNoMatch: "node level=-0.5;0"; |
63 | 71 | assertNoMatch: "node level=-1;-0.5"; |
64 | | assertNoMatch: "node building:levels=1.5"; |
65 | | assertNoMatch: "node building:levels=-1"; /* tested already by rule above "negative values" and excluded here via !.negative_value in selector */ |
66 | | assertMatch: "node building:levels=1A"; |
67 | | assertNoMatch: "node building:levels=0"; /* valid because there can be building:levels:underground > 0 or roof:levels > 0 */ |
| 72 | assertNoMatch: "node level=0-3"; |
| 73 | assertNoMatch: "node level=-1-100"; |
68 | 74 | } |
69 | 75 | |
70 | 76 | *[roof:height][siunit_length(tag("roof:height")) == 0][roof:shape=flat] { |