Changeset 17937 in josm for trunk


Ignore:
Timestamp:
2021-06-21T22:43:22+02:00 (3 years ago)
Author:
Klumbumbus
Message:

see #20987 - Better regex for warnings about unusual values of turn(:lanes(:forward|:backward|:both_ways)) (patch by skyper)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/resources/data/validator/highway.mapcss

    r17935 r17937  
    167167
    168168/* #20987 */
    169 way[turn                ][turn                 !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;)+$/],
    170 way[turn:forward        ][turn:forward         !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;)+$/],
    171 way[turn:backward       ][turn:backward        !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;)+$/],
    172 way[turn:both_ways      ][turn:both_ways       !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;)+$/],
    173 way[turn:lanes          ][turn:lanes           !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;|\|)+$/],
    174 way[turn:lanes:forward  ][turn:lanes:forward   !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;|\|)+$/],
    175 way[turn:lanes:backward ][turn:lanes:backward  !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;|\|)+$/],
    176 way[turn:lanes:both_ways][turn:lanes:both_ways !~ /^((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through|none|;|\|)+$/] {
     169way[turn                         ][turn                          !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
     170way[turn:forward                 ][turn:forward                  !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
     171way[turn:backward                ][turn:backward                 !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
     172way[turn:both_ways               ][turn:both_ways                !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
     173way[turn:both_ways:forward       ][turn:both_ways:forward        !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
     174way[turn:both_ways:backward      ][turn:both_ways:backward       !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
     175way[turn:lanes                   ][turn:lanes                    !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
     176way[turn:lanes:forward           ][turn:lanes:forward            !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
     177way[turn:lanes:backward          ][turn:lanes:backward           !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
     178way[turn:lanes:both_ways         ][turn:lanes:both_ways          !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
     179way[turn:lanes:both_ways:forward ][turn:lanes:both_ways:forward  !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
     180way[turn:lanes:both_ways:backward][turn:lanes:both_ways:backward !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/] {
    177181  throwWarning: tr("unusual value of {0}", "{0.key}");
    178182  assertMatch: "way turn=straight"; /* through would be correct */
     
    182186  assertMatch: "way turn:lanes:forward=straight|right"; /* through would be correct */
    183187  assertMatch: "way turn:lanes:forward=slight_reverse|right"; /* wrong value */
     188  assertMatch: "way turn:lanes=left;none|right"; /* "none" needs to be a solo value */
    184189  assertNoMatch: "way turn:lanes:forward=sharp_left;left|left;through;slight_right|slight_right;right";
    185190}
Note: See TracChangeset for help on using the changeset viewer.