Modify

Opened 10 years ago

Closed 8 years ago

#10467 closed enhancement (fixed)

[Patch] regex in key conditions doesn't allow comparisons

Reported by: naoliv Owned by: simon04
Priority: normal Milestone: 15.10
Component: Core validator Version:
Keywords: mapcss Cc: lists@…

Description

It seems that regex in key conditions [6547] doesn't allow comparisons.
For example:

*[/^source/ =~ /.*,.*/] {
        throwOther: tr("you should use ;");
}

gives

org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " <REGEX> "/^source/ "" at line 512, column 3.
Was expecting one of:
    "set" ...
    <IDENT> ...
    <UINT> ...
    <STRING> ...
    "(" ...
    <UFLOAT> ...
    <HEXCOLOR> ...
    <S> ...
    "!" ...
    "+" ...
    "-" ...
    "!" ...
    <STRING> ...
    <IDENT> ...
    "set" ...
    
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.error_skipto(MapCSSParser.java:1805)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.sheet(MapCSSParser.java:677)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.readMapCSS(MapCSSTagChecker.java:267)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.readMapCSS(MapCSSTagChecker.java:261)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:566)
	at org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:143)
	at org.openstreetmap.josm.io.FileWatcher.access$000(FileWatcher.java:30)
	at org.openstreetmap.josm.io.FileWatcher$1.run(FileWatcher.java:46)
	at java.lang.Thread.run(Thread.java:745)

JOSM:

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-09-02 01:36:00
Last Changed Author: Don-vip
Revision: 7485
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-09-02 02:57:38 +0200 (Tue, 02 Sep 2014)
Last Changed Rev: 7485

Attachments (1)

10467.patch (6.3 KB ) - added by simon04 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by bastiK, 10 years ago

Type: defectenhancement

This syntax is not supported at the moment.

comment:2 by Aun Johnsen <lists@…>, 10 years ago

Cc: lists@… added

comment:3 by simon04, 8 years ago

Milestone: 15.10
Owner: changed from team to simon04
Status: newassigned
Summary: regex in key conditions doesn't allow comparisons[Patch] regex in key conditions doesn't allow comparisons

by simon04, 8 years ago

Attachment: 10467.patch added

comment:4 by simon04, 8 years ago

Any objections for yet another key/value/select/feature? :)

comment:5 by simon04, 8 years ago

Resolution: fixed
Status: assignedclosed

In 8874/josm:

fix #10467 - MapCSS: allow comparisons in regexp key conditions

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.