Modify

Opened 12 days ago

Last modified 10 days ago

#19907 reopened defect

numeric.mapcss regex and silent fail of fixAdd

Reported by: frodrigo Owned by: team
Priority: normal Milestone: 20.10
Component: Core validator Version:
Keywords: Cc:

Description

The meter part
https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/numeric.mapcss#L156
https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/numeric.mapcss#L188
it is not done like the feet part
https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/numeric.mapcss#L166
https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/numeric.mapcss#L198

The regex meter ([0-9]*\.?[0-9]*) match event without any number ("m" what the regex) while the feet one ([0-9]+\.?[0-9]*) require at least a number.

If the rule matchs without number the following regex in the fixAdd does not have match. It looks like to me, JOSM silently fails on the fixAdd error.

I found this with the Osmose MapCSS implementation. On Osmose the fixAdd fails with an error.

Attachments (0)

Change History (6)

comment:1 Changed 12 days ago by Klumbumbus

Resolution: fixed
Status: newclosed

In 17145/josm:

fix #19907 - Don't autofix width|maxwidth=metre|metres|meter|meters|Metre|Metres|Meter|Meters|m to width|maxwidth= metre| metres| meter| meters| Metre| Metres| Meter| Meters| m

comment:2 Changed 12 days ago by Klumbumbus

Milestone: 20.10

comment:3 Changed 11 days ago by skyper

maxheight and maxlength could be adjusted as cases with leading zero are missed, atm.

In general we miss cases without leading numbers like .25meters, now. Think syntax need to be changed to e.g.:

*[width][width =~ /^([0-9]+\.?[0-9]*|\.[0-9]+)(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
Last edited 10 days ago by skyper (previous) (diff)

comment:4 Changed 10 days ago by gaben

Resolution: fixed
Status: closedreopened

comment:5 Changed 10 days ago by Famlam

Perhaps also good to note - since they're now being adjusted - that the regexes in numeric.mapcss all consider "2. m" as valid. Not sure if that's supposed to happen.

comment:6 Changed 10 days ago by gaben

Probably not, but it seems very edge case.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to frodrigo
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.