Jungle-Bus / transport_mapcss

A set of uncompromising validation rules about public transport in JOSM
GNU General Public License v3.0
6 stars 4 forks source link

invalid syntax -osmose-item-class-level: #14

Closed Klumbumbus closed 6 years ago

Klumbumbus commented 6 years ago

In mapcss it is not allowed to start a line with -, so the code e.g.

relation.pt_route[!public_transport:version]
{
    throwError: tr("Missing public_transport:version tag on a public_transport route relation");
    -osmose-item-class-level: "2140/21401/3";
    assertNoMatch: "relation type=route route=bus public_transport:version=1";
    assertMatch: "relation type=route route=bus";
}

produces errors in the Java console e.g.:

2018-03-28 11:28:40.653 SCHWERWIEGEND: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "-" "- "" at line 44, column 2.
Was expecting one of:
    "set" ...
    <IDENT> ...
    <S> ...
    "/*" ...
org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "-" "- "" at line 44, column 2.
Was expecting one of:
    "set" ...
    <IDENT> ...
    <S> ...
    "/*" ...

    at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.error_skipto(MapCSSParser.java:2146)
    at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.sheet(MapCSSParser.java:894)
    at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.readMapCSS(MapCSSTagChecker.java:376)
    at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:748)
    at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.initialize(MapCSSTagChecker.java:775)
    at org.openstreetmap.josm.data.validation.OsmValidator.initializeTests(OsmValidator.java:384)
    at org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference.ok(ValidatorTagCheckerRulesPreference.java:142)
    at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane$PluginDownloadAfterTask.run(PreferenceTabbedPane.java:95)
    at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.savePreferences(PreferenceTabbedPane.java:427)
    at org.openstreetmap.josm.gui.preferences.PreferenceDialog$OKAction.actionPerformed(PreferenceDialog.java:201)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.WaitDispatchSupport$2.run(Unknown Source)
    at java.awt.WaitDispatchSupport$4.run(Unknown Source)
    at java.awt.WaitDispatchSupport$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(Unknown Source)
    at java.awt.Dialog.show(Unknown Source)
    at java.awt.Component.show(Unknown Source)
    at java.awt.Component.setVisible(Unknown Source)
    at java.awt.Window.setVisible(Unknown Source)
    at java.awt.Dialog.setVisible(Unknown Source)
    at org.openstreetmap.josm.gui.preferences.PreferenceDialog.setVisible(PreferenceDialog.java:141)
    at org.openstreetmap.josm.actions.PreferencesAction.run(PreferencesAction.java:112)
    at org.openstreetmap.josm.actions.PreferencesAction.actionPerformed(PreferencesAction.java:101)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

2018-03-28 11:28:40.653 SCHWERWIEGEND: Skipping to the next rule, because of an error:
Klumbumbus commented 6 years ago

I disabled it for now as the link gives a 404 error page. Please feel free to reactivate it once the link works again and the mapcss errors are fixed.

nlehuby commented 6 years ago

I've added back the link in the wiki as we now have a version which is ok.

For now, we have removed the -osmose-item-class-level: declaration Are there any other forbidden signs in the properties ? Would it be ok with _osmose-item-class-level ?

Klumbumbus commented 6 years ago

You can simply test it by adding the Rule to JOSM in the preferences, close the preferences by clicking on OK and watch if the Java console prints any errors (like the one I pasted above).

Klumbumbus commented 6 years ago

Thanks for fixing.